Conversation
danicretu
left a comment
There was a problem hiding this comment.
Great work Syeda, thank you! I left a couple of comments, nothing big, mostly related to renaming and removing unused code.
Also, please take a look at the git commit template we use in the repository and use the agreed convention when committing:
ci(ui-automation): Add Espresso for GiniBankSDKExample
PM-89
...ample-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/HelpScreen.kt
Outdated
Show resolved
Hide resolved
...le-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/CaptureScreen.kt
Outdated
Show resolved
Hide resolved
...ample-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/HelpScreen.kt
Outdated
Show resolved
Hide resolved
...ample-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/HelpScreen.kt
Outdated
Show resolved
Hide resolved
...ample-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/MainScreen.kt
Outdated
Show resolved
Hide resolved
...ample-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/MainScreen.kt
Outdated
Show resolved
Hide resolved
...ample-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/MainScreen.kt
Outdated
Show resolved
Hide resolved
...ample-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/MainScreen.kt
Outdated
Show resolved
Hide resolved
...app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/OnboardingScreen.kt
Outdated
Show resolved
Hide resolved
...p/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/testcases/MainActivityTest.kt
Outdated
Show resolved
Hide resolved
|
@danicretu We've discussed the commit style for automation specifically and here is the reference for the structure of commit |
|
Thanks @danicretu for your input. |
danicretu
left a comment
There was a problem hiding this comment.
Thank you for the changes, Syeda!
There was a problem hiding this comment.
Great work, @SyedaGini! I still see some improvement potential though 🙈
Thank you for using the POM pattern! For the tests I would advise to apply these tips:
- Explicitly state in the test method name what is tested. It's ok to have long test method names.
- A test should generally assert one thing only at the end of the test. There can and will be exceptions, but as a rule of thumb try to assert only one thing at the end of the test.
- Tests should be independent so that we can run one specific test without having to run x nr of other tests before it. Imagine we want to fix
test30_...and then we would need to run the previous 29 tests each time we want to see if test 30 works or not...
...ample-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/HelpScreen.kt
Outdated
Show resolved
Hide resolved
...ample-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/HelpScreen.kt
Outdated
Show resolved
Hide resolved
...ample-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/HelpScreen.kt
Outdated
Show resolved
Hide resolved
...p/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/testcases/MainActivityTest.kt
Outdated
Show resolved
Hide resolved
...p/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/testcases/MainActivityTest.kt
Outdated
Show resolved
Hide resolved
...p/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/testcases/MainActivityTest.kt
Outdated
Show resolved
Hide resolved
...p/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/testcases/MainActivityTest.kt
Outdated
Show resolved
Hide resolved
|
@a-szotyori the requested changes are incorporated, thank you! |
a-szotyori
left a comment
There was a problem hiding this comment.
Thank you, Syeda! As discussed on Slack please don't merge it yet.
8013abc to
88dd996
Compare
…indow` The emulator won't start without `-no-window` on GitHub Action runners. This reverts commit 2aea8c9. PM-89
|
Added automation for Error Screens
Pp 860 automation test files
PM-122
ci: Add scrollTo option
Fix failing test cases
…ageIsCaptured PM-122
Fix failing test cases
|
…icker Pm 122 test automation skip photo picker
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces Espresso UI automation test cases and supporting screen/resource classes for the example app. Key changes include new test suites for various screens (Review, Onboarding, No Results, Error, Digital Invoice, etc.), the addition of a new dependency entry in the libs version catalog, and updates to Gradle build/test configuration and workflow files.
Reviewed Changes
Copilot reviewed 32 out of 41 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| gradle/libs.versions.toml | Added an entry for androidx-test-core to support updated testing dependencies. |
| bank-sdk/example-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/testcases/*.kt | New and updated Espresso UI test cases covering screen flows and error conditions. |
| bank-sdk/example-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/*.kt | New screen classes implementing UI interactions for various features. |
| bank-sdk/example-app/build.gradle.kts and .github/workflows/* | Updates to build configuration and CI workflows to support test properties injection and improved caching. |
Comments suppressed due to low confidence (1)
bank-sdk/example-app/src/androidTest/java/net/gini/android/bank/sdk/exampleapp/ui/screens/DigitalInvoiceEditButton.kt:81
- The resource identifier is specified as a string literal "R.id.gbs_description" instead of using the proper resource reference. Use the fully qualified resource reference (e.g. net.gini.android.bank.sdk.exampleapp:id/gbs_description) to avoid runtime view lookup issues.
.resourceId("R.id.gbs_description")
| reviewScreen.assertReviewTitleIsDisplayed() | ||
| } | ||
|
|
||
| @Test | ||
| fun test2_pinchToZoomInvoice() { | ||
| test1_reviewUploadedInvoice() | ||
| reviewScreen.pinchToZoomInvoice() | ||
| } | ||
|
|
||
| @Test | ||
| fun test3_clickCloseButtonForZoomedInvoice() { | ||
| test2_pinchToZoomInvoice() | ||
| reviewScreen.clickCancelButton() | ||
| reviewScreen.assertReviewTitleIsDisplayed() | ||
| } | ||
|
|
||
| @Test | ||
| fun test4_cancelUploadedInvoice() { | ||
| test1_reviewUploadedInvoice() | ||
| reviewScreen.clickCancelButton() | ||
| mainScreen.assertDescriptionTitle() | ||
| } | ||
|
|
||
| @Test | ||
| fun test5_deleteUploadedInvoice() { | ||
| test1_reviewUploadedInvoice() | ||
| reviewScreen.clickDeleteButton() | ||
| captureScreen.assertCameraTitle() | ||
| } | ||
|
|
||
| @Test | ||
| fun test6_addMorePagesToUploadedInvoice() { | ||
| test1_reviewUploadedInvoice() |
There was a problem hiding this comment.
Avoid invoking another test method (e.g. test1_reviewUploadedInvoice()) from within a test, as it creates dependencies between tests. Instead, extract the common setup logic into a helper method to improve test isolation and maintainability.
| reviewScreen.assertReviewTitleIsDisplayed() | |
| } | |
| @Test | |
| fun test2_pinchToZoomInvoice() { | |
| test1_reviewUploadedInvoice() | |
| reviewScreen.pinchToZoomInvoice() | |
| } | |
| @Test | |
| fun test3_clickCloseButtonForZoomedInvoice() { | |
| test2_pinchToZoomInvoice() | |
| reviewScreen.clickCancelButton() | |
| reviewScreen.assertReviewTitleIsDisplayed() | |
| } | |
| @Test | |
| fun test4_cancelUploadedInvoice() { | |
| test1_reviewUploadedInvoice() | |
| reviewScreen.clickCancelButton() | |
| mainScreen.assertDescriptionTitle() | |
| } | |
| @Test | |
| fun test5_deleteUploadedInvoice() { | |
| test1_reviewUploadedInvoice() | |
| reviewScreen.clickDeleteButton() | |
| captureScreen.assertCameraTitle() | |
| } | |
| @Test | |
| fun test6_addMorePagesToUploadedInvoice() { | |
| test1_reviewUploadedInvoice() | |
| } | |
| @Test | |
| fun test1_reviewUploadedInvoice() { | |
| uploadInvoiceAndNavigateToReviewScreen() | |
| reviewScreen.assertReviewTitleIsDisplayed() | |
| } | |
| @Test | |
| fun test2_pinchToZoomInvoice() { | |
| uploadInvoiceAndNavigateToReviewScreen() | |
| reviewScreen.assertReviewTitleIsDisplayed() | |
| reviewScreen.pinchToZoomInvoice() | |
| } | |
| @Test | |
| fun test3_clickCloseButtonForZoomedInvoice() { | |
| uploadInvoiceAndNavigateToReviewScreen() | |
| reviewScreen.assertReviewTitleIsDisplayed() | |
| reviewScreen.pinchToZoomInvoice() | |
| reviewScreen.clickCancelButton() | |
| reviewScreen.assertReviewTitleIsDisplayed() | |
| } | |
| @Test | |
| fun test4_cancelUploadedInvoice() { | |
| uploadInvoiceAndNavigateToReviewScreen() | |
| reviewScreen.assertReviewTitleIsDisplayed() | |
| reviewScreen.clickCancelButton() | |
| mainScreen.assertDescriptionTitle() | |
| } | |
| @Test | |
| fun test5_deleteUploadedInvoice() { | |
| uploadInvoiceAndNavigateToReviewScreen() | |
| reviewScreen.assertReviewTitleIsDisplayed() | |
| reviewScreen.clickDeleteButton() | |
| captureScreen.assertCameraTitle() | |
| } | |
| @Test | |
| fun test6_addMorePagesToUploadedInvoice() { | |
| uploadInvoiceAndNavigateToReviewScreen() | |
| reviewScreen.assertReviewTitleIsDisplayed() |




UI automation Test cases using Espresso