Selenium: fix unstable selenium tests (#11610)
parent
baafe61add
commit
f9abc930a5
|
|
@ -524,17 +524,19 @@ public class Consoles {
|
|||
waitPreviewUrlIsPresent();
|
||||
waitPreviewUrlIsResponsive(10);
|
||||
|
||||
// wait for 2 sec to prevent "Application is not available" error
|
||||
WaitUtils.sleepQuietly(2);
|
||||
// wait for 5 sec to prevent "Application is not available" error
|
||||
WaitUtils.sleepQuietly(5);
|
||||
clickOnPreviewUrl();
|
||||
|
||||
seleniumWebDriverHelper.switchToNextWindow(currentWindow);
|
||||
|
||||
seleniumWebDriverHelper.waitVisibility(webElement, LOADER_TIMEOUT_SEC);
|
||||
|
||||
seleniumWebDriver.close();
|
||||
seleniumWebDriver.switchTo().window(currentWindow);
|
||||
seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability();
|
||||
try {
|
||||
seleniumWebDriverHelper.waitVisibility(webElement, LOADER_TIMEOUT_SEC);
|
||||
} finally {
|
||||
seleniumWebDriver.close();
|
||||
seleniumWebDriver.switchTo().window(currentWindow);
|
||||
seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability();
|
||||
}
|
||||
}
|
||||
|
||||
// Start command from project context menu and check expected message in Console
|
||||
|
|
|
|||
|
|
@ -169,6 +169,9 @@ public class FileStructure {
|
|||
* @param item is the name of the item
|
||||
*/
|
||||
public void selectItemInFileStructure(String item) {
|
||||
// we need to wait a little to avoid quick clicking on nodes
|
||||
WaitUtils.sleepQuietly(1);
|
||||
|
||||
seleniumWebDriverHelper.waitNoExceptions(
|
||||
() -> selectItem(item), StaleElementReferenceException.class);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,9 @@ public class EditMachineForm {
|
|||
}
|
||||
|
||||
public void clickOnRecipeForm() {
|
||||
seleniumWebDriverHelper.waitAndClick(By.xpath(RECIPE_EDITOR_TEXT_XPATH));
|
||||
seleniumWebDriverHelper.waitNoExceptions(
|
||||
() -> seleniumWebDriverHelper.waitAndClick(By.xpath(RECIPE_EDITOR_TEXT_XPATH)),
|
||||
StaleElementReferenceException.class);
|
||||
}
|
||||
|
||||
public void typeToRecipe(String text) {
|
||||
|
|
|
|||
|
|
@ -114,6 +114,16 @@ public class WorkspaceDetailsMachineActionsTest {
|
|||
checkEditOfMachineName("FROM " + IMAGE_NAME + "\n");
|
||||
}
|
||||
|
||||
@Test(groups = {OPENSHIFT, K8S, OSIO})
|
||||
public void checkRamSectionOpenshift() {
|
||||
checkRamSection(IMAGE_NAME);
|
||||
}
|
||||
|
||||
@Test(groups = DOCKER)
|
||||
public void checkRamSectionDocker() {
|
||||
checkRamSection("FROM " + IMAGE_NAME + "\n");
|
||||
}
|
||||
|
||||
private void checkEditOfMachineName(String expectedRecipeText) {
|
||||
// check default values
|
||||
workspaceDetailsMachines.clickOnEditButton(MACHINE_NAME);
|
||||
|
|
@ -148,8 +158,7 @@ public class WorkspaceDetailsMachineActionsTest {
|
|||
editMachineForm.waitSaveButtonDisabling();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void checkRamSection() {
|
||||
public void checkRamSection(String expectedRecipeText) {
|
||||
// check machine name editing
|
||||
workspaceDetailsMachines.clickOnEditButton(MACHINE_NAME);
|
||||
editMachineForm.waitForm();
|
||||
|
|
@ -198,7 +207,7 @@ public class WorkspaceDetailsMachineActionsTest {
|
|||
editMachineForm.waitFormInvisibility();
|
||||
workspaceDetailsMachines.clickOnEditButton(MACHINE_NAME);
|
||||
editMachineForm.waitForm();
|
||||
waitRecipeText(IMAGE_NAME);
|
||||
waitRecipeText(expectedRecipeText);
|
||||
|
||||
// check saving of the changes
|
||||
editMachineForm.typeRam(CHANGED_RAM_SIZE);
|
||||
|
|
|
|||
Loading…
Reference in New Issue