Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Implement DonateTest.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed Jun 11, 2022
1 parent d43dab5 commit 1d421e9
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,15 @@ class HomeMoreMenu<A : ComponentActivity>(
return SettingsScreen(composeTestRule)
}

fun clickLoans() {
fun clickLoans(): LoansScreen<A> {
composeTestRule.onNodeWithText("Loans")
.performClick()
return LoansScreen(composeTestRule)
}

fun clickDonate(): DonateScreen<A> {
composeTestRule.onNodeWithText("Donate")
.performClick()
return DonateScreen(composeTestRule)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,51 @@ class DonateTest : IvyComposeTest() {
.verifyAmount("$5")
.clickDonate()
}

@Test
fun openDonateFromMoreMenu_reduceToUSD2_donate() = testWithRetry {
quickOnboarding()
.openMoreMenu()
.clickDonate()
.clickMinus()
.verifyAmount("$2")
.clickDonate()
}

@Test
fun openDonateFromMoreMenu_plusMinus_donate() = testWithRetry {
quickOnboarding()
.openMoreMenu()
.clickSettings()
.clickDonate()
.verifyAmount("$5")
.clickPlus()
.verifyAmount("$10")
.clickPlus()
.verifyAmount("$15")
.clickMinus()
.verifyAmount("$10")
.clickMinus()
.verifyAmount("$5")
.clickDonate()
}

@Test
fun openDonateFromMoreMenu_increaseToUSD100_donate() = testWithRetry {
quickOnboarding()
.openMoreMenu()
.clickDonate()
.verifyAmount("$5")
.clickPlus()
.verifyAmount("$10")
.clickPlus()
.verifyAmount("$15")
.clickPlus()
.verifyAmount("$25")
.clickPlus()
.verifyAmount("$50")
.clickPlus()
.verifyAmount("$100")
.clickDonate()
}
}

0 comments on commit 1d421e9

Please sign in to comment.