Skip to content

Commit

Permalink
Checkstyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sudharsan-selvaraj committed Jul 22, 2024
1 parent 0ab722c commit 9ec42c7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class BaseFlutterTest {

private static AppiumDriverLocalService service;
protected static FlutterAndroidDriver driver;
protected static final By loginButton = AppiumBy.flutterText("Login");
protected static final By LOGIN_BUTTON = AppiumBy.flutterText("Login");

/**
* initialization.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,35 @@

class CommandTest extends BaseFlutterTest {

private static final AppiumBy.FlutterBy messageFieldLocator = AppiumBy.flutterKey("message_field");
private static final AppiumBy.FlutterBy toggleButtonLocator = AppiumBy.flutterKey("toggle_button");
private static final AppiumBy.FlutterBy MESSAGE_FIELD = AppiumBy.flutterKey("message_field");
private static final AppiumBy.FlutterBy TOGGLE_BUTTON = AppiumBy.flutterKey("toggle_button");

@Test
public void testWaitCommand() {
WebElement loginButton = driver.findElement(BaseFlutterTest.loginButton);
WebElement loginButton = driver.findElement(BaseFlutterTest.LOGIN_BUTTON);
loginButton.click();
openScreen("Lazy Loading");

WebElement messageField = driver.findElement(messageFieldLocator);
WebElement toggleButton = driver.findElement(toggleButtonLocator);
WebElement messageField = driver.findElement(MESSAGE_FIELD);
WebElement toggleButton = driver.findElement(TOGGLE_BUTTON);

assertEquals(messageField.getText(), "Hello world");
toggleButton.click();
assertEquals(messageField.getText(), "Hello world");

WaitParameter waitParameter = new WaitParameter().setLocator(messageFieldLocator);
WaitParameter waitParameter = new WaitParameter().setLocator(MESSAGE_FIELD);

driver.waitForInVisible(waitParameter);
assertEquals(0, driver.findElements(messageFieldLocator).size());
assertEquals(0, driver.findElements(MESSAGE_FIELD).size());
toggleButton.click();
driver.waitForVisible(waitParameter);
assertEquals(1, driver.findElements(messageFieldLocator).size());
assertEquals(1, driver.findElements(MESSAGE_FIELD).size());
assertEquals(messageField.getText(), "Hello world");
}

@Test
public void testScrollTillVisibleCommand() {
WebElement loginButton = driver.findElement(BaseFlutterTest.loginButton);
WebElement loginButton = driver.findElement(BaseFlutterTest.LOGIN_BUTTON);
loginButton.click();
openScreen("Vertical Swiping");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ public void testFlutterText() {

@Test
public void testFlutterTextContaining() {
WebElement loginButton = driver.findElement(BaseFlutterTest.loginButton);
WebElement loginButton = driver.findElement(BaseFlutterTest.LOGIN_BUTTON);
loginButton.click();
assertEquals(driver.findElement(AppiumBy.flutterTextContaining("Vertical")).getText(),
"Vertical Swiping");
}

@Test
public void testFlutterSemanticsLabel() {
WebElement loginButton = driver.findElement(BaseFlutterTest.loginButton);
WebElement loginButton = driver.findElement(BaseFlutterTest.LOGIN_BUTTON);
loginButton.click();
openScreen("Lazy Loading");

Expand Down

0 comments on commit 9ec42c7

Please sign in to comment.