From c4488570c26f2a5c16b6b368fc5d4300f8c72f79 Mon Sep 17 00:00:00 2001 From: Mariia Tolstaia <47791878+maryvictol@users.noreply.github.com> Date: Wed, 8 Nov 2023 12:14:04 +0300 Subject: [PATCH] Gui improvements 29 06 23 (#3393) * Update group selection * Update NAT Gateway locators --- .../pipeline/autotests/DataStoragesTest.java | 6 ++- .../pipeline/autotests/DockerCommitTest.java | 2 +- .../pipeline/autotests/GlobalSearchTest.java | 19 ++++++---- .../pipeline/autotests/LaunchClusterTest.java | 2 +- .../autotests/LaunchParametersTest.java | 8 ++++ .../autotests/PipelineConfigurationTest.java | 15 +++++--- .../autotests/PipelineDetailsTest.java | 1 + .../pipeline/autotests/SharingRunsTest.java | 4 +- .../pipeline/autotests/SshPermissionTest.java | 1 - .../autotests/ToolsParametersTest.java | 8 ++-- .../epam/pipeline/autotests/ToolsTest.java | 2 +- .../pipeline/autotests/ao/AccessObject.java | 2 +- .../com/epam/pipeline/autotests/ao/LogAO.java | 11 ++++++ .../pipeline/autotests/ao/NATGatewayAO.java | 18 ++++++--- .../autotests/ao/NavigationHomeAO.java | 7 +++- .../autotests/ao/PipelineCodeTabAO.java | 7 ++-- .../autotests/ao/PipelineRunFormAO.java | 9 +++-- .../epam/pipeline/autotests/ao/Primitive.java | 3 +- .../epam/pipeline/autotests/ao/Registry.java | 4 +- .../pipeline/autotests/ao/SettingsPageAO.java | 23 ++++++------ .../autotests/ao/StorageContentAO.java | 37 +++++++++---------- .../com/epam/pipeline/autotests/utils/C.java | 2 + .../epam/pipeline/autotests/utils/Utils.java | 14 +++++-- .../test/resources/customCapabilities3.json | 2 +- 24 files changed, 127 insertions(+), 80 deletions(-) diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/DataStoragesTest.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/DataStoragesTest.java index 44ec827719..75f192e1fa 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/DataStoragesTest.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/DataStoragesTest.java @@ -317,8 +317,10 @@ public void validateSelectPageButton() { .cd(folder) .selectPage() .validateAllFilesAreSelected() + .ensureVisible(SELECTION_ACTIONS) + .click(SELECTION_ACTIONS) .ensureVisible(REMOVE_ALL, CLEAR_SELECTION) - .ensure(SELECT_ALL, not(visible)); + .ensure(SELECT_ALL, disabled); } @Test(dependsOnMethods = "validateSelectPageButton") @@ -331,7 +333,7 @@ public void clearSelection() { .clearSelection() .validateNoElementsAreSelected() .ensure(SELECT_ALL, visible) - .ensureNotVisible(REMOVE_ALL, CLEAR_SELECTION); + .ensureNotVisible(SELECTION_ACTIONS); } @Test(dependsOnMethods = {"createDataStorageAndValidate"}) diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/DockerCommitTest.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/DockerCommitTest.java index 86b37a809c..46e95916bf 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/DockerCommitTest.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/DockerCommitTest.java @@ -59,7 +59,7 @@ public class DockerCommitTest private final String defaultPriceType = Tools.defaultPriceType; private final String testFileName = "test_file.txt"; private final String testFileContent = "This is a test file " + suffix; - private final String personalGroup = "personal"; + private final String personalGroup = "Personal"; private final String toolInPersonalGroup = personalGroupActualName(login) + "/" + exactToolName(tool); private final String customTag = "test_tag"; diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/GlobalSearchTest.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/GlobalSearchTest.java index 9d5f2a6f48..bf82c32059 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/GlobalSearchTest.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/GlobalSearchTest.java @@ -31,6 +31,7 @@ import com.epam.pipeline.autotests.ao.ToolTab; import com.epam.pipeline.autotests.mixins.Navigation; import com.epam.pipeline.autotests.utils.C; +import static com.epam.pipeline.autotests.utils.C.SEARCH_TIMEOUT; import com.epam.pipeline.autotests.utils.TestCase; import com.epam.pipeline.autotests.utils.Utils; import org.testng.annotations.BeforeClass; @@ -100,6 +101,7 @@ public void prepareForSearch() { .configurationWithin(configuration, configuration -> configuration.expandTabs(advancedTab) .setValue(DISK, customDisk) + .ensure(INSTANCE_TYPE, enabled) .selectValue(INSTANCE_TYPE, defaultInstanceType) .setValue(NAME, customConfigurationProfile) .selectDockerImage(dockerImage -> @@ -141,7 +143,7 @@ public void prepareForSearch() { .messageShouldAppear("The query string supports the following special characters:") .close(); - sleep(2, MINUTES); + sleep(SEARCH_TIMEOUT, MINUTES); } @BeforeMethod @@ -355,7 +357,7 @@ public void searchForStorageWithChangedName() { .clickEditStorageButton() .setAlias(storageAlias) .ok(); - home().sleep(C.SEARCH_TIMEOUT + 2, MINUTES); + home().sleep(SEARCH_TIMEOUT + 2, MINUTES); search() .search(storageAlias) .enter() @@ -390,7 +392,7 @@ public void searchForPipelineRunOverStoragePath() { .launch(this) .showLog(getLastRunId()) .waitForCompletion(); - home().sleep(C.SEARCH_TIMEOUT, MINUTES); + home().sleep(SEARCH_TIMEOUT, MINUTES); search() .click(RUNS) .search(storage) @@ -486,6 +488,7 @@ public void searchForToolRun() { endpointPage.closeTab(); } } + sleep(SEARCH_TIMEOUT, MINUTES); LogAO logAO = new LogAO(); String endpointLink = logAO.getEndpointLink(); String[] instanceParam = new String[] { @@ -540,7 +543,7 @@ public void searchForCompletedToolRun() { runsMenu() .activeRuns() .stopRun(testRunID_2668); - home().sleep(C.SEARCH_TIMEOUT + 2, MINUTES); + home().sleep(SEARCH_TIMEOUT + 2, MINUTES); search() .click(RUNS) .search(testRunID_2668) @@ -583,7 +586,7 @@ public void issueSearch() { .showIssues() .clickNewIssue() .addNewIssue(title, description); - home().sleep(C.SEARCH_TIMEOUT + 2, MINUTES); + home().sleep(SEARCH_TIMEOUT + 2, MINUTES); search() .search(title) .enter() @@ -616,7 +619,7 @@ public void identicalNamesSearch() { library() .cd(folder) .createFolder(title); - home().sleep(C.SEARCH_TIMEOUT + 2, MINUTES); + home().sleep(SEARCH_TIMEOUT + 2, MINUTES); search() .ensureAll(enabled, FOLDERS, PIPELINES, RUNS, TOOLS, DATA, ISSUES) .search(title) @@ -712,7 +715,7 @@ public void searchWithSpecialExpressions() { .library() .cd(folder) .createFolder(folderWithExpression); - home().sleep(C.SEARCH_TIMEOUT, MINUTES); + home().sleep(SEARCH_TIMEOUT, MINUTES); search() .search(innerFolder1 + "*") .enter() @@ -777,7 +780,7 @@ public void searchForDetachConfigByConfiguration() { public void searchAfterDeleting() { library() .removeNotEmptyFolder(folder) - .sleep(C.SEARCH_TIMEOUT, MINUTES); + .sleep(SEARCH_TIMEOUT, MINUTES); home(); search() .search(pipeline) diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/LaunchClusterTest.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/LaunchClusterTest.java index a10b8e0d3d..be0cb12891 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/LaunchClusterTest.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/LaunchClusterTest.java @@ -58,7 +58,7 @@ public class LaunchClusterTest extends AbstractAutoRemovingPipelineRunningTest i private final String testingTool = C.ANOTHER_TESTING_TOOL_NAME; private final String testingNode = C.ANOTHER_INSTANCE; private final String instanceFamilyName = C.DEFAULT_INSTANCE_FAMILY_NAME; - private final String gridEngineAutoscalingTask = "GridEngineAutoscaling"; + private final String gridEngineAutoscalingTask = "SGEAutoscaling"; private final String spotPrice = C.SPOT_PRICE_NAME; private final String onDemandPrice = ON_DEMAND; private final String mastersConfigPrice = "Master's config"; diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/LaunchParametersTest.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/LaunchParametersTest.java index 910dc39682..ff752bc038 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/LaunchParametersTest.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/LaunchParametersTest.java @@ -109,6 +109,14 @@ public void setPreferences() { ); }); initialLaunchSystemParameters = editLaunchSystemParameters(); + navigationMenu() + .settings() + .switchToUserManagement() + .switchToUsers() + .searchUserEntry(userWithoutCompletedRuns.login) + .edit() + .deleteRoleOrGroupIfExist(USER_ROLE) + .ok(); } @AfterClass(alwaysRun = true) diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/PipelineConfigurationTest.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/PipelineConfigurationTest.java index fc37618192..6ee82bc720 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/PipelineConfigurationTest.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/PipelineConfigurationTest.java @@ -15,6 +15,7 @@ */ package com.epam.pipeline.autotests; +import static com.codeborne.selenide.Selectors.withText; import com.epam.pipeline.autotests.ao.AbstractPipelineTabAO; import com.epam.pipeline.autotests.ao.ConfirmationPopupAO; import com.epam.pipeline.autotests.ao.PipelineCodeTabAO; @@ -24,6 +25,7 @@ import com.epam.pipeline.autotests.utils.C; import com.epam.pipeline.autotests.utils.ConfigurationProfile; import com.epam.pipeline.autotests.utils.TestCase; +import static java.lang.String.format; import org.testng.annotations.AfterClass; import org.testng.annotations.Test; @@ -39,7 +41,6 @@ import static com.codeborne.selenide.Selenide.open; import static com.epam.pipeline.autotests.ao.LogAO.InstanceParameters.parameterWithName; import static com.epam.pipeline.autotests.ao.LogAO.logMessage; -import static com.epam.pipeline.autotests.ao.LogAO.taskWithName; import static com.epam.pipeline.autotests.ao.Primitive.*; import static com.epam.pipeline.autotests.ao.Profile.profileWithName; import static com.epam.pipeline.autotests.utils.Conditions.collapsedTab; @@ -244,13 +245,14 @@ public void validationOfAddingNewConfigurationFeature() { .ensure(profileWithName(configurationName), exist, visible) .onTab(PipelineCodeTabAO.class) .clickOnFile(configurationFileName) - .shouldContainInCode(String.format("\"name\" : \"%s\"", configurationName)) + .shouldContainInCode(format("\"name\" : \"%s\"", configurationName)) .close(); } @Test(priority = 3, dependsOnMethods = "validationOfAddingNewConfigurationFeature") @TestCase("EPMCMBIBPC-797") public void validationOfEditNewConfiguration() { + String updatemessage = format("Updating '%s' configuration", configurationName); onPipelinePage() .onTab(PipelineConfigurationTabAO.class) .editConfiguration(configurationName, profile -> @@ -263,7 +265,8 @@ public void validationOfEditNewConfiguration() { .sleep(2, SECONDS) .click(SAVE) ) - .messageShouldAppear(String.format("Updating '%s' configuration", configurationName)) + .messageShouldAppear(updatemessage) + .ensure(withText(updatemessage), not(visible)) // Because the page refreshes .sleep(5, SECONDS) .onTab(PipelineCodeTabAO.class) @@ -347,13 +350,13 @@ public void validationOfSettingAsDefaultBehavior() { @Test(priority = 8, dependsOnMethods = "validationOfSettingAsDefaultBehavior") @TestCase("EPMCMBIBPC-805") public void validationOfConfigurationRemoving() { - final String expectedTitle = String.format( + final String expectedTitle = format( "Are you sure you want to remove configuration '%s'?", configurationName ); - final String deletionWasCancelled = String.format( + final String deletionWasCancelled = format( "Configuration with name %s supposed exists as deletion was cancelled.", configurationName ); - final String deletionWasConfirmed = String.format( + final String deletionWasConfirmed = format( "Configuration with name %s supposed to be deleted.", configurationName ); onPipelinePage() diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/PipelineDetailsTest.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/PipelineDetailsTest.java index 11f07cff31..3ef7d291fe 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/PipelineDetailsTest.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/PipelineDetailsTest.java @@ -101,6 +101,7 @@ public void luigiPipelineTabsShouldBeValid() { public void shouldCreateFolderInPipeline() { codeTab() .createFolder(pipelineFolder) + .ensure(byText(pipelineFolder), visible) .shouldContainElement(pipelineFolder); } diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/SharingRunsTest.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/SharingRunsTest.java index dd9f898afa..6b9408dfcf 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/SharingRunsTest.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/SharingRunsTest.java @@ -16,11 +16,13 @@ package com.epam.pipeline.autotests; import com.codeborne.selenide.Condition; +import com.epam.pipeline.autotests.ao.LogAO; import com.epam.pipeline.autotests.ao.ToolPageAO; import com.epam.pipeline.autotests.ao.ToolTab; import com.epam.pipeline.autotests.mixins.Authorization; import com.epam.pipeline.autotests.mixins.Tools; import com.epam.pipeline.autotests.utils.C; +import static com.epam.pipeline.autotests.utils.C.DEFAULT_CLOUD_REGION; import com.epam.pipeline.autotests.utils.TestCase; import com.epam.pipeline.autotests.utils.Utils; import org.testng.annotations.BeforeMethod; @@ -240,7 +242,7 @@ public void shareSSHSession() { .ensureVisible(SERVICES) .checkEndpointsLinkOnServicesPanel(name[name.length - 1]) .checkSSHLinkIsDisplayedOnServicesPanel(runID) - .openSSHLink(runID) + .openSSHLink(runID, DEFAULT_CLOUD_REGION) .waitUntilTextLoads(runID) .execute("cat test.file") .assertPageContains("123") diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/SshPermissionTest.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/SshPermissionTest.java index f2aa99269f..7e9623d6c4 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/SshPermissionTest.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/SshPermissionTest.java @@ -129,7 +129,6 @@ public void checkAccessToSSHByDirectLinkForNonOwnerUser() { .switchToMyProfile() .validateUserName(user.login); ShellAO.open(sshLink) - .waitUntilTextAppears(getLastRunId()) .execute("ls -la") .assertOutputDoesNotContain("ls -la"); open(C.ROOT_ADDRESS); diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ToolsParametersTest.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ToolsParametersTest.java index e504c1c7f4..6225d66a37 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ToolsParametersTest.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ToolsParametersTest.java @@ -59,7 +59,7 @@ public class ToolsParametersTest private static final String SYSTEM_D = "SystemD"; private static final String TOOLTIP_2 = "This capability is not allowed\nSupported OS versions:\ncentos*"; private static final String TOOLTIP_1 = "This capability is not allowed\nSupported OS versions:\ndebian 10\n" + - "centos*"; + "centos 8"; private static final String CUSTOM_CAPABILITY_DESC_1 = "Custom test capability 1"; private static final String CUSTOM_CAPABILITY_DESC_2 = "Custom test capability 2"; private static final String CUSTOM_CAPABILITY_DESC_3 = "Custom test capability 3"; @@ -222,9 +222,8 @@ public void customCapabilitiesForToolDockerImageOS() { .checkCustomCapability(CUSTOM_CAPABILITY_3, false) .checkCustomCapability(CUSTOM_CAPABILITY_4, false) .checkCustomCapability(CUSTOM_CAPABILITY_2, true) - .checkCustomCapability(SYSTEM_D, true) + .checkCustomCapability(SYSTEM_D, false) .checkCapabilityTooltip(CUSTOM_CAPABILITY_2, TOOLTIP_1) - .checkCapabilityTooltip(SYSTEM_D, TOOLTIP_2) .click(byTitle(RUN_CAPABILITIES_TITLE)) .selectRunCapability(CUSTOM_CAPABILITY_1) .click(byTitle(RUN_CAPABILITIES_TITLE)) @@ -240,9 +239,8 @@ public void customCapabilitiesForToolDockerImageOS() { .checkCustomCapability(CUSTOM_CAPABILITY_1, false) .checkCustomCapability(CUSTOM_CAPABILITY_3, false) .checkCustomCapability(CUSTOM_CAPABILITY_2, true) - .checkCustomCapability(SYSTEM_D, true) + .checkCustomCapability(SYSTEM_D, false) .checkCapabilityTooltip(CUSTOM_CAPABILITY_2, TOOLTIP_1) - .checkCapabilityTooltip(SYSTEM_D, TOOLTIP_2) .click(byTitle(RUN_CAPABILITIES_TITLE)) .selectRunCapability(CUSTOM_CAPABILITY_1) .click(byTitle(RUN_CAPABILITIES_TITLE)) diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ToolsTest.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ToolsTest.java index c9485dbba9..62a1eccfed 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ToolsTest.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ToolsTest.java @@ -62,7 +62,7 @@ public class ToolsTest private final String defaultRegistryId = C.DEFAULT_REGISTRY_IP; private final String testingTool = C.TESTING_TOOL_NAME; private final String dockerImage = String.format("%s/%s", defaultRegistryId, testingTool); - private final String personalGroup = "personal"; + private final String personalGroup = "Personal"; private final String defaultGroup = C.DEFAULT_GROUP; private final String command = "echo \"Hi, I'm nginx!\""; private final String disk = "23"; diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/AccessObject.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/AccessObject.java index 5b920387a0..017b37bdc1 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/AccessObject.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/AccessObject.java @@ -507,7 +507,7 @@ default ELEMENT_TYPE selectValue(final Primitive combobox, final String option) * @return The origin access object. */ default ELEMENT_TYPE selectValue(final Primitive combobox, final By optionQualifier) { - get(combobox).shouldBe(visible).click(); + get(combobox).shouldBe(visible, enabled).click(); $(visible(byClassName("ant-select-dropdown"))).find(optionQualifier).shouldBe(visible).click(); return (ELEMENT_TYPE) this; } diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/LogAO.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/LogAO.java index 84d8bf544f..68e35e0ccb 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/LogAO.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/LogAO.java @@ -23,6 +23,7 @@ import com.epam.pipeline.autotests.utils.Conditions; import com.epam.pipeline.autotests.utils.Utils; import org.openqa.selenium.By; +import static org.openqa.selenium.By.className; import org.openqa.selenium.WebElement; import java.util.*; @@ -86,6 +87,16 @@ public LogAO waitForSshLink() { return this; } + private void openRegionSelector() { + get(SSH_LINK).parent().find(className("ultizone-url__expander")).click(); + } + + public String getBestRegion() { + openRegionSelector(); + return $$(className("rc-dropdown-menu-item")).get(0).find("a") + .text().replace("(best)", ""); + } + public ShellAO clickOnSshLink() { return ShellAO.open(getSshLink()); } diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/NATGatewayAO.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/NATGatewayAO.java index b4c3136846..b2b1d76497 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/NATGatewayAO.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/NATGatewayAO.java @@ -15,6 +15,7 @@ */ package com.epam.pipeline.autotests.ao; +import static com.codeborne.selenide.Condition.not; import com.codeborne.selenide.ElementsCollection; import com.codeborne.selenide.SelenideElement; import com.epam.pipeline.autotests.utils.C; @@ -84,7 +85,9 @@ public By route(final String ipAddress, final String port) { @Override public List findElements(final SearchContext context) { return context() - .findAll(byClassName("ant-table-row")).stream() + .findAll(byClassName("ant-table-row")) + .filter(not(cssClass("at-gateway-configuration__divider-row"))) + .stream() .filter(element -> text(ipAddress).apply(element.findAll(".external-column").get(2)) && text(port).apply(element.findAll(".external-column").get(3))) .filter(el -> !el.find(By.className("ant-table-row-expand-icon")).exists() || @@ -99,7 +102,9 @@ public By routeByName(final String serverName, final String port) { @Override public List findElements(final SearchContext context) { return context() - .findAll(byClassName("ant-table-row")).stream() + .findAll(byClassName("ant-table-row")) + .filter(not(cssClass("at-gateway-configuration__divider-row"))) + .stream() .filter(element -> text(serverName).apply(element.findAll(".external-column").get(1)) && text(port).apply(element.findAll(".external-column").get(3))) .filter(el -> !el.find(By.className("ant-table-row-expand-icon")).exists() || @@ -115,6 +120,7 @@ public By groupRouteByName(final String serverName, final String port) { public List findElements(final SearchContext context) { return context() .findAll(byClassName("ant-table-row")).stream() + .filter(not(cssClass("at-gateway-configuration__divider-row"))) .filter(element -> text(serverName).apply(element.findAll(".external-column").get(1)) && text(port).apply(element.findAll(".external-column").get(3))) .filter(el -> el.find(By.className("ant-table-row-expand-icon")).exists() && @@ -184,7 +190,7 @@ public NATGatewayAO checkActiveRouteRecord(final String ipAddress, final String format("%s-%s", C.NAT_PROXY_SERVICE_PREFIX, serverName.replaceAll("\\.", "-")))); internalConfigElements.get(1).shouldHave(matchText(IPV4_PATTERN)); internalConfigElements.get(2).shouldHave(matchText(PORT_PATTERN)); - routeRecord.find(".at-getaway-configuration__comment-column").shouldHave(text(comment)); + routeRecord.find(".at-gateway-configuration__comment-column").shouldHave(text(comment)); return this; } @@ -230,7 +236,7 @@ public boolean routeRecordExist(final String externalIPAddressOrServerName, fina public NATGatewayAO deleteRoute(final String externalIPAddressOrServerName, final String port) { final SelenideElement route = getRouteRecord(externalIPAddressOrServerName, port); - route.find(".at-getaway-configuration__actions-column") + route.find(".at-gateway-configuration__actions-column") .find(byClassName("ant-btn-danger")) .shouldBe(visible) .click(); @@ -283,7 +289,7 @@ public NATGatewayAO waitForRouteData() { public List getGroupExternalPortsList(final String serverName, final String port) { final SelenideElement routeRecord = $(groupRouteByName(serverName, port)); return routeRecord.shouldBe(exist).findAll(".external-column") - .get(3).findAll(".at-getaway-configuration__port").texts(); + .get(3).findAll(".at-gateway-configuration__port").texts(); } public NATGatewayAO checkGroupPortsList(final String serverName, final String port, List ports) { @@ -295,7 +301,7 @@ public NATGatewayAO checkGroupPortsList(final String serverName, final String po @Override public SelenideElement context() { - return $(byClassName("at-getaway-configuration__container")); + return $(byClassName("at-gateway-configuration__container")); } @Override diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/NavigationHomeAO.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/NavigationHomeAO.java index 5898a37a88..552d3b4884 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/NavigationHomeAO.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/NavigationHomeAO.java @@ -21,6 +21,7 @@ import com.epam.pipeline.autotests.utils.PipelineSelectors; import com.epam.pipeline.autotests.utils.Utils; import org.openqa.selenium.By; +import static org.openqa.selenium.By.className; import org.openqa.selenium.Keys; import org.openqa.selenium.SearchContext; import org.openqa.selenium.WebElement; @@ -110,8 +111,10 @@ public NavigationHomeAO checkSSHLinkIsNotDisplayedOnServicesPanel(String runId) return this; } - public ShellAO openSSHLink(String runId) { - serviceSshLink(runId).hover().closest("a").shouldBe(visible).click(); + public ShellAO openSSHLink(String runId, String region) { + serviceSshLink(runId).hover().closest("div") + .find(className("ultizone-url__expander")).click(); + $(byText(region)).click(); switchTo().window(1); switchTo().frame(0); return new ShellAO(); diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/PipelineCodeTabAO.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/PipelineCodeTabAO.java index 059f4c4a3f..09e6a6d69c 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/PipelineCodeTabAO.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/PipelineCodeTabAO.java @@ -147,7 +147,7 @@ public FileEditingPopupAO clickOnFile(String fileName) { } public PipelineCodeTabAO shouldContainElement(String folderName) { - $(".ant-table-tbody").find("tr").waitUntil(enabled, DEFAULT_TIMEOUT); + $(byText("config.json")).waitUntil(visible, DEFAULT_TIMEOUT); $(".ant-table-tbody") .findAll("tr") .shouldHaveSize(3) @@ -232,7 +232,7 @@ public FileEditingPopupAO assertFileIsNotEmpty() { } private FileEditingPopupAO fillWith(String newText) { - Utils.clickAndSendKeysWithSlashes($(byClassName("CodeMirror-line")), newText); + Utils.pasteText($(byClassName("CodeMirror-line")), newText); return this; } @@ -273,8 +273,7 @@ public FileEditingPopupAO editFile(final UnaryOperator action) { return this; } clear() - .fillWith(edited) - .deleteExtraBrackets(100); + .fillWith(edited); return this; } diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/PipelineRunFormAO.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/PipelineRunFormAO.java index 9170e45443..f8b145fe2b 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/PipelineRunFormAO.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/PipelineRunFormAO.java @@ -107,9 +107,10 @@ public PipelineRunFormAO setDefaultLaunchOptions() { } public PipelineRunFormAO setLaunchOptions(String disk, String type, String timeOut) { - return setDisk(disk) - .sleep(1, SECONDS) + return sleep(7, SECONDS) .setTypeValue(type) + .sleep(1, SECONDS) + .setDisk(disk) .setTimeOut(timeOut); } @@ -151,8 +152,8 @@ public PipelineRunFormAO setDisk(String disk) { public PipelineRunFormAO setCommand(String command) { SelenideElement defaultCommand = get(DEFAULT_COMMAND); - Utils.clearTextField(defaultCommand); - Utils.clickAndSendKeysWithSlashes(defaultCommand, command); + Utils.selectAllAndClearTextField(defaultCommand); + Utils.pasteText(defaultCommand, command); return this; } diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/Primitive.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/Primitive.java index ec49a0b8bb..adc7535910 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/Primitive.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/Primitive.java @@ -322,5 +322,6 @@ public enum Primitive { PROTOCOL, REINDEX, CONDITION, - SHOW_TIMINGS + SHOW_TIMINGS, + SELECTION_ACTIONS } diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/Registry.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/Registry.java index cf8bd279f8..be0061f31d 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/Registry.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/Registry.java @@ -15,8 +15,9 @@ */ package com.epam.pipeline.autotests.ao; +import static com.codeborne.selenide.Selectors.byText; +import static com.codeborne.selenide.Selenide.$; import com.codeborne.selenide.SelenideElement; -import org.openqa.selenium.By; import java.util.List; import java.util.Map; @@ -59,6 +60,7 @@ private void changeGroupTo(final String groupName) { sleep(1, SECONDS); if (!get(GROUP).getText().equals(groupName)) { click(GROUP); + $(byText("All groups")).shouldBe(visible).click(); get(GROUPS_LIST).find(button(groupName)).shouldBe(visible).click(); ensure(GROUP, text(groupName)); } diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/SettingsPageAO.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/SettingsPageAO.java index 5371b192e2..8c034c54d5 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/SettingsPageAO.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/SettingsPageAO.java @@ -19,7 +19,7 @@ import com.codeborne.selenide.SelenideElement; import com.epam.pipeline.autotests.ao.settings.CliAO; import com.epam.pipeline.autotests.mixins.Authorization; -import com.epam.pipeline.autotests.utils.C; +import static com.epam.pipeline.autotests.utils.C.DEFAULT_TIMEOUT; import com.epam.pipeline.autotests.utils.PipelineSelectors; import com.epam.pipeline.autotests.utils.Utils; import com.fasterxml.jackson.databind.JsonNode; @@ -31,8 +31,6 @@ import org.openqa.selenium.SearchContext; import org.openqa.selenium.WebElement; -import java.awt.*; -import java.awt.datatransfer.StringSelection; import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -48,7 +46,6 @@ import static com.epam.pipeline.autotests.ao.Primitive.*; import static com.epam.pipeline.autotests.utils.PipelineSelectors.button; import static com.epam.pipeline.autotests.utils.PipelineSelectors.buttonByIconClass; -import static com.epam.pipeline.autotests.utils.PipelineSelectors.menuitem; import static com.epam.pipeline.autotests.utils.Utils.*; import static java.lang.String.format; import static java.util.concurrent.TimeUnit.SECONDS; @@ -752,6 +749,7 @@ public EditUserPopup addRoleOrGroup(final String value) { } public EditUserPopup addRoleOrGroupIfNonExist(final String value) { + $(By.className("role-ROLE_USER")).waitUntil(exist, DEFAULT_TIMEOUT); if ($(By.className(format("role-%s", value))).exists()) { return this; } @@ -767,6 +765,14 @@ public EditUserPopup deleteRoleOrGroup(final String value) { return this; } + public EditUserPopup deleteRoleOrGroupIfExist(final String value) { + $(byClassName("edit-user-roles-dialog__table")).waitUntil(exist, DEFAULT_TIMEOUT); + if(!$$(byClassName("role-name-column")).findBy(text(value)).exists()) { + return this; + } + return deleteRoleOrGroup(value); + } + public EditUserPopup blockUser(final String user) { click(BLOCK); new ConfirmationPopupAO(this) @@ -1226,12 +1232,7 @@ public PreferencesAO updateCodeText(final String preference, final String value, searchPreference(preference); final SelenideElement editor = $(byClassName("CodeMirror-line")); selectAllAndClearTextField(editor); - final StringSelection stringSelection = new StringSelection(value); - Toolkit.getDefaultToolkit().getSystemClipboard() - .setContents(stringSelection, null); - actions().moveToElement(editor).click() - .sendKeys(Keys.chord(Keys.CONTROL, "v")) - .perform(); + pasteText(editor, value); setEyeOption(eyeIsChecked); return this; } @@ -1352,7 +1353,7 @@ public PreferencesAO save() { */ actions().moveToElement(get(SAVE)).perform(); get(SAVE).pressEnter(); - get(SAVE).waitUntil(disabled, C.DEFAULT_TIMEOUT); + get(SAVE).waitUntil(disabled, DEFAULT_TIMEOUT); return this; } diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/StorageContentAO.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/StorageContentAO.java index 873cdfcce9..15f9a3c7e5 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/StorageContentAO.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/StorageContentAO.java @@ -71,17 +71,18 @@ public class StorageContentAO implements AccessObject { entry(CREATE_FOLDER, context().find(byClassName("create-folder-button"))), entry(CREATE_FILE, context().find(byClassName("create-file-button"))), entry(ADDRESS_BAR, context().find(byClassName("ant-breadcrumb"))), - entry(CLEAR_SELECTION, context().find(byId("clear-selection-button"))), - entry(REMOVE_ALL, context().find(byId("remove-all-selected-button"))), + entry(CLEAR_SELECTION, context().find(byClassName("selection-action-clear"))), + entry(REMOVE_ALL, context().find(byClassName("selection-action-remove-all"))), entry(DESCRIPTION, context().find(byCssSelector(".browser__data-storage-info-container div:first-child"))), entry(NAVIGATION, context().find(byClassName("data-storage-navigation__path-components-container"))), entry(STORAGEPATH, context().find(byClassName("data-storage-navigation__breadcrumb-item"))), entry(HEADER, context().find(byClassName("browser__item-header"))), - entry(SHOW_METADATA, context().find(byId("show-metadata-button"))), + entry(SHOW_METADATA, context().find(byClassName("presentation-action-attributes"))), entry(PREV_PAGE, context().find(byId("prev-page-button"))), entry(NEXT_PAGE, context().find(byId("next-page-button"))), - entry(GENERATE_URL, context().find(byId("bulk-url-button"))), - entry(HIDE_METADATA, context().find(byId("hide-metadata-button"))) + entry(GENERATE_URL, context().find(byClassName("selection-action-generate-url"))), + entry(ACTIONS, context().find(byId("presentation-actions"))), + entry(SELECTION_ACTIONS, context().find(byId("selection-actions"))) ); public static By browserItem(final String name) { @@ -358,7 +359,7 @@ public StorageContentAO selectPage() { } public StorageContentAO clearSelection() { - return click(CLEAR_SELECTION); + return click(SELECTION_ACTIONS).click(CLEAR_SELECTION); } public StorageContentAO validateNoElementsAreSelected() { @@ -433,14 +434,9 @@ public StorageContentAO validateElementsAreEditable() { } public MetadataSectionAO showMetadata() { - int attempt = 0; - int maxAttempts = 3; - while (get(SHOW_METADATA).is(not(visible)) && attempt < maxAttempts) { - if (get(HIDE_METADATA).isDisplayed()) { - return new MetadataSectionAO(this); - } - sleep(1, SECONDS); - attempt++; + click(ACTIONS); + if(get(SHOW_METADATA).$(className("anticon-check")).exists()) { + return new MetadataSectionAO(this); } click(SHOW_METADATA); return new MetadataSectionAO(this); @@ -460,17 +456,18 @@ private Stream getFoldersAOs() { public StorageContentAO showFilesVersions(final boolean requiredState) { sleep(1, SECONDS); - final SelenideElement inputLabel = - $(byText("Show files versions")).closest(".ant-checkbox-wrapper"); + click(ACTIONS); + final SelenideElement inputLabel = $(className("presentation-action-version")); - if (inputLabel.find("input").isSelected() != requiredState) { + if (inputLabel.find(className("anticon-check")).exists() != requiredState) { inputLabel.shouldBe(visible).click(); } return this; } public StorageContentAO assertShowFilesVersionsIsChecked() { - $(byClassName("ant-checkbox-checked")).shouldBe(visible); + click(ACTIONS); + $(byClassName("anticon-check")).shouldBe(visible); return this; } @@ -688,8 +685,7 @@ public SelectedElementsAO(String[] names) { } public StorageContentAO removeAllSelected() { - StorageContentAO.this.ensureVisible(CLEAR_SELECTION); - StorageContentAO.this.click(REMOVE_ALL); + clickOnRemoveAllSelectedButton(); $$(byClassName("ant-modal-content")) .findBy(text("Remove all selected items?")) @@ -702,6 +698,7 @@ public StorageContentAO removeAllSelected() { } public SelectedElementsAO clickOnRemoveAllSelectedButton() { + StorageContentAO.this.click(SELECTION_ACTIONS); StorageContentAO.this.click(REMOVE_ALL); return this; } diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/utils/C.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/utils/C.java index c22a10c56a..6a31070c39 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/utils/C.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/utils/C.java @@ -126,6 +126,7 @@ public class C { BACKUP_STORAGE_OFFSET = Integer.parseInt(conf.getProperty("e2e.ui.backup.storage.offset")); DEFAULT_CLUSTER_AWS_EBS_TYPE = conf.getProperty("e2e.ui.cluster.aws.ebs.type"); TEST_RUN_TAG = conf.getProperty("e2e.ui.test.run.tag"); + DEFAULT_CLOUD_REGION = conf.getProperty("e2e.ui.default.cloud.region"); } public static final int DEFAULT_TIMEOUT; @@ -194,6 +195,7 @@ public class C { public static final String SEARCH_PREFIX; public static final String PLATFORM_NAME; public static final String ANOTHER_CLOUD_REGION; + public static final String DEFAULT_CLOUD_REGION; public static final String ANONYMOUS_NAME; public static final String ANONYMOUS_TOKEN; diff --git a/e2e/gui/src/test/java/com/epam/pipeline/autotests/utils/Utils.java b/e2e/gui/src/test/java/com/epam/pipeline/autotests/utils/Utils.java index 80f6e0d171..4703465c54 100644 --- a/e2e/gui/src/test/java/com/epam/pipeline/autotests/utils/Utils.java +++ b/e2e/gui/src/test/java/com/epam/pipeline/autotests/utils/Utils.java @@ -28,9 +28,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; -import java.awt.AWTException; -import java.awt.Color; -import java.awt.Robot; +import java.awt.*; +import java.awt.datatransfer.StringSelection; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; @@ -157,6 +156,15 @@ public static void sendKeysWithSlashes(final String text) { ////////////////////////////////////////////////////////////////////////// } + public static void pasteText(final SelenideElement field, final String text) { + final StringSelection stringSelection = new StringSelection(text); + Toolkit.getDefaultToolkit().getSystemClipboard() + .setContents(stringSelection, null); + actions().moveToElement(field).click() + .sendKeys(Keys.chord(Keys.CONTROL, "v")) + .perform(); + } + public static void sendKeysByChars(final SelenideElement field, final String text) { final char[] charArray = text.toCharArray(); int charNumber = 0; diff --git a/e2e/gui/src/test/resources/customCapabilities3.json b/e2e/gui/src/test/resources/customCapabilities3.json index 0e1df00cf2..4d7436663f 100644 --- a/e2e/gui/src/test/resources/customCapabilities3.json +++ b/e2e/gui/src/test/resources/customCapabilities3.json @@ -11,7 +11,7 @@ "commands": [ "echo 'testLine2' >> ~/testFile1.txt" ], - "os": "debian 10,centos*" + "os": "debian 10,centos 8" }, "testCapability3": { "description": "Custom test capability 3",