Selenium: remove info about known issues, fix unstable tests (#10851)

6.19.x
Sergey Skorik 2018-08-20 18:13:13 +03:00 committed by GitHub
parent 170449f745
commit 70aed9e03c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 27 additions and 38 deletions

View File

@ -13,6 +13,7 @@ package org.eclipse.che.selenium.pageobject;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.ELEMENT_TIMEOUT_SEC;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.LOAD_PAGE_TIMEOUT_SEC;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.MINIMUM_SEC;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.REDRAW_UI_ELEMENTS_TIMEOUT_SEC;
@ -78,7 +79,7 @@ public class Swagger {
private void expandWorkSpaceItem() {
Wait fluentWait =
new FluentWait(seleniumWebDriver)
.withTimeout(LOAD_PAGE_TIMEOUT_SEC, SECONDS)
.withTimeout(ELEMENT_TIMEOUT_SEC, SECONDS)
.pollingEvery(MINIMUM_SEC, SECONDS)
.ignoring(StaleElementReferenceException.class, NoSuchElementException.class);
fluentWait.until((ExpectedCondition<Boolean>) input -> workSpaceLink.isEnabled());

View File

@ -11,15 +11,15 @@
*/
package org.eclipse.che.selenium.pageobject;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.ELEMENT_TIMEOUT_SEC;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.LOAD_PAGE_TIMEOUT_SEC;
import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOf;
import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOfElementLocated;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.eclipse.che.selenium.core.SeleniumWebDriver;
import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper;
import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.StaleElementReferenceException;
@ -27,17 +27,17 @@ import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.FluentWait;
import org.openqa.selenium.support.ui.WebDriverWait;
@Singleton
public class TestWebElementRenderChecker {
private final SeleniumWebDriver seleniumWebDriver;
private final WebDriverWait loadPageWebDriverWait;
private final SeleniumWebDriverHelper seleniumWebDriverHelper;
@Inject
public TestWebElementRenderChecker(SeleniumWebDriver seleniumWebDriver) {
public TestWebElementRenderChecker(
SeleniumWebDriver seleniumWebDriver, SeleniumWebDriverHelper seleniumWebDriverHelper) {
this.seleniumWebDriver = seleniumWebDriver;
this.loadPageWebDriverWait = new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC);
this.seleniumWebDriverHelper = seleniumWebDriverHelper;
}
/**
@ -117,10 +117,10 @@ public class TestWebElementRenderChecker {
}
private WebElement waitAndGetWebElement(WebElement webElement) {
return loadPageWebDriverWait.until(visibilityOf(webElement));
return seleniumWebDriverHelper.waitVisibility(webElement, ELEMENT_TIMEOUT_SEC);
}
private WebElement waitAndGetWebElement(By locator) {
return loadPageWebDriverWait.until(visibilityOfElementLocated(locator));
return seleniumWebDriverHelper.waitVisibility(locator, ELEMENT_TIMEOUT_SEC);
}
}

View File

@ -228,9 +228,7 @@ public class CreateFactoryTest {
createFactoryPage.typeFactoryName(FACTORY_NAME_EXIST);
createFactoryPage.waitErrorMessage(EXIST_NAME_ERROR_MESSAGE);
assertFalse(
createFactoryPage.isCreateFactoryButtonEnabled(),
"Known issue https://github.com/eclipse/che/issues/10121");
assertFalse(createFactoryPage.isCreateFactoryButtonEnabled());
}
@Test

View File

@ -16,7 +16,6 @@ import static org.eclipse.che.selenium.pageobject.dashboard.NavigationBar.MenuIt
import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import com.google.inject.Inject;
import org.eclipse.che.selenium.core.TestGroup;
@ -30,7 +29,6 @@ import org.eclipse.che.selenium.pageobject.dashboard.organization.OrganizationLi
import org.eclipse.che.selenium.pageobject.dashboard.organization.OrganizationPage;
import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails;
import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces;
import org.openqa.selenium.WebDriverException;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@ -152,13 +150,7 @@ public class AddWorkspaceToOrganizationTest {
organizationPage.clickOnWorkspacesTab();
workspaces.waitWorkspaceIsPresent(WORKSPACE_FOR_MEMBER_1);
workspaces.selectWorkspaceItemName(WORKSPACE_FOR_MEMBER_1);
try {
workspaceDetails.waitToolbarTitleName(WORKSPACE_FOR_MEMBER_1);
} catch (WebDriverException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/9148", ex);
}
workspaceDetails.waitToolbarTitleName(WORKSPACE_FOR_MEMBER_1);
}
private void createWorkspace(String organizationName, String workspaceName) {

View File

@ -41,7 +41,6 @@ import static org.openqa.selenium.Keys.ARROW_DOWN;
import static org.openqa.selenium.Keys.ARROW_UP;
import static org.openqa.selenium.Keys.ESCAPE;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
import com.google.inject.Inject;
import java.util.List;
@ -52,7 +51,6 @@ import org.eclipse.che.selenium.pageobject.dashboard.Dashboard;
import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace;
import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces;
import org.openqa.selenium.Keys;
import org.openqa.selenium.TimeoutException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@ -455,13 +453,7 @@ public class NewWorkspacePageTest {
newWorkspace.clickOnQuickStartButton();
newWorkspace.waitStacksOrder(expectedQuickStartStacksOrder);
newWorkspace.clickNameButton();
try {
newWorkspace.waitStacksOrder(expectedQuickStartStacksReverseOrder);
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/5650", ex);
}
newWorkspace.waitStacksOrder(expectedQuickStartStacksReverseOrder);
newWorkspace.clickNameButton();
newWorkspace.waitStacksOrder(expectedQuickStartStacksOrder);

View File

@ -83,7 +83,14 @@ public class NodeJsDebugTest {
TestMenuCommandsConstants.Run.RUN_MENU,
TestMenuCommandsConstants.Run.DEBUG,
TestMenuCommandsConstants.Run.DEBUG + "/" + nameOfDebugCommand);
notifications.waitExpectedMessageOnProgressPanelAndClosed("Remote debugger connected");
try {
notifications.waitExpectedMessageOnProgressPanelAndClosed("Remote debugger connected");
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/10728");
}
editorPageObj.waitTabFileWithSavedStatus(APP_FILE);
editorPageObj.waitActive();
debugPanel.waitDebugHighlightedText("/*");

View File

@ -116,10 +116,9 @@ public class CreateFactoryFromUiWithKeepDirTest {
// TODO sometimes after importing project doest not open to keep folder. Need investigate later
try {
projectExplorer.openItemByPath(PROJECT_NAME + "/" + KEEPED_DIR);
} catch (Exception e) {
LOG.error(e.getLocalizedMessage(), e);
projectExplorer.openItemByPath(PROJECT_NAME);
projectExplorer.openItemByPath(PROJECT_NAME + "/" + KEEPED_DIR);
} catch (TimeoutException e) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/10852", e);
}
events.clickEventLogBtn();

View File

@ -178,7 +178,7 @@ public class WorkingWithTerminalTest {
}
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che-lib/issues/57", ex);
fail("Known issue https://github.com/eclipse/che/issues/10854", ex);
}
terminal.waitNoTextInFirstTerminal(".dockerenv");
@ -191,7 +191,7 @@ public class WorkingWithTerminalTest {
terminal.waitTextInFirstTerminal(partOfContent);
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che-lib/issues/57");
fail("Known issue https://github.com/eclipse/che/issues/10854");
}
}
@ -225,7 +225,7 @@ public class WorkingWithTerminalTest {
}
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che-lib/issues/57", ex);
fail("Known issue https://github.com/eclipse/che/issues/10854", ex);
}
terminal.typeIntoActiveTerminal(Keys.F10.toString());