Skip to content

Commit

Permalink
fix(UItest): pres enter to confirm when changing projects
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Szuc <[email protected]>
  • Loading branch information
martinszuc committed Oct 2, 2024
1 parent 50dad29 commit a74954b
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public void enterProjectName(RemoteRobot remoteRobot, String projectName) {
// Use RemoteRobot's Keyboard to type the project name
Keyboard keyboard = new Keyboard(remoteRobot);
keyboard.enterText(projectName);
if (isDropdownMenuOpened()) {
keyboard.enter();
}
}

public void clickChange() {
Expand All @@ -39,4 +42,13 @@ public void clickChange() {
public void clickCancel() {
find(ComponentFixture.class, byXpath(XPathConstants.BUTTON_CANCEL)).click();
}

private boolean isDropdownMenuOpened() {
try {
this.find(ComponentFixture.class, byXpath("//div[@class='HeavyWeightWindow']"));
return true;
} catch (Exception ignored) {
return false;
}
}
}

0 comments on commit a74954b

Please sign in to comment.