Skip to content

Commit

Permalink
Selenium: add info about known issues, stabilize tests (#12314)
Browse files Browse the repository at this point in the history
* add info about known issues, stabilize tests

* fix timeout in CodenvyEditor page object
  • Loading branch information
SkorikSergey authored Dec 29, 2018
1 parent af48cd8 commit cb5da3f
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ public void waitMarkerInvisibility(MarkerLocator markerLocator, int position) {
* @param markerLocator marker's type, defined in {@link MarkerLocator}
*/
public void waitAllMarkersInvisibility(MarkerLocator markerLocator) {
seleniumWebDriverHelper.waitInvisibility(By.xpath(markerLocator.get()));
seleniumWebDriverHelper.waitInvisibility(By.xpath(markerLocator.get()), WIDGET_TIMEOUT_SEC);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import static java.lang.String.format;
import static java.util.Arrays.asList;
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.PREPARING_WS_TIMEOUT_SEC;
import static org.eclipse.che.selenium.pageobject.theia.TheiaIde.Locators.NOTIFICATION_CLOSE_BUTTON;
Expand Down Expand Up @@ -98,7 +99,7 @@ public void clickOnNotificationCloseButton() {
public void waitNotificationEqualsTo(String expectedText) {
final String notificationXpath = getNotificationEqualsToXpath(expectedText);

seleniumWebDriverHelper.waitVisibility(By.xpath(notificationXpath));
seleniumWebDriverHelper.waitVisibility(By.xpath(notificationXpath), ELEMENT_TIMEOUT_SEC);
}

public boolean isNotificationEqualsTo(String notificationText) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ public class NewWorkspacePageTest {

private static final List<NewWorkspace.Stack> EXPECTED_DOCKER_QUICK_START_STACKS_REVERSE_ORDER =
asList(
JAVA,
JAVA_MYSQL,
JAVA,
BLANK,
JAVA_THEIA_DOCKER,
RAILS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
package org.eclipse.che.selenium.dashboard.workspaces.details;

import static org.eclipse.che.commons.lang.NameGenerator.generate;
import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR;
import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL;
import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.StateWorkspace.STOPPED;
import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.ENV_VARIABLES;
import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.MACHINES;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;

import com.google.common.collect.ImmutableMap;
import com.google.inject.Inject;
Expand All @@ -35,6 +37,7 @@
import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceEnvVariables;
import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceMachines;
import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces;
import org.openqa.selenium.TimeoutException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -75,6 +78,7 @@ public void tearDown() throws Exception {
workspaceServiceClient.delete(WORKSPACE, testUser.getName());
}

@Test
public void workingWithEnvVariables() {
workspaceDetails.selectTabInWorkspaceMenu(ENV_VARIABLES);

Expand Down Expand Up @@ -118,6 +122,7 @@ public void workingWithEnvVariables() {
clickOnSaveButton();
}

@Test(groups = UNDER_REPAIR)
public void workingWithMachines() {
String machineName = "new_machine";

Expand Down Expand Up @@ -147,7 +152,7 @@ public void workingWithMachines() {
workspaceMachines.checkMachineExists("machine");
}

@Test(priority = 1)
@Test(priority = 1, groups = UNDER_REPAIR)
public void startWorkspaceAndCheckChanges() {
// check that created machine exists in the Process Console tree
workspaceDetails.clickOpenInIdeWsBtn();
Expand Down Expand Up @@ -185,9 +190,19 @@ private void createMachine(String machineName) {
// add new machine and check it exists
workspaceMachines.clickOnAddMachineButton();
workspaceMachines.checkAddNewMachineDialogIsOpen();

// wait for 'Name:' input field is ready text changing
WaitUtils.sleepQuietly(2);

workspaceMachines.setMachineNameInDialog(machineName);
workspaceDetails.clickOnAddButtonInDialogWindow();
workspaceMachines.checkMachineExists(machineName);

try {
workspaceMachines.checkMachineExists(machineName);
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known permanent failure https://github.com/eclipse/che/issues/8909");
}
}

private void createVariable(String varName, String varValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class CheckOpenFileFeatureTest {
@BeforeClass
public void setUp() throws Exception {
ide.open(testWorkspace);
ide.waitOpenedWorkspaceIsReadyToUse();
}

@AfterClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

import static org.eclipse.che.selenium.core.TestGroup.GITHUB;
import static org.eclipse.che.selenium.core.TestGroup.OPENSHIFT;
import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.UPDATING_PROJECT_TIMEOUT_SEC;
import static org.testng.Assert.fail;

import com.google.inject.Inject;
import java.nio.file.Path;
Expand All @@ -28,7 +30,7 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

@Test(groups = {GITHUB, OPENSHIFT})
@Test(groups = {GITHUB, OPENSHIFT, UNDER_REPAIR})
public class DirectUrlFactoryWithKeepDirectoryTest {

@Inject private TestFactoryInitializer testFactoryInitializer;
Expand Down Expand Up @@ -74,6 +76,12 @@ public void factoryWithDirectUrlWithKeepDirectory() {
theiaProjectTree.waitItem(repositoryName + "/my-lib/src");

Assert.assertTrue(theiaProjectTree.isItemVisible(repositoryName + "/my-lib/pom.xml"));
Assert.assertFalse(theiaProjectTree.isItemVisible(repositoryName + "/my-webapp"));

try {
Assert.assertFalse(theiaProjectTree.isItemVisible(repositoryName + "/my-webapp"));
} catch (AssertionError ex) {
// remove try-catch block after issue has been resolved
fail("Known permanent failure https://github.com/eclipse/che/issues/12311");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void createMavenArchetypeStartProjectByWizard() throws Exception {
PROJECT_NAME + "/src/test/java/" + GROUP_ID + "/AppTest.java",
PROJECT_NAME + "/pom.xml");
ide.open(workspace);
ide.waitOpenedWorkspaceIsReadyToUse();
menu.runCommand(
TestMenuCommandsConstants.Workspace.WORKSPACE,
TestMenuCommandsConstants.Workspace.CREATE_PROJECT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void setUp() throws Exception {
testProjectServiceClient.importProject(
workspace.getId(), get(resource.toURI()), PROJECT_NAME, MAVEN_SPRING);
ide.open(workspace);
ide.waitOpenedWorkspaceIsReadyToUse();
consoles.waitJDTLSProjectResolveFinishedMessage(PROJECT_NAME);
projectExplorer.waitProjectExplorer();
projectExplorer.waitItem(PROJECT_NAME);
Expand Down

0 comments on commit cb5da3f

Please sign in to comment.