|
12 | 12 |
|
13 | 13 | class CommandTest extends BaseFlutterTest {
|
14 | 14 |
|
15 |
| - private static final AppiumBy.FlutterBy messageFieldLocator = AppiumBy.flutterKey("message_field"); |
16 |
| - private static final AppiumBy.FlutterBy toggleButtonLocator = AppiumBy.flutterKey("toggle_button"); |
| 15 | + private static final AppiumBy.FlutterBy MESSAGE_FIELD = AppiumBy.flutterKey("message_field"); |
| 16 | + private static final AppiumBy.FlutterBy TOGGLE_BUTTON = AppiumBy.flutterKey("toggle_button"); |
17 | 17 |
|
18 | 18 | @Test
|
19 | 19 | public void testWaitCommand() {
|
20 |
| - WebElement loginButton = driver.findElement(BaseFlutterTest.loginButton); |
| 20 | + WebElement loginButton = driver.findElement(BaseFlutterTest.LOGIN_BUTTON); |
21 | 21 | loginButton.click();
|
22 | 22 | openScreen("Lazy Loading");
|
23 | 23 |
|
24 |
| - WebElement messageField = driver.findElement(messageFieldLocator); |
25 |
| - WebElement toggleButton = driver.findElement(toggleButtonLocator); |
| 24 | + WebElement messageField = driver.findElement(MESSAGE_FIELD); |
| 25 | + WebElement toggleButton = driver.findElement(TOGGLE_BUTTON); |
26 | 26 |
|
27 | 27 | assertEquals(messageField.getText(), "Hello world");
|
28 | 28 | toggleButton.click();
|
29 | 29 | assertEquals(messageField.getText(), "Hello world");
|
30 | 30 |
|
31 |
| - WaitParameter waitParameter = new WaitParameter().setLocator(messageFieldLocator); |
| 31 | + WaitParameter waitParameter = new WaitParameter().setLocator(MESSAGE_FIELD); |
32 | 32 |
|
33 | 33 | driver.waitForInVisible(waitParameter);
|
34 |
| - assertEquals(0, driver.findElements(messageFieldLocator).size()); |
| 34 | + assertEquals(0, driver.findElements(MESSAGE_FIELD).size()); |
35 | 35 | toggleButton.click();
|
36 | 36 | driver.waitForVisible(waitParameter);
|
37 |
| - assertEquals(1, driver.findElements(messageFieldLocator).size()); |
| 37 | + assertEquals(1, driver.findElements(MESSAGE_FIELD).size()); |
38 | 38 | assertEquals(messageField.getText(), "Hello world");
|
39 | 39 | }
|
40 | 40 |
|
41 | 41 | @Test
|
42 | 42 | public void testScrollTillVisibleCommand() {
|
43 |
| - WebElement loginButton = driver.findElement(BaseFlutterTest.loginButton); |
| 43 | + WebElement loginButton = driver.findElement(BaseFlutterTest.LOGIN_BUTTON); |
44 | 44 | loginButton.click();
|
45 | 45 | openScreen("Vertical Swiping");
|
46 | 46 |
|
|
0 commit comments