-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Rework tests - fix CalculatorTest.kt
- Loading branch information
1 parent
810c504
commit c139a09
Showing
10 changed files
with
471 additions
and
515 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
app/src/androidTest/java/com/ivy/wallet/compose/helpers/CalculatorAmountInput.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package com.ivy.wallet.compose.helpers | ||
|
||
import androidx.compose.ui.test.onNodeWithTag | ||
import androidx.compose.ui.test.performClick | ||
import com.ivy.wallet.compose.IvyComposeTestRule | ||
|
||
class CalculatorAmountInput( | ||
composeTestRule: IvyComposeTestRule | ||
) : IvyAmountInput(composeTestRule) { | ||
fun enterNumber( | ||
number: String, | ||
): CalculatorAmountInput { | ||
return super.enterNumber( | ||
number = number, | ||
next = CalculatorAmountInput(composeTestRule), | ||
onCalculator = true, | ||
autoPressNonCalculator = false | ||
) | ||
} | ||
|
||
fun pressPlus(): CalculatorAmountInput { | ||
composeTestRule.onNodeWithTag("key_+") | ||
.performClick() | ||
return this | ||
} | ||
|
||
fun pressMinus(): CalculatorAmountInput { | ||
composeTestRule.onNodeWithTag("key_-") | ||
.performClick() | ||
return this | ||
} | ||
|
||
fun pressMultiplication(): CalculatorAmountInput { | ||
composeTestRule.onNodeWithTag("key_*") | ||
.performClick() | ||
return this | ||
} | ||
|
||
fun pressDivision(): CalculatorAmountInput { | ||
composeTestRule.onNodeWithTag("key_/") | ||
.performClick() | ||
return this | ||
} | ||
|
||
fun pressLeftBracket(): CalculatorAmountInput { | ||
composeTestRule.onNodeWithTag("key_(") | ||
.performClick() | ||
return this | ||
} | ||
|
||
fun pressRightBracket(): CalculatorAmountInput { | ||
composeTestRule.onNodeWithTag("key_)") | ||
.performClick() | ||
return this | ||
} | ||
|
||
fun pressCalcEqual(): CalculatorAmountInput { | ||
composeTestRule.onNodeWithTag("key_=") | ||
.performClick() | ||
return this | ||
} | ||
|
||
fun clickCalcSet(): CalculatorAmountInput { | ||
composeTestRule.onNodeWithTag("calc_set") | ||
.performClick() | ||
return this | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.