diff --git a/.circleci/config.yml b/.circleci/config.yml index 87ffdac..e769549 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,6 +34,11 @@ jobs: test-command: ./gradlew connectedCheck system-image: system-images;android-25;google_apis;x86 + # Then publish the results of the Instrumentation tests! + - store_artifacts: + path: app/build/reports + destination: reports + # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: diff --git a/app/src/androidTest/assets/features/sample.feature b/app/src/androidTest/assets/features/sample.feature index bc2e3d5..d0d9544 100644 --- a/app/src/androidTest/assets/features/sample.feature +++ b/app/src/androidTest/assets/features/sample.feature @@ -3,3 +3,7 @@ Feature: Sample feature file @sample_test Scenario: Successful login Given I start the application + + @sample_test + Scenario: Unsuccessful login + Given I start the application and throw an exception diff --git a/app/src/androidTest/java/com/example/sumtest/steps/SampleSteps.kt b/app/src/androidTest/java/com/example/sumtest/steps/SampleSteps.kt index 6b65a58..475d351 100644 --- a/app/src/androidTest/java/com/example/sumtest/steps/SampleSteps.kt +++ b/app/src/androidTest/java/com/example/sumtest/steps/SampleSteps.kt @@ -18,11 +18,21 @@ class SampleSteps { } @Given("I start the application") - fun I_start_the_application() { + fun i_start_the_application() { mActivityScenarioRule.moveToState(Lifecycle.State.STARTED) val appContext = InstrumentationRegistry.getInstrumentation().targetContext Assert.assertEquals("com.example.sumtest", appContext.packageName) } + @Given("I start the application and throw an exception") + fun i_start_the_application_and_throw_an_exception() { + mActivityScenarioRule.moveToState(Lifecycle.State.STARTED) + + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + Assert.assertEquals("com.example.sumtest", appContext.packageName) + + throw Exception("This is an exception") + } + } \ No newline at end of file