fix flaky profiles tests (check if profiles dropdown is closed)
This commit is contained in:
parent
a1967865a9
commit
53b1f03a49
@ -27,7 +27,7 @@ public class SideBarMenuViewElements extends AbstractBasePage {
|
|||||||
private static final String RULE_CHAINS_BTN = "//mat-toolbar//a[@href='/ruleChains']";
|
private static final String RULE_CHAINS_BTN = "//mat-toolbar//a[@href='/ruleChains']";
|
||||||
private static final String CUSTOMER_BTN = "//mat-toolbar//a[@href='/customers']";
|
private static final String CUSTOMER_BTN = "//mat-toolbar//a[@href='/customers']";
|
||||||
private static final String DASHBOARD_BTN = "//mat-toolbar//a[@href='/dashboards']";
|
private static final String DASHBOARD_BTN = "//mat-toolbar//a[@href='/dashboards']";
|
||||||
private static final String PROFILES_BTN = "//mat-toolbar//mat-icon[text()='badge']/ancestor::tb-menu-toggle";
|
private static final String PROFILES_DROPDOWN = "//mat-toolbar//mat-icon[text()='badge']/ancestor::a//span[contains(@class,'pull-right')]";
|
||||||
private static final String DEVICE_PROFILE_BTN = "//mat-toolbar//a[@href='/profiles/deviceProfiles']";
|
private static final String DEVICE_PROFILE_BTN = "//mat-toolbar//a[@href='/profiles/deviceProfiles']";
|
||||||
private static final String ASSET_PROFILE_BTN = "//mat-toolbar//a[@href='/profiles/assetProfiles']";
|
private static final String ASSET_PROFILE_BTN = "//mat-toolbar//a[@href='/profiles/assetProfiles']";
|
||||||
private static final String ALARMS_BTN = "//mat-toolbar//a[@href='/alarms']";
|
private static final String ALARMS_BTN = "//mat-toolbar//a[@href='/alarms']";
|
||||||
@ -52,8 +52,8 @@ public class SideBarMenuViewElements extends AbstractBasePage {
|
|||||||
return waitUntilElementToBeClickable(DASHBOARD_BTN);
|
return waitUntilElementToBeClickable(DASHBOARD_BTN);
|
||||||
}
|
}
|
||||||
|
|
||||||
public WebElement profilesBtn() {
|
public WebElement profilesDropdown() {
|
||||||
return waitUntilElementToBeClickable(PROFILES_BTN);
|
return waitUntilElementToBeClickable(PROFILES_DROPDOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
public WebElement deviceProfileBtn() {
|
public WebElement deviceProfileBtn() {
|
||||||
|
|||||||
@ -24,12 +24,12 @@ public class SideBarMenuViewHelper extends SideBarMenuViewElements {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void openDeviceProfiles() {
|
public void openDeviceProfiles() {
|
||||||
profilesBtn().click();
|
openProfilesDropDown();
|
||||||
deviceProfileBtn().click();
|
deviceProfileBtn().click();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openAssetProfiles() {
|
public void openAssetProfiles() {
|
||||||
profilesBtn().click();
|
openProfilesDropDown();
|
||||||
assetProfileBtn().click();
|
assetProfileBtn().click();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,10 +54,20 @@ public class SideBarMenuViewHelper extends SideBarMenuViewElements {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void openProfilesDropDown() {
|
||||||
|
if (profilesIsClose()) {
|
||||||
|
profilesDropdown().click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean entitiesDropdownIsClose() {
|
public boolean entitiesDropdownIsClose() {
|
||||||
return dropdownIsClose(entitiesDropdown());
|
return dropdownIsClose(entitiesDropdown());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean profilesIsClose() {
|
||||||
|
return dropdownIsClose(profilesDropdown());
|
||||||
|
}
|
||||||
|
|
||||||
private boolean dropdownIsClose(WebElement dropdown) {
|
private boolean dropdownIsClose(WebElement dropdown) {
|
||||||
return !dropdown.getAttribute("class").contains("tb-toggled");
|
return !dropdown.getAttribute("class").contains("tb-toggled");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user