Last active
July 7, 2024 13:51
-
-
Save birojow/c421cffab054ab93bda9cee459bab1db to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class CalculatorScreenTest { | |
| @get:Rule | |
| val composeRule = createAndroidComposeRule(MainActivity::class.java) | |
| /** | |
| * type ((515 + 87 x 311) - 302) ÷ 27 | |
| * hit = | |
| * assert result is 1010.0 | |
| */ | |
| @Test | |
| fun shouldCalculateExpressionsCorrectly() { | |
| composeRule | |
| .onNodeWithText("()") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("()") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("5") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("1") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("5") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("+") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("8") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("7") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("x") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("3") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("1") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("1") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("()") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("-") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("3") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("0") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("2") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("()") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("÷") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("2") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("7") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("=") | |
| .performClick() | |
| composeRule | |
| .onNodeWithText("1010.0") | |
| .assertIsDisplayed() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment