Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Selenium] Fix Java selenium tests to run against Che with next version for default plugins #14337

Merged
merged 4 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ public interface Locators {
String ABOUT_DIALOG_CONTENT_XPATH = ABOUT_DIALOG_XPATH + "//div[@class='dialogContent']";
String ABOUT_DIALOG_OK_BUTTON_XPATH = ABOUT_DIALOG_XPATH + "//button";
String NOTIFICATION_MESSAGE_EQUALS_TO_XPATH_TEMPLATE =
"//div[@class='theia-NotificationsContainer']//p[text()='%s']";
"//div[@class='theia-notification-list-item']//div[@class='theia-notification-message']//span[text()='%s']";
String NOTIFICATION_MESSAGE_CONTAINS_XPATH_TEMPLATE =
"//div[@class='theia-NotificationsContainer']//p[contains(text(), '%s')]";
"//div[@class='theia-notification-list-item']//div[@class='theia-notification-message']//span[contains(text(), '%s')]";
String NOTIFICATION_CLOSE_BUTTON =
"//div[@class='theia-NotificationsContainer']//button[text()='Close']";
"//div[@class='theia-notification-buttons']//button[@data-action='Close']";
String BRANCH_NAME_XPATH = "//div[@id='theia-statusBar']//div[contains(@title,'Git')]";
}

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

import static java.lang.String.format;
import static org.eclipse.che.selenium.pageobject.theia.TheiaProjectTree.Locators.EXPAND_ITEM_ICON_XPATH_TEMPLATE;
import static org.eclipse.che.selenium.pageobject.theia.TheiaProjectTree.Locators.FILES_TAB_XPATH;
import static org.eclipse.che.selenium.pageobject.theia.TheiaProjectTree.Locators.FILES_TAB_ID;
import static org.eclipse.che.selenium.pageobject.theia.TheiaProjectTree.Locators.OPEN_WORKSPACE_BUTTON_XPATH;
import static org.eclipse.che.selenium.pageobject.theia.TheiaProjectTree.Locators.PROJECT_TREE_CONTAINER_ID;
import static org.eclipse.che.selenium.pageobject.theia.TheiaProjectTree.Locators.ROOT_PROJECTS_FOLDER_ID;
Expand Down Expand Up @@ -62,8 +62,7 @@ public interface Locators {
String COLLAPSED_ITEM_XPATH_TEMPLATE =
"//div[@data-node-id='/projects:/projects/%s' and contains(@class, 'theia-mod-collapsed')]";
String EXPAND_ITEM_ICON_XPATH_TEMPLATE = "//div[@data-node-id='/projects:/projects/%s']";
String FILES_TAB_XPATH =
"//div[contains(@class, 'theia-app-left')]//ul[@class='p-TabBar-content']//li[@title='Explorer']";
String FILES_TAB_ID = "shell-tab-explorer-view-container";
String OPEN_WORKSPACE_BUTTON_XPATH = "//button[@class='open-workspace-button']";
}

Expand All @@ -77,12 +76,11 @@ public void clickOnOpenWorkspaceButton() {

public void clickOnFilesTab() {
seleniumWebDriverHelper.waitNoExceptions(
() -> seleniumWebDriverHelper.waitAndClick(By.xpath(FILES_TAB_XPATH)),
WebDriverException.class);
() -> seleniumWebDriverHelper.waitAndClick(By.id(FILES_TAB_ID)), WebDriverException.class);
}

public void waitFilesTab() {
seleniumWebDriverHelper.waitVisibility(By.xpath(FILES_TAB_XPATH));
seleniumWebDriverHelper.waitVisibility(By.id(FILES_TAB_ID));
}

public void waitProjectAreaOpened() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
package org.eclipse.che.selenium.dashboard;

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.ProjectSourcePage.Template.CONSOLE_JAVA_SIMPLE;
import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.PROJECTS;

Expand All @@ -37,7 +36,6 @@
import org.testng.annotations.Test;

/** @author Andrey Chizhikov */
@Test(groups = UNDER_REPAIR)
public class CreateAndDeleteProjectsTest {

private static final String WORKSPACE = generate("workspace", 4);
Expand Down Expand Up @@ -102,10 +100,9 @@ public void createProjectTest() {
theiaIde.waitLoaderInvisibility();
theiaIde.waitTheiaIdeTopPanel();
theiaProjectTree.waitFilesTab();
theiaProjectTree.clickOnFilesTab();

// wait for projects in the tree
theiaProjectTree.clickOnFilesTab();
theiaProjectTree.waitProjectsRootItem();
theiaProjectTree.waitProjectAreaOpened();
theiaProjectTree.waitItem(CONSOLE_JAVA_SIMPLE);
theiaProjectTree.waitItem(SECOND_CONSOLE_JAVA_SIMPLE_PROJECT_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
package org.eclipse.che.selenium.dashboard;

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.ProjectSourcePage.Sources.GIT;

import com.google.inject.Inject;
Expand All @@ -36,7 +35,6 @@
import org.testng.annotations.Test;

/** @author Andrey Chizhikov */
@Test(groups = UNDER_REPAIR)
public class ImportMavenProjectFromGitTest {

private final String WORKSPACE = generate("ImtMvnPrjGit", 4);
Expand Down Expand Up @@ -101,8 +99,6 @@ public void checkAbilityImportMavenProjectTest() {

// wait the project in the tree
theiaProjectTree.clickOnFilesTab();
theiaProjectTree.waitProjectsRootItem();
theiaProjectTree.waitProjectAreaOpened();
theiaProjectTree.waitItem(testProjectName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
package org.eclipse.che.selenium.dashboard;

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.core.utils.WaitUtils.sleepQuietly;
import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Sources.GITHUB;
import static org.testng.AssertJUnit.assertTrue;
Expand Down Expand Up @@ -41,7 +40,6 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

@Test(groups = UNDER_REPAIR)
public class ImportProjectFromGitHubTest {
private static final String WORKSPACE =
generate(ImportProjectFromGitHubTest.class.getSimpleName(), 4);
Expand Down Expand Up @@ -125,8 +123,6 @@ public void checkAbilityImportProjectFromGithub() {

// wait the project in the tree
theiaProjectTree.clickOnFilesTab();
theiaProjectTree.waitProjectsRootItem();
theiaProjectTree.waitProjectAreaOpened();
theiaProjectTree.waitItem(projectName);
}

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

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 com.google.inject.Inject;
Expand All @@ -33,7 +32,7 @@
import org.testng.annotations.Test;

/** @author Musienko Maxim */
@Test(groups = {GITHUB, OPENSHIFT, UNDER_REPAIR})
@Test(groups = {GITHUB, OPENSHIFT})
public class DirectUrlFactoryWithRootFolderTest {
private static final Logger LOG =
LoggerFactory.getLogger(DirectUrlFactoryWithRootFolderTest.class);
Expand Down Expand Up @@ -97,7 +96,6 @@ public void factoryWithDirectUrlWithRootFolder() {

theiaProjectTree.waitFilesTab();
theiaProjectTree.clickOnFilesTab();
theiaProjectTree.waitProjectsRootItem();
theiaProjectTree.waitItem(repositoryName);
theiaProjectTree.expandItem(repositoryName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import static org.eclipse.che.selenium.core.CheSeleniumSuiteModule.AUXILIARY;
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.AssertJUnit.assertEquals;

Expand All @@ -37,7 +36,7 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

@Test(groups = {GITHUB, OPENSHIFT, UNDER_REPAIR})
@Test(groups = {GITHUB, OPENSHIFT})
public class DirectUrlFactoryWithSpecificBranchTest {
private static final Logger LOG =
LoggerFactory.getLogger(DirectUrlFactoryWithSpecificBranchTest.class);
Expand Down Expand Up @@ -97,7 +96,6 @@ public void factoryWithDirectUrlWithSpecificBranch() {

theiaProjectTree.waitFilesTab();
theiaProjectTree.clickOnFilesTab();
theiaProjectTree.waitProjectsRootItem();

theiaProjectTree.waitItem(repositoryName);
theiaProjectTree.expandItem(repositoryName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public void pluginShouldBeBuilt() {
// prepare project tree
theiaProjectTree.waitFilesTab();
theiaProjectTree.clickOnFilesTab();
theiaProjectTree.waitProjectsRootItem();
theiaIde.waitNotificationDisappearance(
"Che Workspace: Finished cloning projects.", UPDATING_PROJECT_TIMEOUT_SEC);

Expand Down