From 93515118ebc6785d105606973bf330ebe1bb4eba Mon Sep 17 00:00:00 2001 From: Anna Shumilova Date: Thu, 6 Jun 2019 10:37:01 +0300 Subject: [PATCH] Rework stack tests Signed-off-by: Anna Shumilova --- .../devfile-selector/devfile-selector.html | 2 +- .../api/devfile-registry.factory.ts | 2 - .../dashboard/CreateWorkspaceHelper.java | 5 - .../pageobject/dashboard/NewWorkspace.java | 469 +------------ .../CreateAndDeleteProjectsTest.java | 5 +- .../selenium/dashboard/CreateFactoryTest.java | 8 +- .../dashboard/CreateWorkspaceTest.java | 200 +----- .../ImportMavenProjectFromGitTest.java | 5 +- .../ImportProjectFromGitHubTest.java | 5 +- .../dashboard/ImportProjectFromZipTest.java | 5 +- .../AddWorkspaceToOrganizationTest.java | 4 +- .../ShareWorkspaceMemberTest.java | 4 +- .../organization/ShareWorkspaceOwnerTest.java | 4 +- .../AddOrImportProjectFormTest.java | 21 +- .../workspaces/NewWorkspacePageTest.java | 618 ------------------ .../workspaces/WorkspacesListTest.java | 4 +- .../details/WorkspaceDetailsComposeTest.java | 220 ------- .../details/WorkspaceDetailsOverviewTest.java | 9 +- ...oginExistedUserWithOpenShiftOAuthTest.java | 5 +- .../LoginNewUserWithOpenShiftOAuthTest.java | 6 +- .../CreateWorkspaceFromAndroidStackTest.java | 105 --- .../CreateWorkspaceFromBlankStackTest.java | 77 --- .../CreateWorkspaceFromCamelStackTest.java | 68 -- ...eateWorkspaceFromCentosBlankStackTest.java | 77 --- .../CreateWorkspaceFromCentosGoStackTest.java | 106 --- ...reateWorkspaceFromCentosNodeStackTest.java | 145 ---- ...kspaceFromCentosWildFlySwarmStackTest.java | 88 --- ...eWorkspaceFromCeylonWithJavaStackTest.java | 102 --- .../CreateWorkspaceFromCppStackTest.java | 98 --- ...reateWorkspaceFromEclipseCheStackTest.java | 93 --- ...ateWorkspaceFromEclipseVertxStackTest.java | 157 ----- .../stack/CreateWorkspaceFromGoStackTest.java | 106 --- ...reateWorkspaceFromJavaCentosStackTest.java | 97 --- ...WorkspaceFromJavaMySqlCentosStackTest.java | 133 ---- ...CreateWorkspaceFromJavaMySqlStackTest.java | 129 ---- .../CreateWorkspaceFromJavaStackTest.java | 159 ----- ...WorkspaceFromJavaTheiaDockerStackTest.java | 92 --- ...kspaceFromJavaTheiaOpenshiftStackTest.java | 92 --- .../CreateWorkspaceFromKotlinStackTest.java | 59 -- .../CreateWorkspaceFromNETStackTest.java | 98 --- .../CreateWorkspaceFromNodeStackTest.java | 162 ----- .../CreateWorkspaceFromPHPStackTest.java | 130 ---- .../CreateWorkspaceFromPythonStackTest.java | 136 ---- .../CreateWorkspaceFromRailsStackTest.java | 111 ---- ...reateWorkspaceFromSpringBootStackTest.java | 134 ---- ...mportAndValidateEclipseCheProjectTest.java | 210 ------ .../theia/Che7PreviewStackStartTest.java | 4 +- .../selenium/theia/TheiaBuildPluginTest.java | 4 +- .../CreateWorkspaceOnDashboardTest.java | 5 +- 49 files changed, 56 insertions(+), 4522 deletions(-) delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsComposeTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromAndroidStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromBlankStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCamelStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosBlankStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosGoStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosNodeStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosWildFlySwarmStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCeylonWithJavaStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCppStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseCheStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseVertxStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromGoStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaCentosStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlCentosStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaDockerStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaOpenshiftStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromKotlinStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNETStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNodeStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPHPStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPythonStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromRailsStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromSpringBootStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/ImportAndValidateEclipseCheProjectTest.java diff --git a/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html index 4f91cf7d2ae1..461f0264140e 100644 --- a/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html +++ b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html @@ -28,7 +28,7 @@ -
0; } - public void clickOnIncrementMemoryButton(String machineName) { - seleniumWebDriverHelper.waitAndClick(By.xpath(format(INCREMENT_MEMORY_BUTTON, machineName))); - } - - public void clickAndHoldIncrementMemoryButton(String machineName, int holdingTimeout) { - seleniumWebDriverHelper.clickAndHoldElementDuringTimeout( - By.xpath(format(INCREMENT_MEMORY_BUTTON, machineName)), holdingTimeout); - } - - public void clickAndHoldDecrementMemoryButton(String machineName, int holdingTimeout) { - seleniumWebDriverHelper.clickAndHoldElementDuringTimeout( - By.xpath(format(DECREMENT_MEMORY_BUTTON, machineName)), holdingTimeout); - } - - public void waitRamValueInSpecifiedRange( - String machineName, double lowestValue, double highestValue) { - webDriverWaitFactory - .get() - .until( - (ExpectedCondition) - driver -> { - double ramValue = getRAM(machineName); - return ramValue >= lowestValue && ramValue <= highestValue; - }); - } - - public void clickOnDecrementMemoryButton(String machineName) { - seleniumWebDriverHelper.waitAndClick(By.xpath(format(DECREMENT_MEMORY_BUTTON, machineName))); - } - - public double getRAM(String machineName) { - String amountOfRam = - seleniumWebDriverHelper.waitVisibilityAndGetValue( - By.xpath(format(Locators.MACHINE_RAM_VALUE, machineName))); - return Double.parseDouble(amountOfRam); - } - - public void waitRamValue(String machineName, double expectedValue) { - webDriverWaitFactory - .get() - .until((ExpectedCondition) driver -> expectedValue == getRAM(machineName)); - } - - public void setMachineRAM(String machineName, double value) { - seleniumWebDriverHelper.setValue( - By.xpath(format(Locators.MACHINE_RAM_VALUE, machineName)), Double.toString(value)); - } - - public void clickOnFiltersButton() { - seleniumWebDriverHelper.waitAndClick(filtersStackButton); - } - - public void typeToFiltersInput(String value) { - seleniumWebDriverHelper.setValue(filterStackInput, value); - } - - public void deleteLastTagFromInputTagsField() { - seleniumWebDriverHelper.waitAndSendKeysTo(filterStackInput, BACK_SPACE.toString()); - - // one "backspace" should sent exactly to defined tag (for activating) and next "backspace" - // should be a simple button pressing - seleniumWebDriverHelper.sendKeys(BACK_SPACE.toString()); - } - - public void waitFiltersFormOpened() { - seleniumWebDriverHelper.waitVisibility(filterStackInput); - } - - public void waitFiltersFormClosed() { - seleniumWebDriverHelper.waitInvisibility(filterStackInput); - } - - public String getTextFromFiltersInput() { - return seleniumWebDriverHelper.waitVisibilityAndGetValue(filterStackInput); - } - - private List getTagsFromFiltersInput() { - String tagsXpath = FILTERS_INPUT_TAGS_XPATH + "/md-chip-template"; - - seleniumWebDriverHelper.waitVisibility(By.xpath(tagsXpath)); - - return seleniumWebDriverHelper.waitVisibilityOfAllElements(By.xpath(tagsXpath)); - } - - private String getFiltersInputTagName(WebElement tag) { - return seleniumWebDriverHelper.waitVisibilityAndGetText(tag); - } - - public List getFiltersInputTags() { - return getTagsFromFiltersInput() - .stream() - .map(tag -> getFiltersInputTagName(tag)) - .collect(Collectors.toList()); - } - - public void waitFiltersInputIsEmpty() { - seleniumWebDriverHelper.waitInvisibility(By.xpath(FILTERS_INPUT_TAGS_XPATH)); - } - - public void waitFiltersInputTags(List expectedTags) { - webDriverWaitFactory - .get() - .until((ExpectedCondition) driver -> getFiltersInputTags().equals(expectedTags)); - } - - public void deleteTagByRemoveButton(String tagName) { - String removeButtonXpath = - format( - FILTERS_INPUT_TAG_XPATH_TEMPLATE - + "/parent::md-chip-template/div[@class='stack-library-filter-tag-btn']/i", - tagName); - - seleniumWebDriverHelper.moveCursorToAndClick(By.xpath(removeButtonXpath)); - } - - public void waitTextContainsInFiltersInput(String expectedText) { - webDriverWaitFactory - .get() - .until( - (ExpectedCondition) - driver -> getTextFromFiltersInput().contains(expectedText)); - } - - public void waitTextEqualsInFiltersInput(String expectedText) { - webDriverWaitFactory - .get() - .until( - (ExpectedCondition) driver -> getTextFromFiltersInput().equals(expectedText)); - } - - public List getFiltersSuggestionsNames() { - return seleniumWebDriverHelper - .waitVisibilityOfAllElements(By.xpath("//div[@name='suggestionText']")) - .stream() - .map(webElement -> webElement.getText()) - .collect(toList()); - } - - public List getFiltersSuggestions() { - String filtersSuggestionBody = "//md-chip"; - return seleniumWebDriverHelper.waitVisibilityOfAllElements(By.xpath(filtersSuggestionBody)); - } - - public void waitFiltersSuggestionsNames(List expectedSuggestions) { - expectedSuggestions.forEach( - item -> { - webDriverWaitFactory - .get() - .until( - (ExpectedCondition) - driver -> getFiltersSuggestionsNames().contains(item)); - }); - } - - public WebElement getSelectedSuggestion() { - return getFiltersSuggestions() - .stream() - .filter( - webElement -> - webElement - .getAttribute("class") - .contains("stack-library-filter-suggestion-selected")) - .collect(toList()) - .get(0); - } - - public void waitSelectedFiltersSuggestion(String suggestionName) { - webDriverWaitFactory - .get() - .until( - (ExpectedCondition) - driver -> getSelectedFiltersSuggestionName().equals(suggestionName)); - } - - public String getSelectedFiltersSuggestionName() { - return seleniumWebDriverHelper.waitVisibilityAndGetText(getSelectedSuggestion()); - } - - public WebElement getFiltersSuggestionByName(String suggestionName) { - String filtersSuggestion = - format("//div[@name='suggestionText' and text()='%s']", suggestionName); - - return seleniumWebDriverHelper.waitVisibility(By.xpath(filtersSuggestion)); - } - - public String getSuggestionName(WebElement suggestion) { - return seleniumWebDriverHelper.waitVisibilityAndGetText(suggestion); - } - - public void clearSuggestions() { - seleniumWebDriverHelper.waitAndClick(By.xpath(FILTER_SELECTED_SUGGESTION_BUTTON)); - } - - public void chooseFilterSuggestionByPlusButton(String suggestion) { - seleniumWebDriverHelper.waitAndClick(By.xpath(format(FILTER_SUGGESTION_BUTTON, suggestion))); - } - - public void clickOnFiltersSuggestions(String suggestionName) { - seleniumWebDriverHelper.waitAndClick(getFiltersSuggestionByName(suggestionName)); - } - - public void doubleClickOnFiltersSuggestion(String suggestionName) { - seleniumWebDriverHelper.moveCursorToAndDoubleClick(getFiltersSuggestionByName(suggestionName)); - } - public void waitToolbar() { waitToolbar(WIDGET_TIMEOUT_SEC); } @@ -495,32 +176,6 @@ public void waitToolbar(int timeout) { seleniumWebDriverHelper.waitVisibility(By.id(TOOLBAR_TITLE_ID), timeout); } - public String getTextFromSearchInput() { - return seleniumWebDriverHelper.waitVisibilityAndGetValue(searchInput); - } - - public void typeToSearchInput(String value) { - seleniumWebDriverHelper.setValue(searchInput, value); - } - - public void typeToRamField(String value) { - seleniumWebDriverHelper.setValue(By.id("machine--ram"), value); - } - - public void waitRedRamFieldBorders() { - seleniumWebDriverHelper.waitAttributeContainsValue( - By.xpath("//ng-form[@name='ramAmountForm']"), "class", "ng-invalid-required"); - } - - public void waitRedRamFieldBordersDisappearance() { - seleniumWebDriverHelper.waitAttributeContainsValue( - By.xpath("//ng-form[@name='ramAmountForm']"), "class", "ng-valid-required"); - } - - public void clearTextInSearchInput() { - seleniumWebDriverHelper.waitAndClick(clearInput); - } - public boolean isStackVisible(Stack stack) { return seleniumWebDriver.findElements(By.xpath(format(STACK_ROW_XPATH, stack.getId()))).size() > 0; @@ -557,22 +212,6 @@ public void waitBottomCreateWorkspaceButtonDisabled() { By.xpath(BOTTOM_CREATE_BUTTON_XPATH), "aria-disabled", "true"); } - public void clickOnAllStacksTab() { - seleniumWebDriverHelper.waitAndClick(selectAllStacksTab); - } - - public void clickOnQuickStartTab() { - seleniumWebDriverHelper.waitAndClick(selectQuickStartStacksTab); - } - - public void clickOnSingleMachineTab() { - seleniumWebDriverHelper.waitAndClick(selectSingleMachineStacksTab); - } - - public void clickOnMultiMachineTab() { - seleniumWebDriverHelper.waitAndClick(selectMultiMachineStacksTab); - } - public void clickOnCreateButtonAndOpenInIDE() { // need to move cursor to button to avoid failure https://github.com/eclipse/che/issues/12309 seleniumWebDriverHelper.waitVisibility(bottomCreateWorkspaceButton); @@ -620,54 +259,6 @@ public WebElement waitNameField() { return waitNameField(DEFAULT_TIMEOUT); } - public WebElement waitAllButton(int timeout) { - return seleniumWebDriverHelper.waitVisibility(By.id(ALL_BUTTON_ID), timeout); - } - - public WebElement waitAllButton() { - return waitAllButton(DEFAULT_TIMEOUT); - } - - public void clickOnAllButton() { - waitAllButton().click(); - } - - public WebElement waitQuickStartButton(int timeout) { - return seleniumWebDriverHelper.waitVisibility(By.id(QUICK_START_BUTTON_ID), timeout); - } - - public WebElement waitQuickStartButton() { - return waitQuickStartButton(DEFAULT_TIMEOUT); - } - - public void clickOnQuickStartButton() { - waitQuickStartButton().click(); - } - - public WebElement waitSingleMachineButton(int timeout) { - return seleniumWebDriverHelper.waitVisibility(By.id(SINGLE_MACHINE_BUTTON_ID), timeout); - } - - public WebElement waitSingleMachineButton() { - return waitSingleMachineButton(DEFAULT_TIMEOUT); - } - - public void clickOnSingleMachineButton() { - waitSingleMachineButton().click(); - } - - public WebElement waitMultiMachineButton(int timeout) { - return seleniumWebDriverHelper.waitVisibility(By.id(MULTI_MACHINE_BUTTON_ID), timeout); - } - - public WebElement waitMultiMachineButton() { - return waitMultiMachineButton(DEFAULT_TIMEOUT); - } - - public void clickOnMultiMachineButton() { - waitMultiMachineButton().click(); - } - public void waitBottomCreateButton(int timeout) { seleniumWebDriverHelper.waitVisibility(bottomCreateWorkspaceButton, timeout); } @@ -678,10 +269,6 @@ public void waitBottomCreateButton() { public void waitMainActionButtons(int timeout) { waitTopCreateButton(timeout); - waitAllButton(timeout); - waitQuickStartButton(timeout); - waitSingleMachineButton(timeout); - waitMultiMachineButton(timeout); addOrImportForm.waitAddOrImportProjectButton(timeout); waitBottomCreateButton(timeout); } @@ -702,26 +289,26 @@ public void waitPageLoad() { public List getAvailableStacks() { return seleniumWebDriverHelper - .waitPresenceOfAllElements(By.xpath("//div[@data-stack-id]")) + .waitPresenceOfAllElements(By.xpath("//div[@data-devfile-id]")) .stream() - .map(webElement -> Stack.getById(webElement.getAttribute("data-stack-id"))) + .map(webElement -> Stack.getById(webElement.getAttribute("data-devfile-id"))) .collect(toList()); } public void waitStackSelected(Stack stack) { String selectedStackXpath = format( - "//div[@data-stack-id='%s' and contains(@class, 'stack-selector-item-selected')]", + "//div[@data-devfile-id='%s' and contains(@class, 'devfile-selector-item-selected')]", stack.getId()); seleniumWebDriverHelper.waitVisibility(By.xpath(selectedStackXpath)); } public List getVisibleStacks() { return seleniumWebDriverHelper - .waitPresenceOfAllElements(By.xpath("//div[@data-stack-id]")) + .waitPresenceOfAllElements(By.xpath("//div[@data-devfile-id]")) .stream() .filter(seleniumWebDriverHelper::isVisible) - .map(webElement -> Stack.getById(webElement.getAttribute("data-stack-id"))) + .map(webElement -> Stack.getById(webElement.getAttribute("data-devfile-id"))) .collect(Collectors.toList()); } @@ -737,7 +324,7 @@ public void waitStacks(List expectedStacks) { expectedStacks.forEach( stack -> seleniumWebDriverHelper.waitPresence( - By.xpath(format("//div[@data-stack-id='%s']", stack.getId())))); + By.xpath(format("//div[@data-devfile-id='%s']", stack.getId())))); } public void waitStacksCount(int expectedCount) { @@ -775,37 +362,7 @@ public void clickOnTitlePlaceCoordinate() { seleniumWebDriverHelper.getAction().click().perform(); } - public void clickOnInputFieldTag(String tagName) { - seleniumWebDriverHelper.waitAndClick( - By.xpath(format(FILTERS_INPUT_TAG_XPATH_TEMPLATE, tagName))); - } - public void clickOnAddStackButton() { seleniumWebDriverHelper.waitAndClick(By.id("add-stack-button")); } - - public void waitCreateStackDialog() { - // wait should be changed to "TestWebElementRenderChecker" after resolving issue - // https://github.com/eclipse/che/issues/10087 - WaitUtils.sleepQuietly(2); - - seleniumWebDriverHelper.waitVisibility(By.xpath(CREATE_STACK_DIALOG_FORM_XPATH)); - seleniumWebDriverHelper.waitVisibility(By.xpath("//div[text()='Build stack from recipe']")); - } - - public void waitCreateStackDialogClosing() { - seleniumWebDriverHelper.waitInvisibility(By.xpath("//md-dialog")); - } - - public void clickOnYesButtonInCreateStackDialog() { - seleniumWebDriverHelper.waitAndClick(By.xpath("//*[@che-button-title='Ok']")); - } - - public void clickOnNoButtonInCreateStackDialog() { - seleniumWebDriverHelper.waitAndClick(By.xpath("//*[@che-button-title='Cancel']")); - } - - public void closeCreateStackDialogByCloseButton() { - seleniumWebDriverHelper.waitAndClick(By.xpath("//md-dialog//i")); - } } diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateAndDeleteProjectsTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateAndDeleteProjectsTest.java index 753ea5dc065b..c744b569af09 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateAndDeleteProjectsTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateAndDeleteProjectsTest.java @@ -13,7 +13,6 @@ import static org.eclipse.che.commons.lang.NameGenerator.generate; import static org.eclipse.che.selenium.pageobject.ProjectExplorer.FolderTypes.PROJECT_FOLDER; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Template.CONSOLE_JAVA_SIMPLE; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Template.WEB_JAVA_SPRING; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.PROJECTS; @@ -33,6 +32,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceProjects; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; @@ -86,8 +86,7 @@ public void createProjectTest() { newWorkspace.waitToolbar(); // we are selecting 'Java' stack from the 'All Stack' tab for compatibility with OSIO - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(WORKSPACE); // create 'web-java-spring' and 'console-java-simple' projects diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateFactoryTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateFactoryTest.java index 7cf8a4e290ca..fbfbb36a4291 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateFactoryTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateFactoryTest.java @@ -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.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Template.WEB_JAVA_SPRING; import static org.eclipse.che.selenium.pageobject.dashboard.factories.CreateFactoryPage.TabNames.CONFIG_TAB_ID; import static org.eclipse.che.selenium.pageobject.dashboard.factories.CreateFactoryPage.TabNames.GIT_TAB_ID; @@ -42,6 +41,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.DashboardFactories; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.factories.CreateFactoryPage; import org.eclipse.che.selenium.pageobject.dashboard.factories.FactoryDetails; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails; @@ -375,8 +375,7 @@ private TestWorkspace createWorkspaceWithProject(String workspaceName) { loader.waitOnClosed(); // we are selecting 'Java' stack from the 'All Stack' tab for compatibility with OSIO - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(workspaceName); projectSourcePage.clickOnAddOrImportProjectButton(); @@ -402,8 +401,7 @@ private TestWorkspace createWorkspaceWithoutProject(String workspaceName) { loader.waitOnClosed(); // we are selecting 'Java' stack from the 'All Stack' tab for compatibility with OSIO - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(workspaceName); newWorkspace.clickOnCreateButtonAndEditWorkspace(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateWorkspaceTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateWorkspaceTest.java index d7046177d721..5f33e3836336 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateWorkspaceTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateWorkspaceTest.java @@ -11,12 +11,6 @@ */ package org.eclipse.che.selenium.dashboard; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.BLANK; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CHE_7_PREVIEW; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL_CENTOS; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL_THEIA_ON_KUBERNETES; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Template.WEB_JAVA_SPRING; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; @@ -29,6 +23,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; @@ -92,201 +87,10 @@ public void checkWorkspaceName() { newWorkspace.waitBottomCreateWorkspaceButtonEnabled(); } - @Test(groups = TestGroup.DOCKER) - public void checkMachinesDocker() { - String machineName = "dev-machine"; - - // change the RAM number by the increment and decrement buttons - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); - assertTrue(newWorkspace.isMachineExists(machineName)); - assertEquals(newWorkspace.getRAM(machineName), 2.0); - newWorkspace.clickOnIncrementMemoryButton(machineName); - assertEquals(newWorkspace.getRAM(machineName), 2.1); - newWorkspace.clickOnDecrementMemoryButton(machineName); - - // we need to wait a little to avoid quick clicking on this button - WaitUtils.sleepQuietly(1); - newWorkspace.clickOnDecrementMemoryButton(machineName); - WaitUtils.sleepQuietly(1); - newWorkspace.clickOnDecrementMemoryButton(machineName); - assertEquals(newWorkspace.getRAM(machineName), 1.8); - - // type number of memory in the RAM field - newWorkspace.setMachineRAM(machineName, 5.0); - assertEquals(newWorkspace.getRAM(machineName), 5.0); - - // check the RAM section of the Java-MySql stack(with two machines) - newWorkspace.selectStack(JAVA_MYSQL_CENTOS); - assertTrue(newWorkspace.isMachineExists("db")); - assertTrue(newWorkspace.isMachineExists(machineName)); - newWorkspace.clickOnDecrementMemoryButton(machineName); - newWorkspace.clickOnDecrementMemoryButton("db"); - assertEquals(newWorkspace.getRAM(machineName), 1.9); - assertEquals(newWorkspace.getRAM("db"), 0.9); - newWorkspace.clickOnDecrementMemoryButton("db"); - assertEquals(newWorkspace.getRAM("db"), 0.8); - newWorkspace.setMachineRAM(machineName, 100.0); - newWorkspace.clickOnIncrementMemoryButton(machineName); - assertEquals(newWorkspace.getRAM(machineName), 100.0); - } - - @Test(groups = {TestGroup.OPENSHIFT}) - public void checkMachinesOpenshift() { - String machineName = "dev-machine"; - - // change the RAM number by the increment and decrement buttons - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); - assertTrue(newWorkspace.isMachineExists(machineName)); - assertEquals(newWorkspace.getRAM(machineName), 2.0); - newWorkspace.clickOnIncrementMemoryButton(machineName); - assertEquals(newWorkspace.getRAM(machineName), 2.1); - newWorkspace.clickOnDecrementMemoryButton(machineName); - - // we need to wait a little to avoid quick clicking on this button - WaitUtils.sleepQuietly(1); - newWorkspace.clickOnDecrementMemoryButton(machineName); - WaitUtils.sleepQuietly(1); - newWorkspace.clickOnDecrementMemoryButton(machineName); - assertEquals(newWorkspace.getRAM(machineName), 1.8); - - // type number of memory in the RAM field - newWorkspace.setMachineRAM(machineName, 5.0); - assertEquals(newWorkspace.getRAM(machineName), 5.0); - - // check the RAM section of 'MySQL with Theia IDE on Kubernetes' stack(with two machines) - newWorkspace.selectStack(JAVA_MYSQL_THEIA_ON_KUBERNETES); - assertTrue(newWorkspace.isMachineExists("web/mysql")); - assertTrue(newWorkspace.isMachineExists("web/dev")); - newWorkspace.clickOnDecrementMemoryButton("web/dev"); - newWorkspace.clickOnDecrementMemoryButton("web/mysql"); - assertEquals(newWorkspace.getRAM("web/dev"), 0.4); - assertEquals(newWorkspace.getRAM("web/mysql"), 0.2); - newWorkspace.clickOnDecrementMemoryButton("web/mysql"); - assertEquals(newWorkspace.getRAM("web/mysql"), 0.1); - newWorkspace.setMachineRAM("web/dev", 100.0); - newWorkspace.clickOnIncrementMemoryButton("web/dev"); - assertEquals(newWorkspace.getRAM("web/dev"), 100.0); - } - - @Test(groups = TestGroup.DOCKER) - public void checkFiltersStacksFeatureDocker() { - - // filter stacks by 'java' value and check filtered stacks list - newWorkspace.clickOnAllStacksTab(); - newWorkspace.clickOnFiltersButton(); - newWorkspace.typeToFiltersInput("java"); - newWorkspace.chooseFilterSuggestionByPlusButton("JAVA"); - assertTrue(newWorkspace.isStackVisible(JAVA)); - assertFalse(newWorkspace.isStackVisible(JAVA_MYSQL)); - newWorkspace.clickOnMultiMachineTab(); - assertFalse(newWorkspace.isStackVisible(JAVA)); - - // filter stacks by 'blank' value and check filtered stacks list - newWorkspace.clickOnSingleMachineTab(); - newWorkspace.clickOnFiltersButton(); - newWorkspace.clearSuggestions(); - newWorkspace.typeToFiltersInput("blank"); - newWorkspace.chooseFilterSuggestionByPlusButton("BLANK"); - assertTrue(newWorkspace.isStackVisible(BLANK)); - - // filter the Java-MySql stack - newWorkspace.clickOnAllStacksTab(); - newWorkspace.clickOnFiltersButton(); - newWorkspace.clearSuggestions(); - newWorkspace.typeToFiltersInput("java"); - newWorkspace.chooseFilterSuggestionByPlusButton("JAVA 1.8, TOMCAT 8, MYSQL 5.7"); - assertTrue(newWorkspace.isStackVisible(JAVA_MYSQL)); - newWorkspace.clickOnSingleMachineTab(); - assertFalse(newWorkspace.isStackVisible(JAVA_MYSQL)); - } - - @Test(groups = {TestGroup.OPENSHIFT}) - public void checkFiltersStacksFeatureOpenshift() { - - // filter stacks by 'java' value and check filtered stacks list - newWorkspace.clickOnAllStacksTab(); - newWorkspace.clickOnFiltersButton(); - newWorkspace.typeToFiltersInput("java"); - newWorkspace.chooseFilterSuggestionByPlusButton("JAVA"); - assertTrue(newWorkspace.isStackVisible(JAVA)); - assertFalse(newWorkspace.isStackVisible(JAVA_MYSQL)); - newWorkspace.clickOnMultiMachineTab(); - assertFalse(newWorkspace.isStackVisible(JAVA)); - - // filter stacks by 'blank' value and check filtered stacks list - newWorkspace.clickOnSingleMachineTab(); - newWorkspace.clickOnFiltersButton(); - newWorkspace.clearSuggestions(); - newWorkspace.typeToFiltersInput("blank"); - newWorkspace.chooseFilterSuggestionByPlusButton("BLANK"); - assertTrue(newWorkspace.isStackVisible(BLANK)); - } - - @Test(groups = TestGroup.DOCKER) - public void checkSearchStackFeatureDocker() { - - // search stacks with 'java' value - newWorkspace.typeToSearchInput("java"); - newWorkspace.clickOnSingleMachineTab(); - assertTrue(newWorkspace.isStackVisible(JAVA)); - assertFalse(newWorkspace.isStackVisible(JAVA_MYSQL)); - newWorkspace.clickOnAllStacksTab(); - assertTrue(newWorkspace.isStackVisible(JAVA_MYSQL)); - newWorkspace.clearTextInSearchInput(); - - // search stacks with 'mysql' value - newWorkspace.typeToSearchInput("mysql"); - newWorkspace.clickOnMultiMachineTab(); - assertTrue(newWorkspace.isStackVisible(JAVA_MYSQL)); - newWorkspace.clickOnAllStacksTab(); - assertTrue(newWorkspace.isStackVisible(JAVA_MYSQL)); - - // search stacks with 'blank' value - newWorkspace.typeToSearchInput("blank"); - assertTrue(newWorkspace.isStackVisible(BLANK)); - newWorkspace.clickOnMultiMachineTab(); - assertFalse(newWorkspace.isStackVisible(BLANK)); - - newWorkspace.clearTextInSearchInput(); - } - - @Test(groups = {TestGroup.OPENSHIFT}) - public void checkSearchStackFeatureOpenshift() { - - // search stacks with 'java' value - newWorkspace.typeToSearchInput("java"); - newWorkspace.clickOnSingleMachineTab(); - assertTrue(newWorkspace.isStackVisible(JAVA)); - assertFalse(newWorkspace.isStackVisible(JAVA_MYSQL_THEIA_ON_KUBERNETES)); - newWorkspace.clickOnAllStacksTab(); - assertTrue(newWorkspace.isStackVisible(JAVA_MYSQL_THEIA_ON_KUBERNETES)); - newWorkspace.clearTextInSearchInput(); - - // search stacks with 'mysql' value - newWorkspace.typeToSearchInput("che 7"); - newWorkspace.clickOnAllStacksTab(); - assertTrue(newWorkspace.isStackVisible(CHE_7_PREVIEW)); - newWorkspace.clickOnMultiMachineTab(); - assertFalse(newWorkspace.isStackVisible(CHE_7_PREVIEW)); - - // search stacks with 'blank' value - newWorkspace.clickOnSingleMachineTab(); - newWorkspace.typeToSearchInput("blank"); - assertTrue(newWorkspace.isStackVisible(BLANK)); - newWorkspace.clickOnMultiMachineTab(); - assertFalse(newWorkspace.isStackVisible(BLANK)); - - newWorkspace.clearTextInSearchInput(); - } - @Test public void checkProjectSourcePage() { - newWorkspace.clickOnAllStacksTab(); - // add a project from the 'web-java-spring' sample - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); projectSourcePage.clickOnAddOrImportProjectButton(); projectSourcePage.selectSample(projectName); projectSourcePage.clickOnAddProjectButton(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportMavenProjectFromGitTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportMavenProjectFromGitTest.java index cc76201c1fbe..46dca926ef03 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportMavenProjectFromGitTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportMavenProjectFromGitTest.java @@ -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.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Sources.GIT; import com.google.inject.Inject; @@ -31,6 +30,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; @@ -82,8 +82,7 @@ public void checkAbilityImportMavenProjectTest() { newWorkspace.waitToolbar(); // we are selecting 'Java' stack from the 'All Stack' tab for compatibility with OSIO - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(WORKSPACE); projectSourcePage.clickOnAddOrImportProjectButton(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromGitHubTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromGitHubTest.java index 236dec525a5d..a8a9c7ae2196 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromGitHubTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromGitHubTest.java @@ -14,7 +14,6 @@ import static org.eclipse.che.commons.lang.NameGenerator.generate; import static org.eclipse.che.selenium.core.utils.WaitUtils.sleepQuietly; import static org.eclipse.che.selenium.pageobject.ProjectExplorer.FolderTypes.PROJECT_FOLDER; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Sources.GITHUB; import static org.testng.AssertJUnit.assertTrue; @@ -36,6 +35,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; @@ -99,8 +99,7 @@ public void checkAbilityImportProjectFromGithub() { workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); // we are selecting 'Java' stack from the 'All Stack' tab for compatibility with OSIO - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(WORKSPACE); projectSourcePage.clickOnAddOrImportProjectButton(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromZipTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromZipTest.java index 47ea6dc10958..41551764d317 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromZipTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromZipTest.java @@ -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.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Sources.ZIP; import com.google.inject.Inject; @@ -31,6 +30,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; @@ -84,8 +84,7 @@ public void importProjectFromZipTest() { newWorkspace.waitToolbar(); // we are selecting 'Java' stack from the 'All Stack' tab for compatibility with OSIO - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(WORKSPACE); projectSourcePage.clickOnAddOrImportProjectButton(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/AddWorkspaceToOrganizationTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/AddWorkspaceToOrganizationTest.java index b774a90ae72f..1dc7a9f7b720 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/AddWorkspaceToOrganizationTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/AddWorkspaceToOrganizationTest.java @@ -13,7 +13,6 @@ import static org.eclipse.che.commons.lang.NameGenerator.generate; import static org.eclipse.che.selenium.pageobject.dashboard.NavigationBar.MenuItem.ORGANIZATIONS; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; @@ -25,6 +24,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.CheMultiuserAdminDashboard; import org.eclipse.che.selenium.pageobject.dashboard.NavigationBar; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.organization.OrganizationListPage; import org.eclipse.che.selenium.pageobject.dashboard.organization.OrganizationPage; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails; @@ -164,7 +164,7 @@ private void createWorkspace(String organizationName, String workspaceName) { newWorkspace.waitToolbar(); newWorkspace.openOrganizationsList(); newWorkspace.selectOrganizationFromList(organizationName); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(workspaceName); newWorkspace.clickOnCreateButtonAndEditWorkspace(); workspaceDetails.waitToolbarTitleName(workspaceName); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceMemberTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceMemberTest.java index 2a642aa16331..46d06a9090e8 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceMemberTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceMemberTest.java @@ -15,7 +15,6 @@ import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Project.New.FILE; import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Project.New.NEW; import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Project.PROJECT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.OVERVIEW; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.SHARE; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces.Status.STOPPED; @@ -38,6 +37,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.CheMultiuserAdminDashboard; import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; import org.eclipse.che.selenium.pageobject.dashboard.NavigationBar; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.StateWorkspace; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceOverview; @@ -179,7 +179,7 @@ public void checkSharingByAddedMember() { } private void createWorkspace(String workspaceName) { - createWorkspaceHelper.createWorkspaceFromStackWithProject(JAVA, workspaceName, PROJECT_NAME); + createWorkspaceHelper.createWorkspaceFromStackWithProject(Stack.JAVA_MAVEN, workspaceName, PROJECT_NAME); ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceOwnerTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceOwnerTest.java index 790b223e5468..dfb9a9c120ec 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceOwnerTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceOwnerTest.java @@ -12,7 +12,6 @@ package org.eclipse.che.selenium.dashboard.organization; import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.SHARE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; @@ -29,6 +28,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.CheMultiuserAdminDashboard; import org.eclipse.che.selenium.pageobject.dashboard.NavigationBar; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceShare; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; @@ -164,7 +164,7 @@ private void createWorkspace(String organizationName, String workspaceName) { newWorkspace.waitToolbar(); newWorkspace.openOrganizationsList(); newWorkspace.selectOrganizationFromList(organizationName); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(workspaceName); newWorkspace.clickOnCreateButtonAndEditWorkspace(); workspaceDetails.waitToolbarTitleName(workspaceName); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/AddOrImportProjectFormTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/AddOrImportProjectFormTest.java index 6163616b0da0..69d0c8ca1e02 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/AddOrImportProjectFormTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/AddOrImportProjectFormTest.java @@ -147,7 +147,7 @@ public void prepareToTestMethod() { public void checkOfCheckboxes() { // preparing newWorkspace.waitPageLoad(); - newWorkspace.selectStack(Stack.JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.waitAddOrImportFormOpened(); addOrImportForm.waitSamplesButtonSelected(); @@ -193,7 +193,7 @@ public void checkOfCheckboxes() { public void checkProjectSamples() { // preparing newWorkspace.waitPageLoad(); - newWorkspace.selectStack(Stack.JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.waitAddOrImportFormOpened(); addOrImportForm.waitSamplesButtonSelected(); @@ -341,8 +341,8 @@ public void checkProjectSamples() { public void checkProjectsBlank() throws Exception { // preparing newWorkspace.waitPageLoad(); - newWorkspace.selectStack(Stack.BLANK); - newWorkspace.waitStackSelected(Stack.BLANK); + newWorkspace.selectStack(Stack.JAVA_MAVEN); + newWorkspace.waitStackSelected(Stack.JAVA_MAVEN); addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.waitAddOrImportFormOpened(); addOrImportForm.clickOnBlankButton(); @@ -401,7 +401,6 @@ public void checkProjectsBlank() throws Exception { addOrImportForm.waitAddOrImportFormOpened(); addOrImportForm.clickOnGitHubButton(); - newWorkspace.setMachineRAM("dev-machine", 5.0); newWorkspace.typeWorkspaceName(WORKSPACE_NAME); newWorkspace.clickOnCreateButtonAndEditWorkspace(); @@ -421,14 +420,10 @@ public void checkCreatingProject() throws Exception { newWorkspace.waitStackSelected(Stack.DOT_NET); assertEquals(newWorkspace.getWorkspaceNameValue(), TEST_BLANK_WORKSPACE_NAME); - newWorkspace.selectStack(Stack.JAVA); - newWorkspace.waitStackSelected(Stack.JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); + newWorkspace.waitStackSelected(Stack.JAVA_MAVEN); assertEquals(newWorkspace.getWorkspaceNameValue(), TEST_BLANK_WORKSPACE_NAME); - // add workspace with specified "RAM" value - newWorkspace.setMachineRAM("dev-machine", 3.0); - newWorkspace.waitRamValue("dev-machine", 3.0); - addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.waitAddOrImportFormOpened(); @@ -499,8 +494,8 @@ private void prepareJavaWorkspace(String workspaceName) { newWorkspace.waitPageLoad(); newWorkspace.typeWorkspaceName(workspaceName); - newWorkspace.selectStack(Stack.JAVA); - newWorkspace.waitStackSelected(Stack.JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); + newWorkspace.waitStackSelected(Stack.JAVA_MAVEN); addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.waitAddOrImportFormOpened(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/NewWorkspacePageTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/NewWorkspacePageTest.java index 6e9e01d68e8a..3e16ec3774e5 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/NewWorkspacePageTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/NewWorkspacePageTest.java @@ -13,44 +13,9 @@ import static java.util.Arrays.asList; import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ANDROID; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.BLANK; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CAMEL_SPRINGBOOT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CAMEL_SPRINGBOOT_CHE7; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_BLANK; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_GO; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_NODEJS; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_WILDFLY_SWARM; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CEYLON_WITH_JAVA_JAVASCRIPT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CHE_7_PREVIEW; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CHE_7_PREVIEW_DEV; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CHE_7_THEIA_DEV; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CPP; import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.DOT_NET; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.DOT_NET_DEFAULT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ECLIPSE_CHE; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ECLIPSE_VERTX; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.GO; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.GO_DEFAULT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_CENTOS; import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_GRADLE; import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MAVEN; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL_CENTOS; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL_THEIA_ON_KUBERNETES; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_THEIA_DOCKER; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.KOTLIN; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.NODE; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.NODEJS_AND_POSTGRES; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PHP; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PHP_CHE7; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PHP_MYSQL_CHE7; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PYTHON; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PYTHON_DEFAULT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.RAILS; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.SPRING_BOOT; -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; @@ -71,297 +36,9 @@ /** @author Ihor Okhrimenko */ public class NewWorkspacePageTest { private static final String EXPECTED_WORKSPACE_NAME_PREFIX = "wksp-"; - private static final String MACHINE_NAME = "dev-machine"; - private static final double MAX_RAM_VALUE = 100.0; - private static final double MIN_RAM_VALUE = 0.1; - private static final double RAM_CHANGE_STEP = 0.1; - private static final String JDK_SUGGESTION_TITLE = "JDK"; - private static final String JAVA_SUGGESTION_TITLE = "JAVA"; - private static final String JAVA_1_8_SUGGESTION_TITLE = "JAVA 1.8"; - private static final String JAVA_TOMCAT_MYSQL_SUGGESTION_TITLE = "JAVA 1.8, TOMCAT 8, MYSQL 5.7"; private static final String NAME_WITH_ONE_HUNDRED_SYMBOLS = generate("wksp-", 95); private static final List NOT_VALID_NAMES = asList("wksp-", "-wksp", "wk sp", "wk_sp", "wksp@", "wksp$", "wksp&", "wksp*"); - private static final String LETTER_FOR_SEARCHING = "j"; - private static final List EXPECTED_JDK_STACKS = asList(JAVA, ECLIPSE_CHE); - - private static List EXPECTED_OPENSHIFT_QUICK_START_STACKS = - asList( - BLANK, - JAVA, - DOT_NET_DEFAULT, - DOT_NET, - ANDROID, - CAMEL_SPRINGBOOT_CHE7, - CPP, - CHE_7_PREVIEW, - CHE_7_PREVIEW_DEV, - CHE_7_THEIA_DEV, - ECLIPSE_CHE, - GO_DEFAULT, - GO, - JAVA_MYSQL_THEIA_ON_KUBERNETES, - JAVA_GRADLE, - JAVA_MAVEN, - NODE, - PHP, - PHP_MYSQL_CHE7, - PHP_CHE7, - PYTHON_DEFAULT, - PYTHON, - RAILS); - - private static List EXPECTED_K8S_QUICK_START_STACKS = - asList( - BLANK, - JAVA, - DOT_NET_DEFAULT, - DOT_NET, - ANDROID, - CAMEL_SPRINGBOOT_CHE7, - CPP, - CHE_7_PREVIEW, - CHE_7_PREVIEW_DEV, - CHE_7_THEIA_DEV, - ECLIPSE_CHE, - GO_DEFAULT, - GO, - JAVA_MYSQL_THEIA_ON_KUBERNETES, - JAVA_GRADLE, - JAVA_MAVEN, - NODE, - PHP, - PHP_CHE7, - PHP_MYSQL_CHE7, - PYTHON_DEFAULT, - PYTHON, - RAILS); - - private static final List EXPECTED_DOCKER_QUICK_START_STACKS = - asList( - BLANK, - JAVA, - JAVA_MYSQL, - DOT_NET_DEFAULT, - DOT_NET, - ANDROID, - CAMEL_SPRINGBOOT_CHE7, - CPP, - ECLIPSE_CHE, - GO_DEFAULT, - GO, - JAVA_GRADLE, - JAVA_MAVEN, - NODE, - PHP, - PHP_CHE7, - PHP_MYSQL_CHE7, - PYTHON_DEFAULT, - PYTHON, - RAILS, - JAVA_THEIA_DOCKER); - - private static List EXPECTED_OPENSHIFT_SINGLE_MACHINE_STACKS = - asList( - BLANK, - JAVA, - DOT_NET_DEFAULT, - DOT_NET, - ANDROID, - CAMEL_SPRINGBOOT_CHE7, - CAMEL_SPRINGBOOT, - CPP, - CENTOS_BLANK, - CENTOS_GO, - CENTOS_NODEJS, - CENTOS_WILDFLY_SWARM, - CEYLON_WITH_JAVA_JAVASCRIPT, - CHE_7_PREVIEW, - CHE_7_PREVIEW_DEV, - CHE_7_THEIA_DEV, - ECLIPSE_CHE, - ECLIPSE_VERTX, - GO_DEFAULT, - GO, - JAVA_CENTOS, - JAVA_GRADLE, - JAVA_MAVEN, - KOTLIN, - NODE, - PHP, - PHP_CHE7, - PYTHON_DEFAULT, - PYTHON, - RAILS, - SPRING_BOOT); - - private static List EXPECTED_K8S_SINGLE_MACHINE_STACKS = - asList( - BLANK, - JAVA, - DOT_NET_DEFAULT, - DOT_NET, - ANDROID, - CAMEL_SPRINGBOOT_CHE7, - CAMEL_SPRINGBOOT, - CPP, - CENTOS_BLANK, - CENTOS_GO, - CENTOS_NODEJS, - CENTOS_WILDFLY_SWARM, - CEYLON_WITH_JAVA_JAVASCRIPT, - CHE_7_PREVIEW, - CHE_7_PREVIEW_DEV, - CHE_7_THEIA_DEV, - ECLIPSE_CHE, - ECLIPSE_VERTX, - GO_DEFAULT, - GO, - JAVA_CENTOS, - JAVA_GRADLE, - JAVA_MAVEN, - KOTLIN, - NODE, - PHP, - PHP_CHE7, - PHP_MYSQL_CHE7, - PYTHON_DEFAULT, - PYTHON, - RAILS, - SPRING_BOOT); - - private static List EXPECTED_DOCKER_SINGLE_MACHINE_STACKS = - asList( - BLANK, - JAVA, - DOT_NET_DEFAULT, - DOT_NET, - ANDROID, - CAMEL_SPRINGBOOT_CHE7, - CAMEL_SPRINGBOOT, - CPP, - CENTOS_BLANK, - CENTOS_GO, - CENTOS_NODEJS, - CENTOS_WILDFLY_SWARM, - CEYLON_WITH_JAVA_JAVASCRIPT, - ECLIPSE_CHE, - ECLIPSE_VERTX, - GO_DEFAULT, - GO, - JAVA_CENTOS, - JAVA_GRADLE, - JAVA_MAVEN, - KOTLIN, - NODE, - PHP, - PHP_CHE7, - PYTHON_DEFAULT, - PYTHON, - RAILS, - SPRING_BOOT); - - private static final List EXPECTED_OPENSHIFT_MULTI_MACHINE_STACKS = - asList(JAVA_MYSQL_THEIA_ON_KUBERNETES, NODEJS_AND_POSTGRES, PHP_MYSQL_CHE7); - - private static final List EXPECTED_K8S_MULTI_MACHINE_STACKS = - asList(JAVA_MYSQL_THEIA_ON_KUBERNETES, NODEJS_AND_POSTGRES); - - private static final List EXPECTED_DOCKER_MULTI_MACHINE_STACKS = - asList(JAVA_MYSQL, JAVA_MYSQL_CENTOS, JAVA_THEIA_DOCKER); - - private static final List - EXPECTED_OPENSHIFT_QUICK_START_STACKS_REVERSE_ORDER = - asList( - JAVA, - BLANK, - RAILS, - PYTHON, - PYTHON_DEFAULT, - PHP_CHE7, - PHP_MYSQL_CHE7, - PHP, - NODE, - JAVA_MAVEN, - JAVA_GRADLE, - JAVA_MYSQL_THEIA_ON_KUBERNETES, - GO, - GO_DEFAULT, - ECLIPSE_CHE, - CHE_7_THEIA_DEV, - CHE_7_PREVIEW_DEV, - CHE_7_PREVIEW, - CPP, - CAMEL_SPRINGBOOT_CHE7, - ANDROID, - DOT_NET, - DOT_NET_DEFAULT); - - private static final List EXPECTED_K8S_QUICK_START_STACKS_REVERSE_ORDER = - asList( - JAVA, - BLANK, - RAILS, - PYTHON, - PYTHON_DEFAULT, - PHP, - PHP_CHE7, - PHP_MYSQL_CHE7, - NODE, - JAVA_MAVEN, - JAVA_GRADLE, - JAVA_MYSQL_THEIA_ON_KUBERNETES, - GO, - GO_DEFAULT, - ECLIPSE_CHE, - CHE_7_THEIA_DEV, - CHE_7_PREVIEW_DEV, - CHE_7_PREVIEW, - CPP, - CAMEL_SPRINGBOOT_CHE7, - ANDROID, - DOT_NET, - DOT_NET_DEFAULT); - - private static final List EXPECTED_DOCKER_QUICK_START_STACKS_REVERSE_ORDER = - asList( - JAVA_MYSQL, - JAVA, - BLANK, - JAVA_THEIA_DOCKER, - RAILS, - PYTHON, - PYTHON_DEFAULT, - PHP_CHE7, - PHP_MYSQL_CHE7, - PHP, - NODE, - JAVA_MAVEN, - JAVA_GRADLE, - GO, - GO_DEFAULT, - ECLIPSE_CHE, - CPP, - CAMEL_SPRINGBOOT_CHE7, - ANDROID, - DOT_NET, - DOT_NET_DEFAULT); - - private static final List EXPECTED_OPENSHIFT_JAVA_STACKS = - asList(JAVA, ANDROID, ECLIPSE_CHE, JAVA_MYSQL_THEIA_ON_KUBERNETES); - - private static final List EXPECTED_DOCKER_JAVA_STACKS = - asList(JAVA, JAVA_MYSQL, ECLIPSE_CHE, ANDROID); - - private static final List EXPECTED_OPENSHIFT_FILTERS_SUGGESTIONS = - asList(JAVA_SUGGESTION_TITLE, JDK_SUGGESTION_TITLE, JAVA_1_8_SUGGESTION_TITLE); - - private static final List EXPECTED_K8S_FILTERS_SUGGESTIONS = - asList(JAVA_SUGGESTION_TITLE, JDK_SUGGESTION_TITLE); - - private static final List EXPECTED_DOCKER_FILTERS_SUGGESTIONS = - asList(JAVA_SUGGESTION_TITLE, JDK_SUGGESTION_TITLE, JAVA_TOMCAT_MYSQL_SUGGESTION_TITLE); - private static final List VALID_NAMES = asList("Wk-sp", "Wk-sp1", "9wk-sp", "5wk-sp0", "Wk19sp", "Wksp-01"); @@ -426,301 +103,6 @@ public void checkNameField() { checkValidNames(); } - @Test(groups = {TestGroup.OPENSHIFT}) - public void checkOpenshiftStackButtons() { - checkStackButtons( - EXPECTED_OPENSHIFT_QUICK_START_STACKS, - EXPECTED_OPENSHIFT_SINGLE_MACHINE_STACKS, - EXPECTED_OPENSHIFT_MULTI_MACHINE_STACKS, - EXPECTED_OPENSHIFT_QUICK_START_STACKS_REVERSE_ORDER); - } - - @Test(groups = {TestGroup.K8S}) - public void checkK8SStackButtons() { - checkStackButtons( - EXPECTED_K8S_QUICK_START_STACKS, - EXPECTED_K8S_SINGLE_MACHINE_STACKS, - EXPECTED_K8S_MULTI_MACHINE_STACKS, - EXPECTED_K8S_QUICK_START_STACKS_REVERSE_ORDER); - } - - @Test(groups = TestGroup.DOCKER) - public void checkDockerStackButtons() { - checkStackButtons( - EXPECTED_DOCKER_QUICK_START_STACKS, - EXPECTED_DOCKER_SINGLE_MACHINE_STACKS, - EXPECTED_DOCKER_MULTI_MACHINE_STACKS, - EXPECTED_DOCKER_QUICK_START_STACKS_REVERSE_ORDER); - } - - @Test(groups = {TestGroup.OPENSHIFT}) - public void checkOpenshiftFiltersButton() { - checkFiltersButton( - EXPECTED_OPENSHIFT_FILTERS_SUGGESTIONS, EXPECTED_OPENSHIFT_QUICK_START_STACKS); - } - - @Test(groups = {TestGroup.K8S}) - public void checkK8SFiltersButton() { - checkFiltersButton(EXPECTED_K8S_FILTERS_SUGGESTIONS, EXPECTED_K8S_QUICK_START_STACKS); - } - - @Test(groups = TestGroup.DOCKER) - public void checkDockerFiltersButton() { - checkFiltersButton(EXPECTED_DOCKER_FILTERS_SUGGESTIONS, EXPECTED_DOCKER_QUICK_START_STACKS); - } - - @Test - public void checkAddStackButton() { - newWorkspace.waitPageLoad(); - - // close form by "ESCAPE" button - newWorkspace.clickOnAddStackButton(); - newWorkspace.waitCreateStackDialog(); - seleniumWebDriverHelper.sendKeys(ESCAPE.toString()); - newWorkspace.waitCreateStackDialogClosing(); - - // close form by clicking on outside of form bounds - newWorkspace.clickOnAddStackButton(); - newWorkspace.waitCreateStackDialog(); - newWorkspace.clickOnTitlePlaceCoordinate(); - newWorkspace.waitCreateStackDialogClosing(); - - // close form by "Close" button - newWorkspace.clickOnAddStackButton(); - newWorkspace.waitCreateStackDialog(); - newWorkspace.closeCreateStackDialogByCloseButton(); - newWorkspace.waitCreateStackDialogClosing(); - - // close form by "Cancel" button - newWorkspace.clickOnAddStackButton(); - newWorkspace.waitCreateStackDialog(); - newWorkspace.clickOnNoButtonInCreateStackDialog(); - newWorkspace.waitCreateStackDialogClosing(); - } - - @Test(groups = TestGroup.OPENSHIFT) - public void checkOpenshiftSearchField() { - checkSearchField(EXPECTED_OPENSHIFT_JAVA_STACKS, EXPECTED_OPENSHIFT_QUICK_START_STACKS); - } - - @Test(groups = TestGroup.DOCKER) - public void checkDockerSearchField() { - checkSearchField(EXPECTED_DOCKER_JAVA_STACKS, EXPECTED_DOCKER_QUICK_START_STACKS); - } - - @Test - public void checkRamSelection() { - newWorkspace.waitPageLoad(); - - // empty RAM - newWorkspace.selectStack(JAVA); - newWorkspace.waitStackSelected(JAVA); - newWorkspace.waitRamValue(MACHINE_NAME, 2.0); - newWorkspace.typeToRamField(""); - newWorkspace.waitRedRamFieldBorders(); - newWorkspace.waitTopCreateWorkspaceButtonDisabled(); - newWorkspace.waitBottomCreateWorkspaceButtonDisabled(); - - // max valid value - newWorkspace.typeToRamField(Double.toString(MAX_RAM_VALUE)); - newWorkspace.waitRedRamFieldBordersDisappearance(); - newWorkspace.waitTopCreateWorkspaceButtonEnabled(); - newWorkspace.waitBottomCreateWorkspaceButtonEnabled(); - - // increment and decrement buttons with max valid value - newWorkspace.clickOnIncrementMemoryButton(MACHINE_NAME); - newWorkspace.waitRamValue(MACHINE_NAME, MAX_RAM_VALUE); - - newWorkspace.clickOnDecrementMemoryButton(MACHINE_NAME); - newWorkspace.waitRamValue(MACHINE_NAME, MAX_RAM_VALUE - RAM_CHANGE_STEP); - - // min valid value - newWorkspace.typeToRamField(""); - newWorkspace.waitRedRamFieldBorders(); - newWorkspace.waitTopCreateWorkspaceButtonDisabled(); - newWorkspace.waitBottomCreateWorkspaceButtonDisabled(); - - newWorkspace.typeToRamField(Double.toString(MIN_RAM_VALUE)); - newWorkspace.waitRedRamFieldBordersDisappearance(); - newWorkspace.waitTopCreateWorkspaceButtonEnabled(); - newWorkspace.waitBottomCreateWorkspaceButtonEnabled(); - - // increment and decrement buttons with min valid value - newWorkspace.clickOnDecrementMemoryButton(MACHINE_NAME); - newWorkspace.waitRamValue(MACHINE_NAME, MIN_RAM_VALUE); - newWorkspace.clickOnIncrementMemoryButton(MACHINE_NAME); - newWorkspace.waitRamValue(MACHINE_NAME, MIN_RAM_VALUE + RAM_CHANGE_STEP); - - // increment and decrement by click and hold - newWorkspace.clickAndHoldIncrementMemoryButton(MACHINE_NAME, 3); - newWorkspace.waitRamValueInSpecifiedRange(MACHINE_NAME, 3, MAX_RAM_VALUE); - - double currentRamAmount = newWorkspace.getRAM(MACHINE_NAME); - newWorkspace.clickAndHoldDecrementMemoryButton(MACHINE_NAME, 3); - newWorkspace.waitRamValueInSpecifiedRange(MACHINE_NAME, MIN_RAM_VALUE, currentRamAmount - 2); - } - - private void checkStackButtons( - List expectedQuickStartStacks, - List expectedSingleMachineStacks, - List expectedMultiMachineStacks, - List expectedQuickStartStacksReverseOrder) { - - newWorkspace.waitPageLoad(); - newWorkspace.waitQuickStartButton(); - newWorkspace.waitStacks(expectedQuickStartStacks); - newWorkspace.waitStacksCount(expectedQuickStartStacks.size()); - - // single machine stacks - newWorkspace.clickOnSingleMachineButton(); - newWorkspace.waitStacks(expectedSingleMachineStacks); - newWorkspace.waitStacksCount(expectedSingleMachineStacks.size()); - - // multi-machine stacks - newWorkspace.clickOnMultiMachineButton(); - newWorkspace.waitStacks(expectedMultiMachineStacks); - newWorkspace.waitStacksCount(expectedMultiMachineStacks.size()); - - // check that only expected stacks are displayed and no duplicates are presented and also checks - // "All" stacks - newWorkspace.clickOnAllButton(); - newWorkspace.waitStacks(expectedSingleMachineStacks); - newWorkspace.waitStacks(expectedMultiMachineStacks); - newWorkspace.waitStacksCount( - expectedSingleMachineStacks.size() + expectedMultiMachineStacks.size()); - - // quick start stacks - newWorkspace.clickOnQuickStartButton(); - newWorkspace.waitStacksOrder(expectedQuickStartStacks); - newWorkspace.clickNameButton(); - newWorkspace.waitStacksOrder(expectedQuickStartStacksReverseOrder); - - newWorkspace.clickNameButton(); - newWorkspace.waitStacksOrder(expectedQuickStartStacks); - } - - private void checkFiltersButton( - List expectedSuggestions, List expectedQuickStartStacks) { - newWorkspace.waitPageLoad(); - - // close by "Escape" button - newWorkspace.clickOnFiltersButton(); - newWorkspace.waitFiltersFormOpened(); - seleniumWebDriverHelper.sendKeys(ESCAPE.toString()); - newWorkspace.waitFiltersFormClosed(); - - // close by clicking on the outside of the "Filters" form - newWorkspace.clickOnFiltersButton(); - newWorkspace.waitFiltersFormOpened(); - newWorkspace.clickOnTitlePlaceCoordinate(); - newWorkspace.waitFiltersFormClosed(); - - // check suggestion list - newWorkspace.clickOnFiltersButton(); - newWorkspace.waitFiltersFormOpened(); - newWorkspace.typeToFiltersInput(LETTER_FOR_SEARCHING); - newWorkspace.waitFiltersSuggestionsNames(expectedSuggestions); - - assertEquals( - newWorkspace.getSelectedFiltersSuggestionName(), - newWorkspace.getFiltersSuggestionsNames().get(0)); - - // check navigation by keyboard arrows between suggested tags - seleniumWebDriverHelper.sendKeys(ARROW_DOWN.toString()); - newWorkspace.waitSelectedFiltersSuggestion(JDK_SUGGESTION_TITLE); - - seleniumWebDriverHelper.sendKeys(ARROW_UP.toString()); - newWorkspace.waitSelectedFiltersSuggestion(JAVA_SUGGESTION_TITLE); - - // interaction with suggested tads by mouse clicking - newWorkspace.clickOnFiltersSuggestions(JAVA_SUGGESTION_TITLE); - newWorkspace.waitSelectedFiltersSuggestion(JAVA_SUGGESTION_TITLE); - - newWorkspace.clickOnFiltersSuggestions(JDK_SUGGESTION_TITLE); - newWorkspace.waitSelectedFiltersSuggestion(JDK_SUGGESTION_TITLE); - - newWorkspace.doubleClickOnFiltersSuggestion(JDK_SUGGESTION_TITLE); - newWorkspace.waitFiltersInputTags(asList(JDK_SUGGESTION_TITLE)); - - newWorkspace.deleteLastTagFromInputTagsField(); - newWorkspace.waitFiltersInputIsEmpty(); - - // delete tags from input - newWorkspace.typeToFiltersInput(LETTER_FOR_SEARCHING); - newWorkspace.waitFiltersSuggestionsNames(expectedSuggestions); - - newWorkspace.waitSelectedFiltersSuggestion(JAVA_SUGGESTION_TITLE); - newWorkspace.doubleClickOnFiltersSuggestion(JAVA_SUGGESTION_TITLE); - newWorkspace.waitFiltersInputTags(asList(JAVA_SUGGESTION_TITLE)); - newWorkspace.deleteTagByRemoveButton(JAVA_SUGGESTION_TITLE); - newWorkspace.waitFiltersInputIsEmpty(); - - newWorkspace.typeToFiltersInput(LETTER_FOR_SEARCHING); - newWorkspace.waitFiltersSuggestionsNames(expectedSuggestions); - newWorkspace.waitSelectedFiltersSuggestion(JAVA_SUGGESTION_TITLE); - newWorkspace.chooseFilterSuggestionByPlusButton(JDK_SUGGESTION_TITLE); - newWorkspace.waitFiltersInputTags(asList(JDK_SUGGESTION_TITLE)); - newWorkspace.clickOnInputFieldTag(JDK_SUGGESTION_TITLE); - seleniumWebDriverHelper.sendKeys(Keys.DELETE.toString()); - newWorkspace.waitFiltersInputIsEmpty(); - - newWorkspace.typeToFiltersInput(LETTER_FOR_SEARCHING); - newWorkspace.waitFiltersSuggestionsNames(expectedSuggestions); - newWorkspace.waitSelectedFiltersSuggestion(JAVA_SUGGESTION_TITLE); - newWorkspace.chooseFilterSuggestionByPlusButton(JAVA_SUGGESTION_TITLE); - newWorkspace.waitFiltersInputTags(asList(JAVA_SUGGESTION_TITLE)); - newWorkspace.clickOnInputFieldTag(JAVA_SUGGESTION_TITLE); - seleniumWebDriverHelper.sendKeys(Keys.DELETE.toString()); - newWorkspace.waitFiltersInputIsEmpty(); - newWorkspace.deleteLastTagFromInputTagsField(); - - // navigation by "Tab" button - newWorkspace.typeToFiltersInput(LETTER_FOR_SEARCHING); - newWorkspace.waitSelectedFiltersSuggestion(JAVA_SUGGESTION_TITLE); - seleniumWebDriverHelper.sendKeys(Keys.TAB.toString()); - newWorkspace.waitSelectedFiltersSuggestion(JDK_SUGGESTION_TITLE); - seleniumWebDriverHelper.sendKeys(Keys.ENTER.toString()); - newWorkspace.waitFiltersInputTags(asList(JDK_SUGGESTION_TITLE)); - newWorkspace.clickOnTitlePlaceCoordinate(); - newWorkspace.waitFiltersFormClosed(); - - newWorkspace.getAvailableStacks(); - newWorkspace.waitStacks(EXPECTED_JDK_STACKS); - - newWorkspace.clickOnFiltersButton(); - newWorkspace.waitFiltersFormOpened(); - newWorkspace.waitFiltersInputTags(asList(JDK_SUGGESTION_TITLE)); - newWorkspace.deleteLastTagFromInputTagsField(); - newWorkspace.waitFiltersInputIsEmpty(); - newWorkspace.clickOnTitlePlaceCoordinate(); - newWorkspace.waitFiltersFormClosed(); - newWorkspace.waitStacks(expectedQuickStartStacks); - } - - private void checkSearchField( - List expectedJavaStacks, - List expectedQuickStartStacks) { - newWorkspace.waitPageLoad(); - - newWorkspace.typeToSearchInput("Java"); - newWorkspace.waitStacks(expectedJavaStacks); - - newWorkspace.typeToSearchInput(""); - newWorkspace.waitStacks(expectedQuickStartStacks); - - newWorkspace.typeToSearchInput("java"); - newWorkspace.waitStacks(expectedJavaStacks); - - newWorkspace.typeToSearchInput(""); - newWorkspace.waitStacks(expectedQuickStartStacks); - - newWorkspace.typeToSearchInput("JAVA"); - newWorkspace.waitStacks(expectedJavaStacks); - - newWorkspace.typeToSearchInput(""); - newWorkspace.waitStacks(expectedQuickStartStacks); - } - private void checkNotValidNames() { NOT_VALID_NAMES.forEach( name -> { diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/WorkspacesListTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/WorkspacesListTest.java index 704eb2d74e80..813078582591 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/WorkspacesListTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/WorkspacesListTest.java @@ -15,7 +15,6 @@ import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR; import static org.eclipse.che.selenium.core.project.ProjectTemplates.MAVEN_SPRING; import static org.eclipse.che.selenium.core.workspace.WorkspaceTemplate.UBUNTU_JDK8; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.BLANK; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; @@ -34,6 +33,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.DocumentationPage; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceConfig; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceOverview; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceProjects; @@ -339,7 +339,7 @@ public void checkWorkspaceActions() throws Exception { workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); newWorkspace.typeWorkspaceName(NEWEST_CREATED_WORKSPACE_NAME); - newWorkspace.selectStack(BLANK); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.clickOnCreateButtonAndEditWorkspace(); workspaceOverview.checkNameWorkspace(NEWEST_CREATED_WORKSPACE_NAME); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsComposeTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsComposeTest.java deleted file mode 100644 index d71be245d9be..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsComposeTest.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -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; -import org.eclipse.che.selenium.core.TestGroup; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.utils.WaitUtils; -import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.Loader; -import org.eclipse.che.selenium.pageobject.ToastLoader; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; -import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails; -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; - -/** @author Skoryk Serhii */ -@Test(groups = {TestGroup.DOCKER}) -public class WorkspaceDetailsComposeTest { - - private static final String WORKSPACE = generate("java-mysql", 4); - private static final ImmutableMap EXPECTED_VARIABLES = - ImmutableMap.of( - "MYSQL_DATABASE", "petclinic", - "MYSQL_PASSWORD", "password", - "MYSQL_ROOT_PASSWORD", "password", - "MYSQL_USER", "petclinic"); - - @Inject private DefaultTestUser testUser; - @Inject private Loader loader; - @Inject private NewWorkspace newWorkspace; - @Inject private Dashboard dashboard; - @Inject private WorkspaceDetails workspaceDetails; - @Inject private SeleniumWebDriverHelper seleniumWebDriverHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - @Inject private Consoles consoles; - @Inject private Workspaces workspaces; - @Inject private WorkspaceMachines workspaceMachines; - @Inject private WorkspaceEnvVariables workspaceEnvVariables; - @Inject private Ide ide; - @Inject private ToastLoader toastLoader; - - @BeforeClass - public void setUp() throws Exception { - createWsFromJavaMySqlStack(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE, testUser.getName()); - } - - @Test - public void workingWithEnvVariables() { - workspaceDetails.selectTabInWorkspaceMenu(ENV_VARIABLES); - - // create a new variable, save changes and check it exists - workspaceMachines.selectMachine("Environment variables", "dev-machine"); - createVariable("logi", "admin"); - clickOnSaveButton(); - assertTrue(workspaceEnvVariables.checkEnvVariableExists("logi")); - - // rename the variable, save changes and check it is renamed - assertTrue(workspaceEnvVariables.checkValueExists("logi", "admin")); - workspaceEnvVariables.clickOnEditEnvVariableButton("logi"); - workspaceEnvVariables.enterEnvVariableName("login"); - workspaceDetails.clickOnUpdateButtonInDialogWindow(); - clickOnSaveButton(); - assertTrue(workspaceEnvVariables.checkEnvVariableExists("login")); - assertTrue(workspaceEnvVariables.checkValueExists("login", "admin")); - - // delete the variable, save changes and check it is not exists - deleteVariable("login", "admin"); - clickOnSaveButton(); - workspaceEnvVariables.checkValueIsNotExists("login", "admin"); - - workspaceMachines.selectMachine("Environment variables", "db"); - // add variables to 'db' machine, check they exist and save changes - EXPECTED_VARIABLES.forEach( - (name, value) -> { - WaitUtils.sleepQuietly(1); - createVariable(name, value); - assertTrue(workspaceEnvVariables.checkEnvVariableExists(name)); - assertTrue(workspaceEnvVariables.checkValueExists(name, value)); - }); - clickOnSaveButton(); - - // delete all variables from the 'db' machine, check they don't exist and save changes - EXPECTED_VARIABLES.forEach( - (name, value) -> { - deleteVariable(name, value); - }); - - clickOnSaveButton(); - } - - @Test(groups = UNDER_REPAIR) - public void workingWithMachines() { - String machineName = "new_machine"; - - // check that all machines of the Java-MySql stack created by default exist - workspaceDetails.selectTabInWorkspaceMenu(MACHINES); - workspaceMachines.checkMachineExists("db"); - workspaceMachines.checkMachineExists("dev-machine"); - - // create a new machine, delete and check it is not exist - createMachine(machineName); - workspaceMachines.clickOnDeleteMachineButton(machineName); - workspaceDetails.clickOnCloseButtonInDialogWindow(); - WaitUtils.sleepQuietly(1); - workspaceMachines.clickOnDeleteMachineButton(machineName); - workspaceDetails.clickOnDeleteButtonInDialogWindow(); - workspaceMachines.checkMachineIsNotExists(machineName); - - // create a new machine, edit(change the name) and save changes - createMachine(machineName); - workspaceMachines.clickOnEditMachineButton(machineName); - workspaceMachines.checkEditTheMachineDialogIsOpen(); - workspaceMachines.setMachineNameInDialog("machine"); - WaitUtils.sleepQuietly(2); - workspaceMachines.clickOnSaveNameDialogButton(); - workspaceMachines.checkMachineExists("machine"); - clickOnSaveButton(); - workspaceMachines.checkMachineExists("machine"); - } - - @Test(priority = 1, groups = UNDER_REPAIR) - public void startWorkspaceAndCheckChanges() { - // check that created machine exists in the Process Console tree - workspaceDetails.clickOpenInIdeWsBtn(); - seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); - toastLoader.waitToastLoaderAndClickStartButton(); - ide.waitOpenedWorkspaceIsReadyToUse(); - consoles.waitProcessInProcessConsoleTree("machine"); - consoles.waitTabNameProcessIsPresent("machine"); - } - - private void clickOnSaveButton() { - workspaceDetails.clickOnSaveChangesBtn(); - dashboard.waitNotificationMessage("Workspace updated"); - dashboard.waitNotificationIsClosed(); - } - - private void createWsFromJavaMySqlStack() { - // create and start a workspace from the Java-MySql stack - dashboard.open(); - dashboard.waitDashboardToolbarTitle(); - dashboard.selectWorkspacesItemOnDashboard(); - dashboard.waitToolbarTitleName("Workspaces"); - workspaces.clickOnAddWorkspaceBtn(); - newWorkspace.waitToolbar(); - loader.waitOnClosed(); - newWorkspace.selectStack(JAVA_MYSQL); - newWorkspace.typeWorkspaceName(WORKSPACE); - newWorkspace.clickOnCreateButtonAndEditWorkspace(); - - workspaceDetails.waitToolbarTitleName(WORKSPACE); - workspaceDetails.checkStateOfWorkspace(STOPPED); - } - - 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(); - - 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) { - workspaceEnvVariables.clickOnAddEnvVariableButton(); - workspaceEnvVariables.checkAddNewEnvVarialbleDialogIsOpen(); - workspaceEnvVariables.addNewEnvironmentVariable(varName, varValue); - workspaceDetails.clickOnAddButtonInDialogWindow(); - } - - private void deleteVariable(String varName, String varValue) { - workspaceEnvVariables.clickOnDeleteEnvVariableButton(varName); - workspaceDetails.clickOnDeleteButtonInDialogWindow(); - workspaceEnvVariables.checkValueIsNotExists(varName, varValue); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsOverviewTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsOverviewTest.java index dbe1b146c12d..26454c8c0d87 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsOverviewTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsOverviewTest.java @@ -12,8 +12,6 @@ package org.eclipse.che.selenium.dashboard.workspaces.details; import static java.util.Arrays.asList; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ANDROID; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_CENTOS; import static org.openqa.selenium.Keys.ESCAPE; import com.google.inject.Inject; @@ -23,6 +21,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.AddOrImportForm; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceOverview; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.testng.annotations.Test; @@ -112,14 +111,12 @@ public void shouldCreateWorkspaceAndOpenOverviewPage() { workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitPageLoad(); newWorkspace.typeWorkspaceName(WORKSPACE_NAME); - newWorkspace.clickOnAllStacksTab(); - selectStackAndCheckWorkspaceName(ANDROID); + selectStackAndCheckWorkspaceName(Stack.APACHE_CAMEL); - selectStackAndCheckWorkspaceName(JAVA_CENTOS); + selectStackAndCheckWorkspaceName(Stack.JAVA_GRADLE); // create workspace - newWorkspace.setMachineRAM(MACHINE_NAME, 3.0); addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.addSampleToWorkspace(SAMPLE_NAME); newWorkspace.clickOnCreateButtonAndEditWorkspace(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginExistedUserWithOpenShiftOAuthTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginExistedUserWithOpenShiftOAuthTest.java index a40a7eff6ebd..2a836ee8a05d 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginExistedUserWithOpenShiftOAuthTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginExistedUserWithOpenShiftOAuthTest.java @@ -12,7 +12,6 @@ package org.eclipse.che.selenium.site.ocpoauth; import static java.lang.String.format; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.testng.Assert.assertEquals; import com.google.inject.Inject; @@ -30,6 +29,7 @@ import org.eclipse.che.selenium.pageobject.ToastLoader; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.eclipse.che.selenium.pageobject.ocp.AuthorizeOpenShiftAccessPage; import org.eclipse.che.selenium.pageobject.ocp.OpenShiftLoginPage; @@ -140,8 +140,7 @@ public void checkExistedCheUserOcpProjectCreationAndRemoval() throws Exception { dashboard.selectWorkspacesItemOnDashboard(); workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(WORKSPACE_NAME); newWorkspace.clickOnCreateButtonAndOpenInIDE(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginNewUserWithOpenShiftOAuthTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginNewUserWithOpenShiftOAuthTest.java index 93151a5ea9f8..a9db2c143b80 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginNewUserWithOpenShiftOAuthTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginNewUserWithOpenShiftOAuthTest.java @@ -11,8 +11,6 @@ */ package org.eclipse.che.selenium.site.ocpoauth; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; - import com.google.inject.Inject; import org.eclipse.che.api.core.BadRequestException; import org.eclipse.che.api.core.ConflictException; @@ -32,6 +30,7 @@ import org.eclipse.che.selenium.pageobject.ToastLoader; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.eclipse.che.selenium.pageobject.ocp.AuthorizeOpenShiftAccessPage; import org.eclipse.che.selenium.pageobject.ocp.OpenShiftLoginPage; @@ -127,8 +126,7 @@ public void checkNewCheUserOcpProjectCreationAndRemoval() { dashboard.selectWorkspacesItemOnDashboard(); workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(WORKSPACE_NAME); newWorkspace.clickOnCreateButtonAndOpenInIDE(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromAndroidStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromAndroidStackTest.java deleted file mode 100644 index d3396342080e..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromAndroidStackTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ANDROID; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromAndroidStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String MOBILE_ANDROID_HELLO_WORLD = "mobile-android-hello-world"; - private static final String MOBILE_ANDROID_SIMPLE = "mobile-android-simple"; - - private List projects = - ImmutableList.of(MOBILE_ANDROID_HELLO_WORLD, MOBILE_ANDROID_SIMPLE); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromAndroidStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects( - ANDROID, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(MOBILE_ANDROID_HELLO_WORLD); - projectExplorer.waitProjectInitialization(MOBILE_ANDROID_SIMPLE); - consoles.waitJDTLSProjectResolveFinishedMessage( - MOBILE_ANDROID_HELLO_WORLD, MOBILE_ANDROID_SIMPLE); - } - - @Test(priority = 1) - public void checkMobileAndroidHelloWorldProjectCommands() { - consoles.executeCommandFromProjectExplorer( - MOBILE_ANDROID_HELLO_WORLD, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - MOBILE_ANDROID_HELLO_WORLD, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(MOBILE_ANDROID_HELLO_WORLD), - BUILD_SUCCESS); - } - - @Test(priority = 1) - public void checkMobileAndroidSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - MOBILE_ANDROID_SIMPLE, - RUN_GOAL, - BUILD_COMMAND_ITEM.getItem(MOBILE_ANDROID_SIMPLE), - BUILD_SUCCESS); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromBlankStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromBlankStackTest.java deleted file mode 100644 index 0346caa02825..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromBlankStackTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.BLANK; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CodenvyEditor; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromBlankStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String PROJECT_NAME = "blank-project"; - - @Inject private Ide ide; - @Inject private Dashboard dashboard; - @Inject private CodenvyEditor editor; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromBlankStackTest() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - BLANK, WORKSPACE_NAME, PROJECT_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(PROJECT_NAME); - } - - @Test(priority = 1) - public void checkBlankProjectCommands() { - projectExplorer.openItemByPath(PROJECT_NAME); - projectExplorer.openItemByPath(PROJECT_NAME + "/README.md"); - editor.waitActive(); - editor.waitTabIsPresent("README.md"); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCamelStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCamelStackTest.java deleted file mode 100644 index 22530f821750..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCamelStackTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CAMEL_SPRINGBOOT; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class CreateWorkspaceFromCamelStackTest { - - private static final String WORKSPACE_NAME = generate("workspaceCamel", 4); - private static final String LS_INIT_MESSAGE = - "Initialized language server 'org.eclipse.che.plugin.camel.server.languageserver'"; - - @Inject private Ide ide; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - @Inject private Consoles consoles; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromCamelStackTest() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithoutProject( - CAMEL_SPRINGBOOT, WORKSPACE_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - consoles.selectProcessByTabName("dev-machine"); - consoles.waitExpectedTextIntoConsole(LS_INIT_MESSAGE); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosBlankStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosBlankStackTest.java deleted file mode 100644 index d3dd2656144e..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosBlankStackTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_BLANK; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CodenvyEditor; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromCentosBlankStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String PROJECT_NAME = "blank-project"; - - @Inject private Ide ide; - @Inject private Dashboard dashboard; - @Inject private CodenvyEditor editor; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromCentosBlankStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - CENTOS_BLANK, WORKSPACE_NAME, PROJECT_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(PROJECT_NAME); - } - - @Test(priority = 1) - public void checkBlankProjectCommands() { - projectExplorer.openItemByPath(PROJECT_NAME); - projectExplorer.openItemByPath(PROJECT_NAME + "/README.md"); - editor.waitActive(); - editor.waitTabIsPresent("README.md"); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosGoStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosGoStackTest.java deleted file mode 100644 index dfb1f6ec159d..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosGoStackTest.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_GO; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromCentosGoStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String DESKTOP_GO_PROJECT = "desktop-go-simple"; - private static final String WEB_GO_PROJECT = "web-go-simple"; - - private List projects = ImmutableList.of(DESKTOP_GO_PROJECT, WEB_GO_PROJECT); - private By textOnPreviewPage = By.xpath("//pre[contains(text(),'Hello there')]"); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromCentosGoStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects( - CENTOS_GO, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(DESKTOP_GO_PROJECT); - projectExplorer.waitProjectInitialization(WEB_GO_PROJECT); - } - - @Test(priority = 1) - public void checkDesktopGoSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - DESKTOP_GO_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(DESKTOP_GO_PROJECT), - "Hello, world. Sqrt(2) = 1.4142135623730951"); - } - - @Test(priority = 1) - public void checkWebGoSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - WEB_GO_PROJECT, RUN_GOAL, RUN_COMMAND, "listening on"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProjectExplorer( - WEB_GO_PROJECT, RUN_GOAL, RUN_COMMAND_ITEM.getItem(WEB_GO_PROJECT), "listening on"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(WEB_GO_PROJECT)); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosNodeStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosNodeStackTest.java deleted file mode 100644 index d1d57cc073f6..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosNodeStackTest.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -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.constant.TestIntelligentCommandsConstants.CommandItem.INSTALL_DEPENDENCIES_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_NODEJS; -import static org.testng.Assert.fail; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.openqa.selenium.TimeoutException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromCentosNodeStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String ANGULAR_PROJECT = "angular-patternfly-starter"; - private static final String NODE_JS_PROJECT = "nodejs-hello-world"; - private static final String WEB_NODE_JS_PROJECT = "web-nodejs-simple"; - - private List projects = - ImmutableList.of(ANGULAR_PROJECT, NODE_JS_PROJECT, WEB_NODE_JS_PROJECT); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromCentosNodeStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects( - CENTOS_NODEJS, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(ANGULAR_PROJECT); - projectExplorer.waitProjectInitialization(NODE_JS_PROJECT); - projectExplorer.waitProjectInitialization(WEB_NODE_JS_PROJECT); - } - - @Test(priority = 1, groups = UNDER_REPAIR) - public void checkAngularPatternfyStarterProjectCommands() { - By textOnPreviewPage = By.xpath("//span[text()='UNIFIED MANAGEMENT EXPERIENCE']"); - - try { - consoles.executeCommandFromProjectExplorer( - ANGULAR_PROJECT, - BUILD_GOAL, - INSTALL_DEPENDENCIES_COMMAND_ITEM.getItem(ANGULAR_PROJECT), - "bower_components/font-awesome"); - } catch (TimeoutException ex) { - // remove try-catch block after issue has been resolved - fail("Known permanent failure https://github.com/eclipse/che/issues/12259"); - } - - consoles.executeCommandFromProjectExplorer( - ANGULAR_PROJECT, RUN_GOAL, RUN_COMMAND_ITEM.getItem(ANGULAR_PROJECT), "Waiting..."); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(ANGULAR_PROJECT)); - } - - @Test(priority = 1) - public void checkNodejsHelloWorldProjectCommands() { - By textOnPreviewPage = By.xpath("//*[text()='Hello World!']"); - - consoles.executeCommandFromProjectExplorer( - NODE_JS_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(NODE_JS_PROJECT), - "Example app listening on port 3000!"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(NODE_JS_PROJECT)); - } - - @Test(priority = 1) - public void checkWebNodejsSimpleProjectCommands() { - By textOnPreviewPage = By.xpath("//p[text()=' from the Yeoman team']"); - - consoles.executeCommandFromProjectExplorer( - WEB_NODE_JS_PROJECT, - BUILD_GOAL, - INSTALL_DEPENDENCIES_COMMAND_ITEM.getItem(WEB_NODE_JS_PROJECT), - "bower_components/angular"); - - consoles.executeCommandFromProjectExplorer( - WEB_NODE_JS_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(WEB_NODE_JS_PROJECT), - "Started connect web server"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(WEB_NODE_JS_PROJECT)); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosWildFlySwarmStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosWildFlySwarmStackTest.java deleted file mode 100644 index 79ae8ce21506..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosWildFlySwarmStackTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_WILDFLY_SWARM; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromCentosWildFlySwarmStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String PROJECT_NAME = "wfswarm-rest-http"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromCentosWildFlySwarmStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - CENTOS_WILDFLY_SWARM, WORKSPACE_NAME, PROJECT_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(PROJECT_NAME); - - consoles.waitJDTLSProjectResolveFinishedMessage(PROJECT_NAME); - } - - @Test(priority = 1) - public void checkWfswarmRestHttpProjectCommands() { - By textOnPreviewPage = By.xpath("//h2[text()='Thorntail REST API Level 0 Example']"); - - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, RUN_GOAL, RUN_COMMAND, "Thorntail is Ready"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCeylonWithJavaStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCeylonWithJavaStackTest.java deleted file mode 100644 index 73b1cdb1c8e8..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCeylonWithJavaStackTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CEYLON_WITH_JAVA_JAVASCRIPT; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromCeylonWithJavaStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String PROJECT_NAME = "ceylon-hello-world"; - private static final String MODULE_COMPILED_MESSAGE = - "Note: Created module che.ceylon.samples.helloWorld"; - private static final String MODULE_STARTED_MESSAGE = - "Hello World from Ceylon on the following backend : "; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromCeylonWithJavaStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - CEYLON_WITH_JAVA_JAVASCRIPT, WORKSPACE_NAME, PROJECT_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(PROJECT_NAME); - } - - @Test(priority = 1) - public void checkCeylonHelloWorldProjectCommands() { - // compile and start project on JVM - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, BUILD_GOAL, "compile for JVM", MODULE_COMPILED_MESSAGE); - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, RUN_GOAL, "Run on JVM", MODULE_STARTED_MESSAGE + "jvm !"); - - // compile and start project on NodeJS - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, BUILD_GOAL, "compile for JS", MODULE_COMPILED_MESSAGE); - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, RUN_GOAL, "Run on NodeJS", MODULE_STARTED_MESSAGE + "js !"); - - // compile and start project on Dart - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, BUILD_GOAL, "compile for Dart", MODULE_COMPILED_MESSAGE); - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, RUN_GOAL, "Run on Dart", MODULE_STARTED_MESSAGE + "dartvm !"); - - // clean all created modules - projectExplorer.openItemByPath(PROJECT_NAME); - projectExplorer.waitVisibleItem(PROJECT_NAME + "/modules"); - projectExplorer.invokeCommandWithContextMenu(BUILD_GOAL, PROJECT_NAME, "clean module"); - projectExplorer.waitItemIsNotPresentVisibleArea(PROJECT_NAME + "/modules"); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCppStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCppStackTest.java deleted file mode 100644 index a3714d71c811..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCppStackTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_AND_RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CPP; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromCppStackTest { - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String CONSOLE_CPP_PROJECT = "console-cpp-simple"; - private static final String C_SIMPLE_CONSOLE_PROJECT = "c-simple-console"; - private static final String EXPECTED_MESSAGE_IN_CONSOLE = "Hello World"; - - private List projects = ImmutableList.of(CONSOLE_CPP_PROJECT, C_SIMPLE_CONSOLE_PROJECT); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromCppStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects(CPP, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(CONSOLE_CPP_PROJECT); - projectExplorer.waitProjectInitialization(C_SIMPLE_CONSOLE_PROJECT); - } - - @Test(priority = 1) - public void checkConsoleCppSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - CONSOLE_CPP_PROJECT, RUN_GOAL, RUN_COMMAND, EXPECTED_MESSAGE_IN_CONSOLE); - - consoles.executeCommandFromProjectExplorer( - CONSOLE_CPP_PROJECT, - RUN_GOAL, - BUILD_AND_RUN_COMMAND_ITEM.getItem(CONSOLE_CPP_PROJECT), - EXPECTED_MESSAGE_IN_CONSOLE); - } - - @Test(priority = 1) - public void checkCSimpleConsoleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - C_SIMPLE_CONSOLE_PROJECT, - RUN_GOAL, - BUILD_AND_RUN_COMMAND_ITEM.getItem(C_SIMPLE_CONSOLE_PROJECT), - EXPECTED_MESSAGE_IN_CONSOLE); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseCheStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseCheStackTest.java deleted file mode 100644 index 0dd11a64720c..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseCheStackTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.MAVEN_BUILD_AND_RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.MAVEN_BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ECLIPSE_CHE; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CheTerminal; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromEclipseCheStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String CONSOLE_JAVA_PROJECT = "console-java-simple"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CheTerminal terminal; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromJavaStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - ECLIPSE_CHE, WORKSPACE_NAME, CONSOLE_JAVA_PROJECT); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - consoles.waitJDTLSProjectResolveFinishedMessage(CONSOLE_JAVA_PROJECT); - - projectExplorer.waitProjectInitialization(CONSOLE_JAVA_PROJECT); - projectExplorer.waitProjectInitialization(CONSOLE_JAVA_PROJECT); - } - - @Test(priority = 1) - public void checkConsoleJavaSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, - BUILD_GOAL, - MAVEN_BUILD_COMMAND_ITEM.getItem(CONSOLE_JAVA_PROJECT), - BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, - RUN_GOAL, - MAVEN_BUILD_AND_RUN_COMMAND_ITEM.getItem(CONSOLE_JAVA_PROJECT), - "Hello World Che!"); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseVertxStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseVertxStackTest.java deleted file mode 100644 index e257b4eab341..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseVertxStackTest.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.DEBUG_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.DEBUG_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.LOADER_TIMEOUT_SEC; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ECLIPSE_VERTX; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.SeleniumWebDriver; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromEclipseVertxStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String HEALTH_CHECKS_BOOSTER_PROJECT = "vertx-health-checks-booster"; - private static final String HEALTH_HTTP_BOOSTER_PROJECT = "vertx-http-booster"; - - private List projects = - ImmutableList.of(HEALTH_CHECKS_BOOSTER_PROJECT, HEALTH_HTTP_BOOSTER_PROJECT); - private String currentWindow; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private SeleniumWebDriver seleniumWebDriver; - @Inject private SeleniumWebDriverHelper seleniumWebDriverHelper; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromEclipseVertxStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects( - ECLIPSE_VERTX, WORKSPACE_NAME, projects); - - currentWindow = ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(HEALTH_CHECKS_BOOSTER_PROJECT); - projectExplorer.waitProjectInitialization(HEALTH_HTTP_BOOSTER_PROJECT); - - consoles.waitJDTLSProjectResolveFinishedMessage( - HEALTH_CHECKS_BOOSTER_PROJECT, HEALTH_HTTP_BOOSTER_PROJECT); - } - - @Test(priority = 1) - public void checkVertxHealthChecksBoosterProjectCommands() { - By textOnPreviewPage = By.id("_vert_x_health_check_booster"); - - // build and run web application - consoles.executeCommandFromProjectExplorer( - HEALTH_CHECKS_BOOSTER_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - consoles.executeCommandFromProjectExplorer( - HEALTH_CHECKS_BOOSTER_PROJECT, - RUN_GOAL, - RUN_COMMAND, - "[INFO] INFO: Succeeded in deploying verticle"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProcessesArea( - "dev-machine", - DEBUG_GOAL, - DEBUG_COMMAND, - "[INFO] Listening for transport dt_socket at address: 5005"); - consoles.closeProcessTabWithAskDialog(DEBUG_COMMAND); - } - - @Test(priority = 2) - public void checkVertxHttpBoosterProjectCommands() { - By textOnPreviewPage = By.id("_http_booster"); - - // build and run web application - consoles.executeCommandFromProjectExplorer( - HEALTH_HTTP_BOOSTER_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - consoles.executeCommandFromProjectExplorer( - HEALTH_HTTP_BOOSTER_PROJECT, - RUN_GOAL, - RUN_COMMAND, - "[INFO] INFO: Succeeded in deploying verticle"); - - // refresh application web page and check visibility of web element on opened page - checkApplicationPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProcessesArea( - "dev-machine", - DEBUG_GOAL, - DEBUG_COMMAND, - "[INFO] Listening for transport dt_socket at address: 5005"); - consoles.closeProcessTabWithAskDialog(DEBUG_COMMAND); - } - - private void checkApplicationPage(By webElement) { - consoles.waitPreviewUrlIsPresent(); - consoles.waitPreviewUrlIsResponsive(10); - consoles.clickOnPreviewUrl(); - - seleniumWebDriverHelper.switchToNextWindow(currentWindow); - - seleniumWebDriver.navigate().refresh(); - seleniumWebDriverHelper.waitVisibility(webElement, LOADER_TIMEOUT_SEC); - - seleniumWebDriver.close(); - seleniumWebDriver.switchTo().window(currentWindow); - seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromGoStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromGoStackTest.java deleted file mode 100644 index b8a292f1fe22..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromGoStackTest.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.GO_DEFAULT; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromGoStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String DESKTOP_GO_PROJECT = "desktop-go-simple"; - private static final String WEB_GO_PROJECT = "web-go-simple"; - - private List projects = ImmutableList.of(DESKTOP_GO_PROJECT, WEB_GO_PROJECT); - private By textOnPreviewPage = By.xpath("//pre[contains(text(),'Hello there')]"); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromGoStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects( - GO_DEFAULT, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(DESKTOP_GO_PROJECT); - projectExplorer.waitProjectInitialization(WEB_GO_PROJECT); - } - - @Test(priority = 1) - public void checkDesktopGoSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - DESKTOP_GO_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(DESKTOP_GO_PROJECT), - "Hello, world. Sqrt(2) = 1.4142135623730951"); - } - - @Test(priority = 1) - public void checkWebGoSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - WEB_GO_PROJECT, RUN_GOAL, RUN_COMMAND, "listening on"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProjectExplorer( - WEB_GO_PROJECT, RUN_GOAL, RUN_COMMAND_ITEM.getItem(WEB_GO_PROJECT), "listening on"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(WEB_GO_PROJECT)); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaCentosStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaCentosStackTest.java deleted file mode 100644 index 08af5f452ce3..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaCentosStackTest.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.MAVEN_BUILD_AND_RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.MAVEN_BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_CENTOS; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CheTerminal; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromJavaCentosStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String CONSOLE_JAVA_PROJECT = "console-java-simple"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CheTerminal terminal; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromJavaCentosStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - JAVA_CENTOS, WORKSPACE_NAME, CONSOLE_JAVA_PROJECT); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(CONSOLE_JAVA_PROJECT); - - consoles.waitJDTLSProjectResolveFinishedMessage(CONSOLE_JAVA_PROJECT); - } - - @Test(priority = 1) - public void checkConsoleJavaSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, - BUILD_GOAL, - MAVEN_BUILD_COMMAND_ITEM.getItem(CONSOLE_JAVA_PROJECT), - BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, - RUN_GOAL, - MAVEN_BUILD_AND_RUN_COMMAND_ITEM.getItem(CONSOLE_JAVA_PROJECT), - "Hello World Che!"); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlCentosStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlCentosStackTest.java deleted file mode 100644 index e0cef5148d9d..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlCentosStackTest.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.LISTENING_AT_ADDRESS_8000; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_AND_DEPLOY_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.DEBUG_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.STOP_TOMCAT_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.COMMON_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.DEBUG_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL_CENTOS; -import static org.openqa.selenium.Keys.ENTER; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.TestGroup; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CheTerminal; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -@Test(groups = {TestGroup.DOCKER}) -public class CreateWorkspaceFromJavaMySqlCentosStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String WEB_JAVA_PROJECT = "web-java-petclinic"; - private static final String DEV_MACHINE_NAME = "dev-machine"; - private static final String DB_MACHINE_NAME = "db"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CheTerminal terminal; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromJavaMySqlCentosStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - JAVA_MYSQL_CENTOS, WORKSPACE_NAME, WEB_JAVA_PROJECT); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(WEB_JAVA_PROJECT); - } - - @Test(priority = 1) - public void checkWebJavaPetclinicProjectCommands() { - By textOnPreviewPage = By.xpath("//h2[text()='Welcome']"); - String tomcatIsRunning = "$TOMCAT_HOME/bin/catalina.sh"; - - projectExplorer.openItemByPath(WEB_JAVA_PROJECT); - - // Select the db machine and perform 'show databases' command - consoles.executeCommandFromProcessesArea( - DB_MACHINE_NAME, COMMON_GOAL, "show databases", "information_schema"); - - // Build and deploy the web application - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, COMMON_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, BUILD_GOAL, BUILD_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), BUILD_SUCCESS); - - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, - RUN_GOAL, - BUILD_AND_DEPLOY_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), - "Server startup in"); - - // Run the application - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - // execute 'stop tomcat' command and check that tomcat process is not running - projectExplorer.invokeCommandWithContextMenu( - RUN_GOAL, - WEB_JAVA_PROJECT, - STOP_TOMCAT_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), - DEV_MACHINE_NAME); - consoles.selectProcessInProcessConsoleTreeByName("Terminal"); - terminal.typeIntoActiveTerminal("ps ax"); - terminal.typeIntoActiveTerminal(ENTER.toString()); - terminal.waitNoTextInFirstTerminal(tomcatIsRunning); - - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, - DEBUG_GOAL, - DEBUG_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), - LISTENING_AT_ADDRESS_8000); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlStackTest.java deleted file mode 100644 index 02960d02741b..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlStackTest.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.LISTENING_AT_ADDRESS_8000; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_AND_DEPLOY_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.DEBUG_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.STOP_TOMCAT_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.COMMON_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.DEBUG_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL; -import static org.openqa.selenium.Keys.ENTER; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.TestGroup; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CheTerminal; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Aleksandr Shmaraev */ -@Test(groups = {TestGroup.DOCKER}) -public class CreateWorkspaceFromJavaMySqlStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String WEB_JAVA_PROJECT = "web-java-petclinic"; - private static final String DEV_MACHINE_NAME = "dev-machine"; - private static final String DB_MACHINE_NAME = "db"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CheTerminal terminal; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromJavaMySqlStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - JAVA_MYSQL, WORKSPACE_NAME, WEB_JAVA_PROJECT); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(WEB_JAVA_PROJECT); - } - - @Test(priority = 1) - public void checkWebJavaPetclinicProjectCommands() { - By textOnPreviewPage = By.xpath("//h2[text()='Welcome']"); - String tomcatIsRunning = "$TOMCAT_HOME/bin/catalina.sh"; - - projectExplorer.openItemByPath(WEB_JAVA_PROJECT); - - // Select the db machine and perform 'show databases' command - consoles.executeCommandFromProcessesArea( - DB_MACHINE_NAME, COMMON_GOAL, "show databases", "information_schema"); - - // Build and deploy the web application - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, BUILD_GOAL, BUILD_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), BUILD_SUCCESS); - - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, - RUN_GOAL, - BUILD_AND_DEPLOY_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), - "Server startup in"); - - // Run the application - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - // execute 'stop tomcat' command and check that tomcat process is not running - projectExplorer.invokeCommandWithContextMenu( - RUN_GOAL, - WEB_JAVA_PROJECT, - STOP_TOMCAT_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), - DEV_MACHINE_NAME); - consoles.selectProcessInProcessConsoleTreeByName("Terminal"); - terminal.typeIntoActiveTerminal("ps ax"); - terminal.typeIntoActiveTerminal(ENTER.toString()); - terminal.waitNoTextInFirstTerminal(tomcatIsRunning); - - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, - DEBUG_GOAL, - DEBUG_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), - LISTENING_AT_ADDRESS_8000); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaStackTest.java deleted file mode 100644 index 0e3b41aed36e..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaStackTest.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.LISTENING_AT_ADDRESS_8000; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.SERVER_STARTUP_IN; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_AND_RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.DEBUG_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.MAVEN_BUILD_AND_RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.MAVEN_BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_TOMCAT_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.STOP_TOMCAT_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.DEBUG_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; -import static org.openqa.selenium.Keys.ENTER; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CheTerminal; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromJavaStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String CONSOLE_JAVA_PROJECT = "console-java-simple"; - private static final String WEB_JAVA_SPRING_PROJECT = "web-java-spring"; - - private List projects = ImmutableList.of(CONSOLE_JAVA_PROJECT, WEB_JAVA_SPRING_PROJECT); - private By textOnPreviewPage = By.xpath("//span[text()='Enter your name: ']"); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CheTerminal terminal; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromJavaStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects(JAVA, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(CONSOLE_JAVA_PROJECT); - projectExplorer.waitProjectInitialization(WEB_JAVA_SPRING_PROJECT); - consoles.waitJDTLSProjectResolveFinishedMessage(CONSOLE_JAVA_PROJECT); - consoles.waitJDTLSProjectResolveFinishedMessage(WEB_JAVA_SPRING_PROJECT); - } - - @Test(priority = 1) - public void checkConsoleJavaSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, - BUILD_GOAL, - MAVEN_BUILD_COMMAND_ITEM.getItem(CONSOLE_JAVA_PROJECT), - BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, - RUN_GOAL, - MAVEN_BUILD_AND_RUN_COMMAND_ITEM.getItem(CONSOLE_JAVA_PROJECT), - "Hello World Che!"); - } - - @Test(priority = 2) - public void checkWebJavaSpringProjectCommands() { - String tomcatIsRunning = "/bin/bash -c $TOMCAT_HOME/bin/catalina.sh"; - - consoles.executeCommandFromProjectExplorer( - WEB_JAVA_SPRING_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - WEB_JAVA_SPRING_PROJECT, - BUILD_GOAL, - BUILD_COMMAND_ITEM.getItem(WEB_JAVA_SPRING_PROJECT), - BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - WEB_JAVA_SPRING_PROJECT, - RUN_GOAL, - BUILD_AND_RUN_COMMAND_ITEM.getItem(WEB_JAVA_SPRING_PROJECT), - SERVER_STARTUP_IN); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - consoles.closeProcessTabWithAskDialog( - BUILD_AND_RUN_COMMAND_ITEM.getItem(WEB_JAVA_SPRING_PROJECT)); - - consoles.executeCommandFromProjectExplorer( - WEB_JAVA_SPRING_PROJECT, - RUN_GOAL, - RUN_TOMCAT_COMMAND_ITEM.getItem(WEB_JAVA_SPRING_PROJECT), - SERVER_STARTUP_IN); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - // execute 'stop tomcat' command and check that tomcat process is not running - projectExplorer.invokeCommandWithContextMenu( - RUN_GOAL, - WEB_JAVA_SPRING_PROJECT, - STOP_TOMCAT_COMMAND_ITEM.getItem(WEB_JAVA_SPRING_PROJECT)); - consoles.selectProcessInProcessConsoleTreeByName("Terminal"); - terminal.typeIntoActiveTerminal("ps ax"); - terminal.typeIntoActiveTerminal(ENTER.toString()); - terminal.waitNoTextInFirstTerminal(tomcatIsRunning); - - consoles.executeCommandFromProjectExplorer( - WEB_JAVA_SPRING_PROJECT, - DEBUG_GOAL, - DEBUG_COMMAND_ITEM.getItem(WEB_JAVA_SPRING_PROJECT), - LISTENING_AT_ADDRESS_8000); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaDockerStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaDockerStackTest.java deleted file mode 100644 index 4f66f506c4e3..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaDockerStackTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -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.constant.TestTimeoutsConstants.PREPARING_WS_TIMEOUT_SEC; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_THEIA_DOCKER; -import static org.testng.Assert.fail; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.TestGroup; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.eclipse.che.selenium.pageobject.theia.TheiaIde; -import org.openqa.selenium.By; -import org.openqa.selenium.TimeoutException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -@Test(groups = {TestGroup.DOCKER, UNDER_REPAIR}) -public class CreateWorkspaceFromJavaTheiaDockerStackTest { - private static final String WORKSPACE_NAME = generate("workspace", 4); - - @Inject private TheiaIde theiaIde; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private SeleniumWebDriverHelper seleniumWebDriverHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromJavaTheiaDockerStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithoutProject( - JAVA_THEIA_DOCKER, WORKSPACE_NAME); - - seleniumWebDriverHelper.waitAndSwitchToFrame( - By.id("ide-application-iframe"), PREPARING_WS_TIMEOUT_SEC); - - // wait Theia is ready to use - try { - theiaIde.waitTheiaIde(); - } catch (TimeoutException ex) { - // remove try-catch block after issue has been resolved - fail("Known permanent failure https://github.com/eclipse/che/issues/12218"); - } - - theiaIde.waitTheiaIdeTopPanel(); - theiaIde.waitLoaderInvisibility(); - theiaIde.waitNotificationPanelClosed(); - - // run 'About' command from 'Help' menu - theiaIde.runMenuCommand("Help", "About"); - - // wait 'About' dialog, check its content and close - theiaIde.waitAboutDialogIsOpen(); - theiaIde.waitAboutDialogContains("List of extensions"); - theiaIde.closeAboutDialog(); - theiaIde.waitAboutDialogIsClosed(); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaOpenshiftStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaOpenshiftStackTest.java deleted file mode 100644 index e2160ea7a477..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaOpenshiftStackTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -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.constant.TestTimeoutsConstants.APPLICATION_START_TIMEOUT_SEC; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_THEIA_OPENSHIFT; -import static org.testng.Assert.fail; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.TestGroup; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.eclipse.che.selenium.pageobject.theia.TheiaIde; -import org.openqa.selenium.By; -import org.openqa.selenium.TimeoutException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -@Test(groups = {TestGroup.OPENSHIFT, UNDER_REPAIR}) -public class CreateWorkspaceFromJavaTheiaOpenshiftStackTest { - private static final String WORKSPACE_NAME = generate("workspace", 4); - - @Inject private TheiaIde theiaIde; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private SeleniumWebDriverHelper seleniumWebDriverHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromJavaTheiaOpenshiftStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithoutProject( - JAVA_THEIA_OPENSHIFT, WORKSPACE_NAME); - - seleniumWebDriverHelper.waitAndSwitchToFrame( - By.id("ide-application-iframe"), APPLICATION_START_TIMEOUT_SEC); - - // wait Theia is ready to use - try { - theiaIde.waitTheiaIde(); - } catch (TimeoutException ex) { - // remove try-catch block after issue has been resolved - fail("Known permanent failure https://github.com/eclipse/che/issues/12218"); - } - - theiaIde.waitTheiaIdeTopPanel(); - theiaIde.waitLoaderInvisibility(); - theiaIde.waitNotificationPanelClosed(); - - // run 'About' command from 'Help' menu - theiaIde.runMenuCommand("Help", "About"); - - // wait 'About' dialog, check its content and close - theiaIde.waitAboutDialogIsOpen(); - theiaIde.waitAboutDialogContains("List of extensions"); - theiaIde.closeAboutDialog(); - theiaIde.waitAboutDialogIsClosed(); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromKotlinStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromKotlinStackTest.java deleted file mode 100644 index 97daf658a311..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromKotlinStackTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.KOTLIN; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromKotlinStackTest { - private static final String WORKSPACE_NAME = generate("workspace", 4); - - @Inject private Ide ide; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromKotlinStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithoutProject(KOTLIN, WORKSPACE_NAME); - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNETStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNETStackTest.java deleted file mode 100644 index da48d8ad260f..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNETStackTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.UPDATE_DEPENDENCIES_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.UPDATE_DEPENDENCIES_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.DOT_NET_DEFAULT; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromNETStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String PROJECT_NAME = "dotnet-web-simple"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromNETStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - DOT_NET_DEFAULT, WORKSPACE_NAME, PROJECT_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(PROJECT_NAME); - } - - @Test(priority = 1) - public void checkDotnetWebSimpleProjectCommands() { - By textOnPreviewPage = By.xpath("//pre[text()='Hello World!']"); - - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, BUILD_GOAL, UPDATE_DEPENDENCIES_COMMAND, "Restore completed"); - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, - BUILD_GOAL, - UPDATE_DEPENDENCIES_COMMAND_ITEM.getItem(PROJECT_NAME), - "Restore completed"); - - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, RUN_GOAL, RUN_COMMAND, "Application started."); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - consoles.closeProcessTabWithAskDialog("run"); - - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, RUN_GOAL, RUN_COMMAND_ITEM.getItem(PROJECT_NAME), "Application started."); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNodeStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNodeStackTest.java deleted file mode 100644 index 67f61bcaa4e4..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNodeStackTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.TestGroup.FLAKY; -import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.INSTALL_DEPENDENCIES_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.NODE; -import static org.testng.Assert.fail; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.SeleniumWebDriver; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.openqa.selenium.TimeoutException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromNodeStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String ANGULAR_PROJECT = "angular-patternfly-starter"; - private static final String NODE_JS_PROJECT = "nodejs-hello-world"; - private static final String WEB_NODE_JS_PROJECT = "web-nodejs-simple"; - - private List projects = - ImmutableList.of(ANGULAR_PROJECT, NODE_JS_PROJECT, WEB_NODE_JS_PROJECT); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private SeleniumWebDriver seleniumWebDriver; - @Inject private SeleniumWebDriverHelper seleniumWebDriverHelper; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromNodeStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects(NODE, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(ANGULAR_PROJECT); - projectExplorer.waitProjectInitialization(NODE_JS_PROJECT); - projectExplorer.waitProjectInitialization(WEB_NODE_JS_PROJECT); - } - - @Test(priority = 1, groups = UNDER_REPAIR) - public void checkAngularPatternfyStarterProjectCommands() { - By textOnPreviewPage = By.xpath("//span[text()='UNIFIED MANAGEMENT EXPERIENCE']"); - - try { - consoles.executeCommandFromProjectExplorer( - ANGULAR_PROJECT, - BUILD_GOAL, - INSTALL_DEPENDENCIES_COMMAND_ITEM.getItem(ANGULAR_PROJECT), - "bower_components/font-awesome"); - } catch (TimeoutException ex) { - // remove try-catch block after issue has been resolved - fail("Known permanent failure https://github.com/eclipse/che/issues/12259"); - } - - consoles.executeCommandFromProjectExplorer( - ANGULAR_PROJECT, RUN_GOAL, RUN_COMMAND_ITEM.getItem(ANGULAR_PROJECT), "Waiting..."); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(ANGULAR_PROJECT)); - } - - @Test(priority = 1) - public void checkNodejsHelloWorldProjectCommands() { - By textOnPreviewPage = By.xpath("//*[text()='Hello World!']"); - - consoles.executeCommandFromProjectExplorer( - NODE_JS_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(NODE_JS_PROJECT), - "Example app listening on port 3000!"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(NODE_JS_PROJECT)); - } - - @Test(priority = 1, groups = FLAKY) - public void checkWebNodejsSimpleProjectCommands() { - By textOnPreviewPage = By.xpath("//p[text()=' from the Yeoman team']"); - - projectExplorer.waitAndSelectItem(WEB_NODE_JS_PROJECT); - consoles.executeCommandInsideProcessesArea( - "dev-machine", - BUILD_GOAL, - INSTALL_DEPENDENCIES_COMMAND_ITEM.getItem(WEB_NODE_JS_PROJECT), - "bower_components/angular"); - - consoles.executeCommandInsideProcessesArea( - "dev-machine", - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(WEB_NODE_JS_PROJECT), - "Started connect web server"); - - // Check the preview url is present after refreshing - consoles.waitPreviewUrlIsPresent(); - seleniumWebDriver.navigate().refresh(); - seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); - ide.waitOpenedWorkspaceIsReadyToUse(); - - try { - consoles.waitPreviewUrlIsPresent(); - } catch (TimeoutException ex) { - fail("Known random failure https://github.com/eclipse/che/issues/11419", ex); - } - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(WEB_NODE_JS_PROJECT)); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPHPStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPHPStackTest.java deleted file mode 100644 index d72464bce4ba..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPHPStackTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RESTART_APACHE_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.START_APACHE_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.STOP_APACHE_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PHP; -import static org.openqa.selenium.Keys.ENTER; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CheTerminal; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromPHPStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String WEB_PHP_PROJECT = "web-php-simple"; - private static final String WEB_PHP_GAE_PROJECT = "web-php-gae-simple"; - private static final String PHP_FILE_NAME = "index.php"; - - private List projects = ImmutableList.of(WEB_PHP_PROJECT, WEB_PHP_GAE_PROJECT); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CheTerminal terminal; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromPHPStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects(PHP, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(WEB_PHP_PROJECT); - projectExplorer.waitProjectInitialization(WEB_PHP_GAE_PROJECT); - } - - @Test(priority = 1) - public void checkWebPhpSimpleCommands() { - By textOnPreviewPage = By.xpath("//*[text()='Hello World!']"); - String apacheIsRunning = "/usr/sbin/apache2 -k start"; - - projectExplorer.openItemByPath(WEB_PHP_PROJECT); - projectExplorer.openItemByPath(WEB_PHP_PROJECT + "/" + PHP_FILE_NAME); - - consoles.executeCommandFromProjectExplorer( - WEB_PHP_PROJECT, RUN_GOAL, "run php script", "Hello World!"); - - consoles.executeCommandFromProjectExplorer( - WEB_PHP_PROJECT, - RUN_GOAL, - START_APACHE_COMMAND, - "Starting Apache httpd web server apache2"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.executeCommandFromProjectExplorer( - WEB_PHP_PROJECT, RUN_GOAL, RESTART_APACHE_COMMAND, "...done"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - // start 'stop apache' command and check that apache not running - consoles.executeCommandFromProjectExplorer( - WEB_PHP_PROJECT, RUN_GOAL, STOP_APACHE_COMMAND, "Stopping Apache httpd web server apache2"); - consoles.selectProcessInProcessConsoleTreeByName("Terminal"); - terminal.typeIntoActiveTerminal("ps ax"); - terminal.typeIntoActiveTerminal(ENTER.toString()); - terminal.waitNoTextInFirstTerminal(apacheIsRunning); - } - - @Test(priority = 1) - public void checkWebPhpGaeSimpleCommands() { - By textOnPreviewPage = By.xpath("//input[@value='Sign Guestbook']"); - - consoles.executeCommandFromProjectExplorer( - WEB_PHP_GAE_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(WEB_PHP_GAE_PROJECT), - "Starting admin server"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(WEB_PHP_GAE_PROJECT)); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPythonStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPythonStackTest.java deleted file mode 100644 index 59691591934b..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPythonStackTest.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.ELEMENT_TIMEOUT_SEC; -import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.WIDGET_TIMEOUT_SEC; -import static org.eclipse.che.selenium.pageobject.ProjectExplorer.FolderTypes.PROJECT_FOLDER; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PYTHON_DEFAULT; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CodenvyEditor; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.MavenPluginStatusBar; -import org.eclipse.che.selenium.pageobject.NotificationsPopupPanel; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.ToastLoader; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; -import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; -import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromPythonStackTest { - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String PROJECT_NAME = "console-python3-simple"; - private static final String PYTHON_FILE_NAME = "main.py"; - private static final String LS_INIT_MESSAGE = - "Initialized language server 'org.eclipse.che.plugin.python.languageserver"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CodenvyEditor editor; - @Inject private Workspaces workspaces; - @Inject private ToastLoader toastLoader; - @Inject private NewWorkspace newWorkspace; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private ProjectSourcePage projectSourcePage; - @Inject private MavenPluginStatusBar mavenPluginStatusBar; - @Inject private NotificationsPopupPanel notificationsPopupPanel; - @Inject private SeleniumWebDriverHelper seleniumWebDriverHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromPythonStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - PYTHON_DEFAULT, WORKSPACE_NAME, PROJECT_NAME); - - switchToIdeAndWaitWorkspaceIsReadyToUse(); - - waitProjectInitialization(PROJECT_NAME); - - startCommandAndCheckMessageInTerminal(PROJECT_NAME, RUN_GOAL, "run", "Hello, world!"); - startCommandAndCheckMessageInTerminal( - PROJECT_NAME, RUN_GOAL, "console-python3-simple:run", "Hello, world!"); - - checkLanguageServerInitialization(PROJECT_NAME, PYTHON_FILE_NAME, LS_INIT_MESSAGE); - } - - private void switchToIdeAndWaitWorkspaceIsReadyToUse() { - seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); - toastLoader.waitToastLoaderAndClickStartButton(); - ide.waitOpenedWorkspaceIsReadyToUse(); - } - - private void waitProjectInitialization(String projectName) { - projectExplorer.waitItem(projectName); - notificationsPopupPanel.waitPopupPanelsAreClosed(); - mavenPluginStatusBar.waitClosingInfoPanel(); - projectExplorer.waitDefinedTypeOfFolder(projectName, PROJECT_FOLDER); - notificationsPopupPanel.waitPopupPanelsAreClosed(); - } - - private void startCommandAndCheckMessageInTerminal( - String projectName, - ContextMenuCommandGoals commandsGoal, - String commandName, - String expectedMessage) { - projectExplorer.waitAndSelectItem(projectName); - projectExplorer.invokeCommandWithContextMenu(commandsGoal, projectName, commandName); - consoles.waitTabNameProcessIsPresent(commandName); - consoles.waitProcessInProcessConsoleTree(commandName); - consoles.waitExpectedTextIntoConsole(expectedMessage, WIDGET_TIMEOUT_SEC); - } - - private void checkLanguageServerInitialization( - String projectName, String fileName, String textInTerminal) { - projectExplorer.waitAndSelectItem(projectName); - projectExplorer.openItemByPath(projectName); - projectExplorer.openItemByPath(projectName + "/" + fileName); - editor.waitTabIsPresent(fileName); - - // check a language server initialized - consoles.selectProcessByTabName("dev-machine"); - consoles.waitExpectedTextIntoConsole(textInTerminal, ELEMENT_TIMEOUT_SEC); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromRailsStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromRailsStackTest.java deleted file mode 100644 index 25a623ca3bed..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromRailsStackTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.INSTALL_DEPENDENCIES_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.INSTALL_DEPENDENCIES_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.RAILS; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromRailsStackTest { - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String CONSOLE_RUBY_PROJECT = "console-ruby-simple"; - private static final String WEB_RAILS_PROJECT = "web-rails-simple"; - - private List projects = ImmutableList.of(CONSOLE_RUBY_PROJECT, WEB_RAILS_PROJECT); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromRailsStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects(RAILS, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(CONSOLE_RUBY_PROJECT); - projectExplorer.waitProjectInitialization(WEB_RAILS_PROJECT); - } - - @Test(priority = 1) - public void checkConsoleRubySimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - CONSOLE_RUBY_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(CONSOLE_RUBY_PROJECT), - "Hello world!"); - } - - @Test(priority = 1) - public void checkWebRailsSimpleProjectCommands() { - By textOnPreviewPage = By.xpath("//h1[text()='Yay! You’re on Rails!']"); - - consoles.executeCommandFromProjectExplorer( - WEB_RAILS_PROJECT, BUILD_GOAL, INSTALL_DEPENDENCIES_COMMAND, "Bundle complete!"); - consoles.executeCommandFromProjectExplorer( - WEB_RAILS_PROJECT, - BUILD_GOAL, - INSTALL_DEPENDENCIES_COMMAND_ITEM.getItem(WEB_RAILS_PROJECT), - "Bundle complete!"); - - consoles.executeCommandFromProjectExplorer( - WEB_RAILS_PROJECT, RUN_GOAL, RUN_COMMAND, "* Listening on"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProjectExplorer( - WEB_RAILS_PROJECT, RUN_GOAL, RUN_COMMAND_ITEM.getItem(WEB_RAILS_PROJECT), "* Listening on"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromSpringBootStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromSpringBootStackTest.java deleted file mode 100644 index 0aeb63101bab..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromSpringBootStackTest.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.LISTENING_AT_ADDRESS; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.CLEAN_BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.DEBUG_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.DEBUG_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.SPRING_BOOT; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromSpringBootStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String SPRING_BOOT_HEALTH_CHECK_PROJECT = "spring-boot-health-check-booster"; - private static final String SPRING_BOOT_HTTP_PROJECT = "spring-boot-http-booster"; - - private List projects = - ImmutableList.of(SPRING_BOOT_HEALTH_CHECK_PROJECT, SPRING_BOOT_HTTP_PROJECT); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromSpringBootStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects( - SPRING_BOOT, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(SPRING_BOOT_HEALTH_CHECK_PROJECT); - projectExplorer.waitProjectInitialization(SPRING_BOOT_HTTP_PROJECT); - - consoles.waitJDTLSProjectResolveFinishedMessage( - SPRING_BOOT_HEALTH_CHECK_PROJECT, SPRING_BOOT_HTTP_PROJECT); - } - - @Test(priority = 1) - public void checkSpringBootHealthCheckBoosterProjectCommands() { - By textOnPreviewPage = By.xpath("//h2[text()='Health Check Booster']"); - - // build and run 'spring-boot-health-check-booster' project - consoles.executeCommandFromProjectExplorer( - SPRING_BOOT_HEALTH_CHECK_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - SPRING_BOOT_HEALTH_CHECK_PROJECT, BUILD_GOAL, CLEAN_BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - SPRING_BOOT_HEALTH_CHECK_PROJECT, RUN_GOAL, RUN_COMMAND, "Started BoosterApplication in"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProcessesArea( - "dev-machine", DEBUG_GOAL, DEBUG_COMMAND, LISTENING_AT_ADDRESS); - consoles.closeProcessTabWithAskDialog(DEBUG_COMMAND); - } - - @Test(priority = 1) - public void checkSpringBooHttpBoosterProjectCommands() { - By textOnPreviewPage = By.xpath("//h2[text()='HTTP Booster']"); - - // build and run 'spring-boot-http-booster' project - consoles.executeCommandFromProjectExplorer( - SPRING_BOOT_HTTP_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - SPRING_BOOT_HTTP_PROJECT, BUILD_GOAL, CLEAN_BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - SPRING_BOOT_HTTP_PROJECT, - RUN_GOAL, - RUN_COMMAND, - "INFO: Setting the server's publish address to be"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProcessesArea( - "dev-machine", DEBUG_GOAL, DEBUG_COMMAND, LISTENING_AT_ADDRESS); - consoles.closeProcessTabWithAskDialog(DEBUG_COMMAND); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/ImportAndValidateEclipseCheProjectTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/ImportAndValidateEclipseCheProjectTest.java deleted file mode 100644 index e2929b013fe9..000000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/ImportAndValidateEclipseCheProjectTest.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -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.constant.TestMenuCommandsConstants.Workspace.IMPORT_PROJECT; -import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Workspace.WORKSPACE; -import static org.eclipse.che.selenium.pageobject.CodenvyEditor.MarkerLocator.ERROR; -import static org.eclipse.che.selenium.pageobject.Wizard.TypeProject.MAVEN; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ECLIPSE_CHE; -import static org.openqa.selenium.Keys.DELETE; -import static org.openqa.selenium.Keys.ESCAPE; -import static org.testng.Assert.fail; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CodenvyEditor; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ImportProjectFromLocation; -import org.eclipse.che.selenium.pageobject.InformationDialog; -import org.eclipse.che.selenium.pageobject.Loader; -import org.eclipse.che.selenium.pageobject.MavenPluginStatusBar; -import org.eclipse.che.selenium.pageobject.Menu; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.Wizard; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.TimeoutException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Aleksandr Shmaraev */ -@Test(groups = UNDER_REPAIR) -public class ImportAndValidateEclipseCheProjectTest { - - private static final Logger LOG = - LoggerFactory.getLogger(ImportAndValidateEclipseCheProjectTest.class); - private static final String WORKSPACE_NAME = generate("EclipseCheWs", 4); - private static final String PROJECT_NAME = "eclipse-che"; - private static final String PACKAGE_NAME = "org.eclipse.che.selenium.pageobject"; - private static final String ECLIPSE_CHE_PROJECT_URL = "https://github.com/eclipse/che.git"; - private static final String PATH_TO_JAVA_FILE = - PROJECT_NAME - + "/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/CodenvyEditor.java"; - private static final String PATH_TO_POM_FILE = PROJECT_NAME + "/dashboard/pom.xml"; - private static final String PATH_TO_TS_FILE = PROJECT_NAME + "/dashboard/src/app/index.module.ts"; - - @Inject private Ide ide; - @Inject private Menu menu; - @Inject private ImportProjectFromLocation importProject; - @Inject private Loader loader; - @Inject private Consoles consoles; - @Inject private ProjectExplorer projectExplorer; - @Inject private Wizard projectWizard; - @Inject private MavenPluginStatusBar mavenPluginStatusBar; - @Inject private InformationDialog informationDialog; - @Inject private CodenvyEditor editor; - @Inject private Dashboard dashboard; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - @Inject private DefaultTestUser defaultTestUser; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void prepare() { - dashboard.open(); - - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithoutProject(ECLIPSE_CHE, WORKSPACE_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - ide.waitOpenedWorkspaceIsReadyToUse(); - consoles.waitJDTLSStartedMessage(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkImportAndResolveDependenciesEclipseCheProject() { - final int timeoutToOpenInfoPanelInSec = 500; - final int timeoutToClosingInfoPanelInSec = 1200; - - // import the eclipse-che project - projectExplorer.waitProjectExplorer(); - menu.runCommand(WORKSPACE, IMPORT_PROJECT); - importProject.waitAndTypeImporterAsGitInfo(ECLIPSE_CHE_PROJECT_URL, PROJECT_NAME); - - // config the project - projectWizard.waitCreateProjectWizardForm(); - projectWizard.selectTypeProject(MAVEN); - projectWizard.clickSaveButton(); - loader.waitOnClosed(); - projectWizard.waitCreateProjectWizardFormIsClosed(); - loader.waitOnClosed(); - - // waits on project resolving message - consoles.waitJDTLSProjectResolveFinishedMessage(PROJECT_NAME); - - // waits while the 'Import Maven project(s)' info bar is closed - mavenPluginStatusBar.waitClosingInfoPanel(timeoutToClosingInfoPanelInSec); - - // expand the project - projectExplorer.waitItem(PROJECT_NAME); - projectExplorer.openItemByPath(PROJECT_NAME); - loader.waitOnClosed(); - - // waits the text in the progress info bar - loader.waitOnClosed(); - mavenPluginStatusBar.waitExpectedTextInInfoPanel( - "Building workspace", timeoutToOpenInfoPanelInSec); - - // should close the progress monitor form by Esc - mavenPluginStatusBar.clickOnInfoPanel(); - mavenPluginStatusBar.waitProgressMonitorFormToOpen(); - mavenPluginStatusBar.closeProgressMonitorFormByKeys(ESCAPE.toString()); - - // then open it again - mavenPluginStatusBar.clickOnInfoPanel(); - mavenPluginStatusBar.waitProgressMonitorFormToOpen(); - - // wait while progress info is closed - mavenPluginStatusBar.waitClosingInfoPanel(timeoutToClosingInfoPanelInSec); - mavenPluginStatusBar.waitProgressMonitorFormToClose(); - - // then open files - // open a java file - quickRevealToItemWithJavaScriptAndOpenFile(PATH_TO_JAVA_FILE); - editor.waitActive(); - - // checks packages in project Explorer - try { - projectExplorer.waitVisibilityByName(PACKAGE_NAME); - } catch (TimeoutException ex) { - // remove try-catch block after issue has been resolved - fail("Known permanent failure https://github.com/eclipse/che/issues/11537"); - } - - // open a xml file - quickRevealToItemWithJavaScriptAndOpenFile(PATH_TO_POM_FILE); - editor.waitActive(); - - // open a ts file - quickRevealToItemWithJavaScriptAndOpenFile(PATH_TO_TS_FILE); - editor.waitActive(); - - // wait the project and the files - projectExplorer.waitItem(PROJECT_NAME); - editor.waitTabIsPresent("CodenvyEditor"); - editor.waitTabIsPresent("che-dashboard-war"); - editor.waitTabIsPresent("index.module.ts"); - } - - @Test(priority = 1) - public void checkErrorMarkersInEditor() { - // check an error marker in the pom.xml file - projectExplorer.openItemByPath(PATH_TO_POM_FILE); - editor.waitActive(); - editor.waitAllMarkersInvisibility(ERROR); - editor.typeTextIntoEditor("q"); - editor.goToPosition(1, 1); - editor.waitMarkerInPosition(ERROR, 1); - editor.typeTextIntoEditor(DELETE.toString()); - editor.waitMarkerInvisibility(ERROR, 1); - - // check error marker in the java file - projectExplorer.openItemByPath(PATH_TO_JAVA_FILE); - editor.waitActive(); - editor.waitAllMarkersInvisibility(ERROR); - editor.setCursorToLine(12); - editor.typeTextIntoEditor("q"); - editor.goToPosition(12, 1); - editor.waitMarkerInPosition(ERROR, 12); - editor.typeTextIntoEditor(DELETE.toString()); - editor.waitMarkerInvisibility(ERROR, 12); - - // check error marker in the ts file - projectExplorer.openItemByPath(PATH_TO_TS_FILE); - editor.waitActive(); - editor.typeTextIntoEditor("q"); - editor.waitMarkerInPosition(ERROR, 1); - } - - private void quickRevealToItemWithJavaScriptAndOpenFile(String pathToItem) { - projectExplorer.quickRevealToItemWithJavaScript(pathToItem); - projectExplorer.openItemByPath(pathToItem); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/Che7PreviewStackStartTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/Che7PreviewStackStartTest.java index 4b4e4a060c1d..fbb68a05f577 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/Che7PreviewStackStartTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/Che7PreviewStackStartTest.java @@ -12,7 +12,6 @@ package org.eclipse.che.selenium.theia; import static org.eclipse.che.selenium.core.TestGroup.OPENSHIFT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CHE_7_PREVIEW; import com.google.inject.Inject; import org.eclipse.che.commons.lang.NameGenerator; @@ -20,6 +19,7 @@ import org.eclipse.che.selenium.core.user.DefaultTestUser; import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.theia.TheiaIde; import org.eclipse.che.selenium.pageobject.theia.TheiaProjectTree; import org.testng.annotations.AfterClass; @@ -43,7 +43,7 @@ public void tearDown() throws Exception { @Test(groups = {OPENSHIFT}) public void workspaceShouldBeStarted() { dashboard.open(); - createWorkspaceHelper.createWorkspaceFromStackWithoutProject(CHE_7_PREVIEW, WORKSPACE_NAME); + createWorkspaceHelper.createWorkspaceFromStackWithoutProject(Stack.GO, WORKSPACE_NAME); theiaIde.switchToIdeFrame(); theiaIde.waitTheiaIde(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/TheiaBuildPluginTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/TheiaBuildPluginTest.java index 0b6ae9daab54..9b6475ebecb1 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/TheiaBuildPluginTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/TheiaBuildPluginTest.java @@ -15,7 +15,6 @@ import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR; import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.LOADER_TIMEOUT_SEC; import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.UPDATING_PROJECT_TIMEOUT_SEC; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CHE_7_PREVIEW; import static org.testng.Assert.fail; import com.google.inject.Inject; @@ -27,6 +26,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.eclipse.che.selenium.pageobject.theia.TheiaEditor; import org.eclipse.che.selenium.pageobject.theia.TheiaHostedPluginSelectPathForm; @@ -65,7 +65,7 @@ public class TheiaBuildPluginTest { @BeforeClass public void prepare() { dashboard.open(); - createWorkspaceHelper.createWorkspaceFromStackWithoutProject(CHE_7_PREVIEW, WORKSPACE_NAME); + createWorkspaceHelper.createWorkspaceFromStackWithoutProject(Stack.GO, WORKSPACE_NAME); theiaIde.switchToIdeFrame(); theiaIde.waitTheiaIde(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/workspaces/CreateWorkspaceOnDashboardTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/workspaces/CreateWorkspaceOnDashboardTest.java index 86eda5dbb531..c7246714b66c 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/workspaces/CreateWorkspaceOnDashboardTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/workspaces/CreateWorkspaceOnDashboardTest.java @@ -17,7 +17,6 @@ import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Workspace.WORKSPACE; import static org.eclipse.che.selenium.pageobject.ProjectExplorer.FolderTypes.PROJECT_FOLDER; import static org.eclipse.che.selenium.pageobject.Wizard.SamplesName.WEB_JAVA_SPRING; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import com.google.inject.Inject; import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; @@ -34,6 +33,7 @@ import org.eclipse.che.selenium.pageobject.Wizard; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.testng.annotations.AfterClass; import org.testng.annotations.Test; @@ -81,8 +81,7 @@ public void createWorkspaceOnDashboardTest() { workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); newWorkspace.typeWorkspaceName(WS_NAME); - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.clickOnCreateButtonAndOpenInIDE(); // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs()