Skip to content

Conversation

SyedaGini
Copy link

@SyedaGini SyedaGini commented Jun 18, 2024

UI automation Test cases using Espresso

@SyedaGini SyedaGini added the automation automation label Jun 18, 2024
@SyedaGini SyedaGini self-assigned this Jun 18, 2024
Copy link
Contributor

@danicretu danicretu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@SyedaGini
Copy link
Author

@danicretu We've discussed the commit style for automation specifically and here is the reference for the structure of commit
image

@SyedaGini
Copy link
Author

Thanks @danicretu for your input.
I have incorporated your suggestion, please do review the changes whenever you've time.

Copy link
Contributor

@danicretu danicretu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the changes, Syeda!

Copy link
Contributor

@a-szotyori a-szotyori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@SyedaGini
Copy link
Author

@a-szotyori the requested changes are incorporated, thank you!

Copy link
Contributor

@a-szotyori a-szotyori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Syeda! As discussed on Slack please don't merge it yet.

…indow`

The emulator won't start without `-no-window` on GitHub Action runners.

This reverts commit 2aea8c9.

PM-89
Copy link

Copy link

@zladzeyka zladzeyka assigned GeraltRiv and unassigned SyedaGini Dec 13, 2024
Copy link

@zladzeyka zladzeyka requested review from Copilot and removed request for a-szotyori and danicretu June 30, 2025 11:10
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +77 to +109
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()
Copy link

Copilot AI Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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()

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants