Merge pull request #8 from hmalik144/circleci_results_publish

Circleci results publish
This commit is contained in:
2023-02-25 21:41:24 +00:00
committed by GitHub
3 changed files with 24 additions and 5 deletions

View File

@@ -25,15 +25,20 @@ jobs:
# Checkout the code as the first step.
- checkout
# The next step will run the unit tests
- android/run-tests:
test-command: ./gradlew lint testDebug --continue
# Then start the emulator and run the Instrumentation tests!
- android/start-emulator-and-run-tests:
test-command: ./gradlew connectedCheck
system-image: system-images;android-25;google_apis;x86
# Then publish the artifacts of the Instrumentation tests!
- store_artifacts:
path: app/build/reports/androidTests/connected
destination: reports
# Then publish the results of the Instrumentation tests!
- store_test_results:
path: app/build/outputs/androidTest-results/connected
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:

View File

@@ -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

View File

@@ -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")
}
}