From e15edd745811de113c10ac62b147e6e26b6a34bd Mon Sep 17 00:00:00 2001 From: rahuldash171 Date: Fri, 27 Oct 2023 21:13:02 +0530 Subject: [PATCH 1/4] NameSpace Admin page locators actions and step definition addition. --- .../actions/CdfNameSpaceAdminActions.java | 273 ++++++++++++++++++ .../locators/CdfNameSpaceAdminLocators.java | 190 ++++++++++++ .../java/stepsdesign/NameSpaceadminSteps.java | 163 +++++++++++ 3 files changed, 626 insertions(+) create mode 100644 src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java create mode 100644 src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java create mode 100644 src/main/java/stepsdesign/NameSpaceadminSteps.java diff --git a/src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java b/src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java new file mode 100644 index 000000000..9002e05e4 --- /dev/null +++ b/src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java @@ -0,0 +1,273 @@ +/* + * Copyright © 2023 Cask Data, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package io.cdap.e2e.pages.actions; + +import io.cdap.e2e.pages.locators.CdfNameSpaceAdminLocators; +import io.cdap.e2e.utils.AssertionHelper; +import io.cdap.e2e.utils.ConstantsUtil; +import io.cdap.e2e.utils.ElementHelper; +import io.cdap.e2e.utils.JsonUtils; +import io.cdap.e2e.utils.PluginPropertyUtils; +import io.cdap.e2e.utils.SeleniumHelper; +import io.cdap.e2e.utils.WaitHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.util.Map; + +/** + * Represents CdfNameSpaceAdminActions + */ +public class CdfNameSpaceAdminActions { + + private static final Logger logger = LoggerFactory.getLogger(CdfNameSpaceAdminActions.class); + public static CdfNameSpaceAdminLocators cdfNameSpaceAdminLocators; + + static { + cdfNameSpaceAdminLocators = SeleniumHelper.getPropertiesLocators( + CdfNameSpaceAdminLocators.class); + } + + public static void clickOnNameSpaceAdminTabs(String tabName, String nameSpaceName) { + ElementHelper.clickOnElement( + CdfNameSpaceAdminLocators.nameSpaceModules(tabName, nameSpaceName)); + } + + public static void openNamespaceAdminPage() { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.namespaceAdminMenu); + } + + public static void clickOnHamburgerMenu() { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.hamburgerMenu); + } + + public static void clickOnEditPreference() { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.editPreferencesButton); + } + + public static void switchToNameSpace(String nameSpaceName) { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.switchNameSpace(nameSpaceName)); + } + + public static void createProfileForNamespace(String nameSpaceName) { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.createProfile(nameSpaceName)); + } + + public static void openNamespaceDropdown() { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.namespaceDropdown); + } + + public static void addNamespaceFromHamburgerMenu() { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.addNamespace); + } + + /** + * Click on Save and Close button to save preference + */ + public static void clickOnSavePreference() { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.clickSaveClose); + } + + public static void selectHamburgerMenuList(String listName) { + String pluginPropertyDataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( + listName); + if (pluginPropertyDataCyAttribute == null) { + pluginPropertyDataCyAttribute = listName; + } + ElementHelper.clickOnElement( + CdfNameSpaceAdminLocators.locateMenuLink(pluginPropertyDataCyAttribute)); + } + + /** + * Enter KeyValue Pairs For Preference Property + * + * @param preferenceProperty @data-cy attribute value of preference Property. If + * preferenceProperty is present in + * {@link ConstantsUtil#DEFAULT_DATACY_ATTRIBUTES_FILE} then its data-cy + * is fetched from it else preferenceProperty is used as it is. + * @param keyValuePair Actual json KeyValue Pairs string is fetched from + * {@link ConstantsUtil#DEFAULT_PLUGIN_PROPERTIES_FILE} with + * keyValuePair as key + */ + public static void enterKeyValuePreferences(String preferenceProperty, String keyValuePair) { + String pluginPropertyDataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( + preferenceProperty); + if (pluginPropertyDataCyAttribute == null) { + pluginPropertyDataCyAttribute = preferenceProperty; + } + Map properties = + JsonUtils.convertKeyValueJsonArrayToMap(PluginPropertyUtils.pluginProp(keyValuePair)); + int index = 0; + for (Map.Entry entry : properties.entrySet()) { + if (index != 0) { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.locateAddRowButtonProperty( + pluginPropertyDataCyAttribute, index - 1)); + } + ElementHelper.sendKeys(CdfNameSpaceAdminLocators.locateKeyProperty( + pluginPropertyDataCyAttribute, index), entry.getKey()); + ElementHelper.sendKeys(CdfNameSpaceAdminLocators.locateValueProperty( + pluginPropertyDataCyAttribute, index), entry.getValue()); + index++; + } + } + + /** + * Select on the type of Provisioner from list for Compute Profile in system admin + * + * @param provisionerName @data-cy attribute value of Provisioner. If Provisioner is present in + * {@link ConstantsUtil#DEFAULT_DATACY_ATTRIBUTES_FILE} then its data-cy is + * fetched from it else Provisioner is used as it is. + */ + public static void selectProvisioner(String provisionerName) { + String pluginPropertyDataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( + provisionerName); + if (pluginPropertyDataCyAttribute == null) { + pluginPropertyDataCyAttribute = provisionerName; + } + ElementHelper.clickOnElement( + CdfNameSpaceAdminLocators.locateProvisionerInList(pluginPropertyDataCyAttribute)); + } + + /** + * Click on the Close button in compute profile properties page + */ + public static void clickCloseButton() { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.closeButton); + } + + /** + * Click on Delete to delete preference + */ + public static void deletePreference() { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.clickDelete); + } + + /** + * Click on Reset button to reset preference + */ + public static void clickOnResetPreference() { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.clickReset); + } + + /** + * Verify if the added Preferences reset is successful + */ + public static void verifyIfResetValidatedSuccessfully() { + WaitHelper.waitForElementToBeDisplayed(CdfNameSpaceAdminLocators.resetSuccessMsg); + String expectedMessage = PluginPropertyUtils.errorProp( + ConstantsUtil.RESET_VALIDATION_SUCCESS_MESSAGE); + AssertionHelper.verifyElementContainsText( + CdfNameSpaceAdminLocators.resetSuccessMsg, expectedMessage); + } + + /** + * Click on type of button to create Compute Profile in system admin + * + * @param buttonType @data-cy attribute value of button. If type of action is present in + * {@link ConstantsUtil#DEFAULT_DATACY_ATTRIBUTES_FILE} then its data-cy is + * fetched from it else type of action is used as it is. + */ + public static void clickCreateButtonComputeProfile(String buttonType) { + String pluginPropertyDataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( + buttonType); + if (pluginPropertyDataCyAttribute == null) { + pluginPropertyDataCyAttribute = buttonType; + } + ElementHelper.clickOnElement( + CdfNameSpaceAdminLocators.locateButtonType(pluginPropertyDataCyAttribute)); + } + + /** + * Verify Error message displayed on the footer/at the bottom of Compute Profile Properties page + * using the Error message location in the .properties file + * {@link ConstantsUtil#DEFAULT_ERROR_PROPERTIES_FILE} + * + * @param errorMessageLocation Expected error message location + */ + public static void verifyErrorMessageOnFooter(String errorMessageLocation) { + String expectedErrorMessage = PluginPropertyUtils.errorProp(errorMessageLocation); + AssertionHelper.verifyElementContainsText(CdfNameSpaceAdminLocators.errorMessageOnFooter, + expectedErrorMessage); + } + + /** + * Enter NamespaceName value in Add namespace + * + * @param value If value is present in {@link ConstantsUtil#DEFAULT_PLUGIN_PROPERTIES_FILE} as a + * key then its value is fetched from it else value is entered in the input as it + * is. + */ + public static void enterNamespaceName(String value) { + ElementHelper.sendKeys(CdfNameSpaceAdminLocators.namespaceName, + PluginPropertyUtils.pluginProp(value)); + } + + /** + * Enter NamespaceDescription value in Add namespace + * + * @param value If value is present in {@link ConstantsUtil#DEFAULT_PLUGIN_PROPERTIES_FILE} as a + * key then its value is fetched from it else value is entered in the input as it + * is. + */ + public static void enterNamespaceDescription(String value) { + ElementHelper.sendKeys(CdfNameSpaceAdminLocators.namespaceDescription, + PluginPropertyUtils.pluginProp(value)); + } + + /** + * Verify Error message displayed on the dialog box using the Error message location in the + * .properties file {@link ConstantsUtil#DEFAULT_ERROR_PROPERTIES_FILE} + * + * @param errorMessageLocation Expected error message location + */ + public static void verifyFailedErrorMessageOnDialogBox(String errorMessageLocation) { + String expectedErrorMessage = PluginPropertyUtils.errorProp(errorMessageLocation); + AssertionHelper.verifyElementContainsText(CdfNameSpaceAdminLocators.failMessage, + expectedErrorMessage); + } + + public static void switchToNewNameSpace() { + ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.switchToNameSpaceButton); + } + + public static void verifySwitchToNewNamespace(String value) { + String expectedNameSpace = PluginPropertyUtils.pluginProp(value); + AssertionHelper.verifyElementContainsText(CdfNameSpaceAdminLocators.namespaceText, + expectedNameSpace); + } + + public static void verifyElementIsDisplayed() { + ElementHelper.isElementDisplayed(CdfNameSpaceAdminLocators.pageHeaderNameSpaceAdmin); + } + + /** + * Check whether Create Profile Properties Page is loaded + */ + public static void verifyCreateProfilePageLoaded() { + WaitHelper.waitForElementToBeOptionallyDisplayed(CdfNameSpaceAdminLocators.profilePropertiesPage(), + ConstantsUtil.DEFAULT_TIMEOUT_SECONDS); + } + + /** + * Check whether Profile created is present in System Compute Profile tab + * + * @param profileTitle any specific title created + */ + public static void verifyProvisionerPresentComputeProfile(String profileTitle) { + WaitHelper.waitForElementToBeOptionallyDisplayed(CdfNameSpaceAdminLocators. + locateProfileTitle(PluginPropertyUtils.pluginProp(profileTitle)), + ConstantsUtil.DEFAULT_TIMEOUT_SECONDS); + } +} diff --git a/src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java b/src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java new file mode 100644 index 000000000..54780c242 --- /dev/null +++ b/src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java @@ -0,0 +1,190 @@ +/* + * Copyright © 2023 Cask Data, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package io.cdap.e2e.pages.locators; + +import io.cdap.e2e.utils.SeleniumDriver; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; +import org.openqa.selenium.support.How; + +/** + * Represents CdfNameSpaceAdminLocators + */ +public class CdfNameSpaceAdminLocators { + + @FindBy(how = How.XPATH, using = "//div[contains(text(),'Namespace Admin')]") + public static WebElement namespaceAdminMenu; + + @FindBy(how = How.XPATH, using = "//*[@data-cy='navbar-hamburger-icon']") + public static WebElement hamburgerMenu; + + public static WebElement nameSpaceModules(String module, String nameSpace) { + String path = "//*[@href=\"/cdap/ns/" + nameSpace + "/details/" + module + "\"]"; + return SeleniumDriver.getDriver().findElement(By.xpath(path)); + } + + public static WebElement createProfile(String nameSpace) { + String path = "//*[@href=\"/cdap/ns/" + nameSpace + "/profiles/create\"]"; + return SeleniumDriver.getDriver().findElement(By.xpath(path)); + } + + public static WebElement switchNameSpace(String nameSpace) { + String path = "//*[@href=\"/cdap/ns/'" + nameSpace + "'\"]"; + return SeleniumDriver.getDriver().findElement(By.xpath(path)); + } + + public static WebElement locateMenuLink(String menuLink) { + String xpath = "//*[@data-cy='navbar-" + menuLink + "-link']"; + return SeleniumDriver.getDriver().findElement(By.xpath(xpath)); + } + + public static WebElement locateKeyProperty(String pluginProperty, int row) { + String xpath = "//*[@data-cy='" + pluginProperty + "" + row + "']//input[@placeholder='key']"; + return SeleniumDriver.getDriver().findElement(By.xpath(xpath)); + } + + public static WebElement locateValueProperty(String pluginProperty, int row) { + String xpath = "//*[@data-cy='" + pluginProperty + "" + row + "']//input[@placeholder='value']"; + return SeleniumDriver.getDriver().findElement(By.xpath(xpath)); + } + + public static WebElement locateAddRowButtonProperty(String pluginProperty, int row) { + String xpath = + "//*[@data-cy='" + pluginProperty + "" + row + "']//span" + + "//button[@type='submit' and @class='btn add-row-btn btn-link']"; + return SeleniumDriver.getDriver().findElement(By.xpath(xpath)); + } + + @FindBy(how = How.XPATH, using = "//*[@class='namespace-dropdown']") + public static WebElement namespaceDropdown; + + @FindBy(how = How.XPATH, using = "//div[contains(text(),'Add Namespace')]") + public static WebElement addNamespace; + + @FindBy(how = How.XPATH, using = "//input[@placeholder='Namespace name']") + public static WebElement namespaceName; + + @FindBy(how = How.XPATH, using = "//input[@placeholder='Namespace description' and @type='text']") + public static WebElement namespaceDescription; + + @FindBy(how = How.XPATH, using = "//button[@data-cy='wizard-next-btn']") + public static WebElement clickOnNextButton; + + @FindBy(how = How.XPATH, using = "//button[@data-cy='wizard-finish-btn']") + public static WebElement clickOnFinishButton; + + public static WebElement locateKeyProperty(int row) { + String xpath = "//*[@data-cy= 'key-value-pair-" + row + "']//input[@placeholder='key']"; + return SeleniumDriver.getDriver().findElement(By.xpath(xpath)); + } + + public static WebElement locateValueProperty(int row) { + String xpath = "//*[@data-cy= 'key-value-pair-" + row + "']//input[@placeholder='value']"; + return SeleniumDriver.getDriver().findElement(By.xpath(xpath)); + } + + public static WebElement locateAddRowButtonProperty(int row) { + String xpath = "//*[@data-cy= 'key-value-pair-" + row + "']//span//button[@type='submit' and " + + "@class='btn add-row-btn btn-link']"; + return SeleniumDriver.getDriver().findElement(By.xpath(xpath)); + } + + public static WebElement locateProvisionerInList(String provisionerName) { + return SeleniumDriver.getDriver() + .findElement(By.xpath("//div[@data-cy='" + provisionerName + "']")); + } + + public static WebElement locateButtonType(String buttonType) { + return SeleniumDriver.getDriver() + .findElement(By.xpath("//button[@data-cy='" + buttonType + "']")); + } + + public static By profilePropertiesPage() { + return By.xpath("//h5[contains(text(), 'Create a profile')]"); + } + + public static By locateProfileTitle(String profileName) { + return By.xpath("//div[@title='" + profileName + "']"); + } + + @FindBy(how = How.XPATH, using = "//a[contains(text(),\"Switch to\")]") + public static WebElement switchToCreatedNamespace; + + @FindBy(how = How.XPATH, using = "//a[contains(text(),'Go to homepage')]") + public static WebElement goToHomepage; + + @FindBy(how = How.XPATH, using = "//*[@data-cy='wizard-result-icon-close-btn']") + public static WebElement closeAddNameSpaceWindow; + + @FindBy(how = How.XPATH, using = "//span[@id='setpreferences-fd']") + public static WebElement setPreferencesfromMainMenu; + + @FindBy(how = How.XPATH, using = "//button[@data-testid='save-prefs-btn']") + public static WebElement clickSaveClose; + + @FindBy(how = How.XPATH, using = "//span[contains(text(),'Upload Driver')]") + public static WebElement uploadDriverTab; + + @FindBy(how = How.XPATH, using = "//*[contains(@class,'close')]") + public static WebElement closeUploadDriverWindow; + + @FindBy(how = How.XPATH, using = "//span[contains(text(),'Link Repository')]") + public static WebElement linkRepositoryTab; + + @FindBy(how = How.XPATH, using = "//button[@class=\"MuiButtonBase-root MuiIconButton-root\"]") + public static WebElement closeExternalPage; + + @FindBy(how = How.XPATH, using = "//span[contains(text(),'Add Connection')]") + public static WebElement addConnectionTab; + + @FindBy(how = How.XPATH, using = "//span[contains(text(),'Import')]") + public static WebElement importConnectionTab; + + @FindBy(how = How.XPATH, using = "//span[contains(text(),'Edit')]") + public static WebElement editPreferencesButton; + + @FindBy(how = How.XPATH, using = "//span[contains(text(),'Create Profile')]") + public static WebElement createProfileInNamespaceAdmin; + + @FindBy(how = How.XPATH, using = "//*[contains(text(),'Close')]") + public static WebElement closeButton; + + @FindBy(how = How.XPATH, using = "//span//button[@type='submit' and @class='btn remove-row-btn btn-link']") + public static WebElement clickDelete; + + @FindBy(how = How.XPATH, using = "//span[contains(@class,'reset')]") + public static WebElement clickReset; + + @FindBy(how = How.XPATH, using = "//span[contains(@class,'success reset-success')]") + public static WebElement resetSuccessMsg; + + @FindBy(how = How.XPATH, using = "//div[contains(@class, 'error-section text-danger')]") + public static WebElement errorMessageOnFooter; + + @FindBy(how = How.XPATH, using = "//div[contains(@class, 'card-action-feedback DANGER')]") + public static WebElement failMessage; + + @FindBy(how = How.XPATH, using = "//a[contains(text(),\"Switch to\")]") + public static WebElement switchToNameSpaceButton; + + @FindBy(how = How.XPATH, using = "//div[@class=\"namespace-and-caret\"]") + public static WebElement namespaceText; + + @FindBy(how = How.XPATH, using = "//*[@data-cy='feature-heading'][//div[contains(text(),'Namespace')]]") + public static WebElement pageHeaderNameSpaceAdmin; +} + diff --git a/src/main/java/stepsdesign/NameSpaceadminSteps.java b/src/main/java/stepsdesign/NameSpaceadminSteps.java new file mode 100644 index 000000000..d8d1931cb --- /dev/null +++ b/src/main/java/stepsdesign/NameSpaceadminSteps.java @@ -0,0 +1,163 @@ +/* + * Copyright © 2023 Cask Data, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package stepsdesign; + +import io.cdap.e2e.pages.actions.CdfNameSpaceAdminActions; +import io.cdap.e2e.pages.actions.CdfPluginPropertiesActions; +import io.cdap.e2e.utils.CdfHelper; +import io.cucumber.java.en.Then; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Represents CdfNameSpaceAdminSteps + */ +public class NameSpaceadminSteps implements CdfHelper { + + private static final Logger logger = LoggerFactory.getLogger(NameSpaceadminSteps.class); + + @Then("Click on the Hamburger bar on the left panel") + public static void clickOnTheHamburgerIcon() { + CdfNameSpaceAdminActions.clickOnHamburgerMenu(); + } + + @Then("Click on NameSpace Admin link from the menu") + public void openNameSpaceAdminPage() { + CdfNameSpaceAdminActions.openNamespaceAdminPage(); + } + + @Then("Click on create profile button for {string} Namespace") + public void createProfileinsideNamespaceAdmin(String nameSpace) { + CdfNameSpaceAdminActions.createProfileForNamespace(nameSpace); + } + + @Then("Click {string} tab from Configuration page for {string} Namespace") + public void openNameSpaceAdminPageTabs(String tabName, String nameSpace) { + CdfNameSpaceAdminActions.clickOnNameSpaceAdminTabs(tabName, nameSpace); + } + + @Then("Click on edit namespace preferences to set namespace preferences") + public void clickOnEditNameSpacePreferences() { + CdfNameSpaceAdminActions.clickOnEditPreference(); + } + + @Then("Click on Namespace dropdown button") + public void openNameSpaceDropdown() { + CdfNameSpaceAdminActions.openNamespaceDropdown(); + } + + @Then("Click on the Add Namespace tab") + public void addNamespaceFromHamburgerMenu() { + CdfNameSpaceAdminActions.addNamespaceFromHamburgerMenu(); + } + + @Then("Select navigation item: {string} from the Hamburger menu list") + public void selectNavigationItemFromMenu(String tabName) { + CdfNameSpaceAdminActions.selectHamburgerMenuList(tabName); + } + + @Then("Set namespace preferences with key: {string} and value: {string}") + public void setSystemPreferencesWithKeyAndValue(String pluginProperty, String keyValuePairs) { + CdfNameSpaceAdminActions.enterKeyValuePreferences(pluginProperty, keyValuePairs); + } + + @Then("Click on the Save & Close preferences button") + public void clickOnSaveAndClosePreferencesButton() { + CdfNameSpaceAdminActions.clickOnSavePreference(); + } + + @Then("Select a provisioner: {string} for the compute profile") + public void selectProvisionerForComputeProfile(String provisionerName) { + CdfNameSpaceAdminActions.selectProvisioner(provisionerName); + } + + @Then("Click on close button of compute profile properties page") + public void closeButtonComputeProfile() { + CdfNameSpaceAdminActions.clickCloseButton(); + } + + @Then("Delete the preferences") + public void clickOnDeletePreference() { + CdfNameSpaceAdminActions.deletePreference(); + } + + @Then("Reset the preferences") + public void clickOnResetPreference() { + CdfNameSpaceAdminActions.clickOnResetPreference(); + } + + @Then("Verify the reset is successful for added preferences") + public void verifyIfResetValidatedSuccessfully() { + CdfNameSpaceAdminActions.verifyIfResetValidatedSuccessfully(); + } + + @Then("Click on: {string} button in the properties") + public void clickOnButtonInTheProperties(String buttonType) { + CdfNameSpaceAdminActions.clickCreateButtonComputeProfile(buttonType); + } + + @Then("Verify that the compute profile is displaying an error message: {string} on the footer") + public void verifyErrorMessageDisplayedOnFooter(String errorMessageLocation) { + CdfNameSpaceAdminActions.verifyErrorMessageOnFooter(errorMessageLocation); + } + + @Then("Enter the New Namespace Name with value: {string}") + public void enterNamespaceNameValue(String value) { + CdfNameSpaceAdminActions.enterNamespaceName(value); + } + + @Then("Enter the Namespace Description with value: {string}") + public void enterNamespaceDescriptionValue(String value) { + CdfNameSpaceAdminActions.enterNamespaceDescription(value); + } + + @Then("Verify the failed error message: {string} displayed on dialog box") + public void verifyFailedErrorMessageDisplayedOnDialogBox(String errorMessageLocation) { + CdfNameSpaceAdminActions.verifyFailedErrorMessageOnDialogBox(errorMessageLocation); + } + + @Then("Switch to the newly created Namespace") + public void switchToNewNameSpace() { + CdfNameSpaceAdminActions.switchToNewNameSpace(); + } + + @Then("Verify the namespace is switched to {string} successfully") + public void verifyNameSpaceSwitch(String newNameSpaceName) { + CdfNameSpaceAdminActions.verifySwitchToNewNamespace(newNameSpaceName); + } + + @Then("Add connection type as {string} and provide a {string}") + public void addConnectionInNameSpaceAdmin(String connectionType, String connectionName) { + CdfPluginPropertiesActions.clickPluginPropertyElement(connectionType); + CdfPluginPropertiesActions.enterValueInInputProperty("name", connectionName); + CdfPluginPropertiesActions.replaceValueInInputProperty("projectId", "projectId"); + } + + @Then("Verify if user successfully navigated to namespace admin page") + public void verifyThatNamespacePageIsSuccessfullyOpened() { + CdfNameSpaceAdminActions.verifyElementIsDisplayed(); + } + + @Then("Verify the Create a Profile page is loaded for selected provisioner") + public void verifyTheCreateAProfilePageIsLoaded() { + CdfNameSpaceAdminActions.verifyCreateProfilePageLoaded(); + } + + @Then("Verify the created compute profile: {string} is displayed in system compute profile list") + public void verifyTheCreatedComputeProfile(String profile) { + CdfNameSpaceAdminActions.verifyProvisionerPresentComputeProfile(profile); + } +} From 86c646f177ca23cc9dce5c2763208585685dbd27 Mon Sep 17 00:00:00 2001 From: rahuldash171 Date: Tue, 28 Nov 2023 19:11:31 +0530 Subject: [PATCH 2/4] Addressed review comments --- .../actions/CdfNameSpaceAdminActions.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java b/src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java index 9002e05e4..3a2419da2 100644 --- a/src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java +++ b/src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java @@ -102,10 +102,10 @@ public static void selectHamburgerMenuList(String listName) { * keyValuePair as key */ public static void enterKeyValuePreferences(String preferenceProperty, String keyValuePair) { - String pluginPropertyDataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( + String dataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( preferenceProperty); - if (pluginPropertyDataCyAttribute == null) { - pluginPropertyDataCyAttribute = preferenceProperty; + if (dataCyAttribute == null) { + dataCyAttribute = preferenceProperty; } Map properties = JsonUtils.convertKeyValueJsonArrayToMap(PluginPropertyUtils.pluginProp(keyValuePair)); @@ -113,12 +113,12 @@ public static void enterKeyValuePreferences(String preferenceProperty, String ke for (Map.Entry entry : properties.entrySet()) { if (index != 0) { ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.locateAddRowButtonProperty( - pluginPropertyDataCyAttribute, index - 1)); + dataCyAttribute, index - 1)); } ElementHelper.sendKeys(CdfNameSpaceAdminLocators.locateKeyProperty( - pluginPropertyDataCyAttribute, index), entry.getKey()); + dataCyAttribute, index), entry.getKey()); ElementHelper.sendKeys(CdfNameSpaceAdminLocators.locateValueProperty( - pluginPropertyDataCyAttribute, index), entry.getValue()); + dataCyAttribute, index), entry.getValue()); index++; } } @@ -131,13 +131,13 @@ public static void enterKeyValuePreferences(String preferenceProperty, String ke * fetched from it else Provisioner is used as it is. */ public static void selectProvisioner(String provisionerName) { - String pluginPropertyDataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( + String dataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( provisionerName); - if (pluginPropertyDataCyAttribute == null) { - pluginPropertyDataCyAttribute = provisionerName; + if (dataCyAttribute == null) { + dataCyAttribute = provisionerName; } ElementHelper.clickOnElement( - CdfNameSpaceAdminLocators.locateProvisionerInList(pluginPropertyDataCyAttribute)); + CdfNameSpaceAdminLocators.locateProvisionerInList(dataCyAttribute)); } /** @@ -180,13 +180,13 @@ public static void verifyIfResetValidatedSuccessfully() { * fetched from it else type of action is used as it is. */ public static void clickCreateButtonComputeProfile(String buttonType) { - String pluginPropertyDataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( + String dataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( buttonType); - if (pluginPropertyDataCyAttribute == null) { - pluginPropertyDataCyAttribute = buttonType; + if (dataCyAttribute == null) { + dataCyAttribute = buttonType; } ElementHelper.clickOnElement( - CdfNameSpaceAdminLocators.locateButtonType(pluginPropertyDataCyAttribute)); + CdfNameSpaceAdminLocators.locateButtonType(dataCyAttribute)); } /** From 11d67dee04799e7ae0d9886ce844d9e9e9d657b4 Mon Sep 17 00:00:00 2001 From: rahuldash171 Date: Wed, 29 Nov 2023 12:07:59 +0530 Subject: [PATCH 3/4] Addressed review comments and most of the repeated actions/step/locators were removed which were common in Sys admin and Namespace admin . Sys admin FW PR is merged --- .../actions/CdfNameSpaceAdminActions.java | 156 +----------------- .../locators/CdfNameSpaceAdminLocators.java | 30 ---- .../java/stepsdesign/NameSpaceadminSteps.java | 77 +-------- 3 files changed, 2 insertions(+), 261 deletions(-) diff --git a/src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java b/src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java index 3a2419da2..75b511899 100644 --- a/src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java +++ b/src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java @@ -16,6 +16,7 @@ package io.cdap.e2e.pages.actions; import io.cdap.e2e.pages.locators.CdfNameSpaceAdminLocators; +import io.cdap.e2e.pages.locators.CdfSysAdminLocators; import io.cdap.e2e.utils.AssertionHelper; import io.cdap.e2e.utils.ConstantsUtil; import io.cdap.e2e.utils.ElementHelper; @@ -53,10 +54,6 @@ public static void clickOnHamburgerMenu() { ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.hamburgerMenu); } - public static void clickOnEditPreference() { - ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.editPreferencesButton); - } - public static void switchToNameSpace(String nameSpaceName) { ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.switchNameSpace(nameSpaceName)); } @@ -73,23 +70,6 @@ public static void addNamespaceFromHamburgerMenu() { ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.addNamespace); } - /** - * Click on Save and Close button to save preference - */ - public static void clickOnSavePreference() { - ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.clickSaveClose); - } - - public static void selectHamburgerMenuList(String listName) { - String pluginPropertyDataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( - listName); - if (pluginPropertyDataCyAttribute == null) { - pluginPropertyDataCyAttribute = listName; - } - ElementHelper.clickOnElement( - CdfNameSpaceAdminLocators.locateMenuLink(pluginPropertyDataCyAttribute)); - } - /** * Enter KeyValue Pairs For Preference Property * @@ -123,121 +103,6 @@ public static void enterKeyValuePreferences(String preferenceProperty, String ke } } - /** - * Select on the type of Provisioner from list for Compute Profile in system admin - * - * @param provisionerName @data-cy attribute value of Provisioner. If Provisioner is present in - * {@link ConstantsUtil#DEFAULT_DATACY_ATTRIBUTES_FILE} then its data-cy is - * fetched from it else Provisioner is used as it is. - */ - public static void selectProvisioner(String provisionerName) { - String dataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( - provisionerName); - if (dataCyAttribute == null) { - dataCyAttribute = provisionerName; - } - ElementHelper.clickOnElement( - CdfNameSpaceAdminLocators.locateProvisionerInList(dataCyAttribute)); - } - - /** - * Click on the Close button in compute profile properties page - */ - public static void clickCloseButton() { - ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.closeButton); - } - - /** - * Click on Delete to delete preference - */ - public static void deletePreference() { - ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.clickDelete); - } - - /** - * Click on Reset button to reset preference - */ - public static void clickOnResetPreference() { - ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.clickReset); - } - - /** - * Verify if the added Preferences reset is successful - */ - public static void verifyIfResetValidatedSuccessfully() { - WaitHelper.waitForElementToBeDisplayed(CdfNameSpaceAdminLocators.resetSuccessMsg); - String expectedMessage = PluginPropertyUtils.errorProp( - ConstantsUtil.RESET_VALIDATION_SUCCESS_MESSAGE); - AssertionHelper.verifyElementContainsText( - CdfNameSpaceAdminLocators.resetSuccessMsg, expectedMessage); - } - - /** - * Click on type of button to create Compute Profile in system admin - * - * @param buttonType @data-cy attribute value of button. If type of action is present in - * {@link ConstantsUtil#DEFAULT_DATACY_ATTRIBUTES_FILE} then its data-cy is - * fetched from it else type of action is used as it is. - */ - public static void clickCreateButtonComputeProfile(String buttonType) { - String dataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute( - buttonType); - if (dataCyAttribute == null) { - dataCyAttribute = buttonType; - } - ElementHelper.clickOnElement( - CdfNameSpaceAdminLocators.locateButtonType(dataCyAttribute)); - } - - /** - * Verify Error message displayed on the footer/at the bottom of Compute Profile Properties page - * using the Error message location in the .properties file - * {@link ConstantsUtil#DEFAULT_ERROR_PROPERTIES_FILE} - * - * @param errorMessageLocation Expected error message location - */ - public static void verifyErrorMessageOnFooter(String errorMessageLocation) { - String expectedErrorMessage = PluginPropertyUtils.errorProp(errorMessageLocation); - AssertionHelper.verifyElementContainsText(CdfNameSpaceAdminLocators.errorMessageOnFooter, - expectedErrorMessage); - } - - /** - * Enter NamespaceName value in Add namespace - * - * @param value If value is present in {@link ConstantsUtil#DEFAULT_PLUGIN_PROPERTIES_FILE} as a - * key then its value is fetched from it else value is entered in the input as it - * is. - */ - public static void enterNamespaceName(String value) { - ElementHelper.sendKeys(CdfNameSpaceAdminLocators.namespaceName, - PluginPropertyUtils.pluginProp(value)); - } - - /** - * Enter NamespaceDescription value in Add namespace - * - * @param value If value is present in {@link ConstantsUtil#DEFAULT_PLUGIN_PROPERTIES_FILE} as a - * key then its value is fetched from it else value is entered in the input as it - * is. - */ - public static void enterNamespaceDescription(String value) { - ElementHelper.sendKeys(CdfNameSpaceAdminLocators.namespaceDescription, - PluginPropertyUtils.pluginProp(value)); - } - - /** - * Verify Error message displayed on the dialog box using the Error message location in the - * .properties file {@link ConstantsUtil#DEFAULT_ERROR_PROPERTIES_FILE} - * - * @param errorMessageLocation Expected error message location - */ - public static void verifyFailedErrorMessageOnDialogBox(String errorMessageLocation) { - String expectedErrorMessage = PluginPropertyUtils.errorProp(errorMessageLocation); - AssertionHelper.verifyElementContainsText(CdfNameSpaceAdminLocators.failMessage, - expectedErrorMessage); - } - public static void switchToNewNameSpace() { ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.switchToNameSpaceButton); } @@ -251,23 +116,4 @@ public static void verifySwitchToNewNamespace(String value) { public static void verifyElementIsDisplayed() { ElementHelper.isElementDisplayed(CdfNameSpaceAdminLocators.pageHeaderNameSpaceAdmin); } - - /** - * Check whether Create Profile Properties Page is loaded - */ - public static void verifyCreateProfilePageLoaded() { - WaitHelper.waitForElementToBeOptionallyDisplayed(CdfNameSpaceAdminLocators.profilePropertiesPage(), - ConstantsUtil.DEFAULT_TIMEOUT_SECONDS); - } - - /** - * Check whether Profile created is present in System Compute Profile tab - * - * @param profileTitle any specific title created - */ - public static void verifyProvisionerPresentComputeProfile(String profileTitle) { - WaitHelper.waitForElementToBeOptionallyDisplayed(CdfNameSpaceAdminLocators. - locateProfileTitle(PluginPropertyUtils.pluginProp(profileTitle)), - ConstantsUtil.DEFAULT_TIMEOUT_SECONDS); - } } diff --git a/src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java b/src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java index 54780c242..5a04aa38b 100644 --- a/src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java +++ b/src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java @@ -75,12 +75,6 @@ public static WebElement locateAddRowButtonProperty(String pluginProperty, int r @FindBy(how = How.XPATH, using = "//div[contains(text(),'Add Namespace')]") public static WebElement addNamespace; - @FindBy(how = How.XPATH, using = "//input[@placeholder='Namespace name']") - public static WebElement namespaceName; - - @FindBy(how = How.XPATH, using = "//input[@placeholder='Namespace description' and @type='text']") - public static WebElement namespaceDescription; - @FindBy(how = How.XPATH, using = "//button[@data-cy='wizard-next-btn']") public static WebElement clickOnNextButton; @@ -133,9 +127,6 @@ public static By locateProfileTitle(String profileName) { @FindBy(how = How.XPATH, using = "//span[@id='setpreferences-fd']") public static WebElement setPreferencesfromMainMenu; - @FindBy(how = How.XPATH, using = "//button[@data-testid='save-prefs-btn']") - public static WebElement clickSaveClose; - @FindBy(how = How.XPATH, using = "//span[contains(text(),'Upload Driver')]") public static WebElement uploadDriverTab; @@ -154,30 +145,9 @@ public static By locateProfileTitle(String profileName) { @FindBy(how = How.XPATH, using = "//span[contains(text(),'Import')]") public static WebElement importConnectionTab; - @FindBy(how = How.XPATH, using = "//span[contains(text(),'Edit')]") - public static WebElement editPreferencesButton; - @FindBy(how = How.XPATH, using = "//span[contains(text(),'Create Profile')]") public static WebElement createProfileInNamespaceAdmin; - @FindBy(how = How.XPATH, using = "//*[contains(text(),'Close')]") - public static WebElement closeButton; - - @FindBy(how = How.XPATH, using = "//span//button[@type='submit' and @class='btn remove-row-btn btn-link']") - public static WebElement clickDelete; - - @FindBy(how = How.XPATH, using = "//span[contains(@class,'reset')]") - public static WebElement clickReset; - - @FindBy(how = How.XPATH, using = "//span[contains(@class,'success reset-success')]") - public static WebElement resetSuccessMsg; - - @FindBy(how = How.XPATH, using = "//div[contains(@class, 'error-section text-danger')]") - public static WebElement errorMessageOnFooter; - - @FindBy(how = How.XPATH, using = "//div[contains(@class, 'card-action-feedback DANGER')]") - public static WebElement failMessage; - @FindBy(how = How.XPATH, using = "//a[contains(text(),\"Switch to\")]") public static WebElement switchToNameSpaceButton; diff --git a/src/main/java/stepsdesign/NameSpaceadminSteps.java b/src/main/java/stepsdesign/NameSpaceadminSteps.java index d8d1931cb..cc94a7204 100644 --- a/src/main/java/stepsdesign/NameSpaceadminSteps.java +++ b/src/main/java/stepsdesign/NameSpaceadminSteps.java @@ -44,16 +44,11 @@ public void createProfileinsideNamespaceAdmin(String nameSpace) { CdfNameSpaceAdminActions.createProfileForNamespace(nameSpace); } - @Then("Click {string} tab from Configuration page for {string} Namespace") + @Then("Go to {string} tab from Configuration page for {string} Namespace") public void openNameSpaceAdminPageTabs(String tabName, String nameSpace) { CdfNameSpaceAdminActions.clickOnNameSpaceAdminTabs(tabName, nameSpace); } - @Then("Click on edit namespace preferences to set namespace preferences") - public void clickOnEditNameSpacePreferences() { - CdfNameSpaceAdminActions.clickOnEditPreference(); - } - @Then("Click on Namespace dropdown button") public void openNameSpaceDropdown() { CdfNameSpaceAdminActions.openNamespaceDropdown(); @@ -64,71 +59,11 @@ public void addNamespaceFromHamburgerMenu() { CdfNameSpaceAdminActions.addNamespaceFromHamburgerMenu(); } - @Then("Select navigation item: {string} from the Hamburger menu list") - public void selectNavigationItemFromMenu(String tabName) { - CdfNameSpaceAdminActions.selectHamburgerMenuList(tabName); - } - @Then("Set namespace preferences with key: {string} and value: {string}") public void setSystemPreferencesWithKeyAndValue(String pluginProperty, String keyValuePairs) { CdfNameSpaceAdminActions.enterKeyValuePreferences(pluginProperty, keyValuePairs); } - @Then("Click on the Save & Close preferences button") - public void clickOnSaveAndClosePreferencesButton() { - CdfNameSpaceAdminActions.clickOnSavePreference(); - } - - @Then("Select a provisioner: {string} for the compute profile") - public void selectProvisionerForComputeProfile(String provisionerName) { - CdfNameSpaceAdminActions.selectProvisioner(provisionerName); - } - - @Then("Click on close button of compute profile properties page") - public void closeButtonComputeProfile() { - CdfNameSpaceAdminActions.clickCloseButton(); - } - - @Then("Delete the preferences") - public void clickOnDeletePreference() { - CdfNameSpaceAdminActions.deletePreference(); - } - - @Then("Reset the preferences") - public void clickOnResetPreference() { - CdfNameSpaceAdminActions.clickOnResetPreference(); - } - - @Then("Verify the reset is successful for added preferences") - public void verifyIfResetValidatedSuccessfully() { - CdfNameSpaceAdminActions.verifyIfResetValidatedSuccessfully(); - } - - @Then("Click on: {string} button in the properties") - public void clickOnButtonInTheProperties(String buttonType) { - CdfNameSpaceAdminActions.clickCreateButtonComputeProfile(buttonType); - } - - @Then("Verify that the compute profile is displaying an error message: {string} on the footer") - public void verifyErrorMessageDisplayedOnFooter(String errorMessageLocation) { - CdfNameSpaceAdminActions.verifyErrorMessageOnFooter(errorMessageLocation); - } - - @Then("Enter the New Namespace Name with value: {string}") - public void enterNamespaceNameValue(String value) { - CdfNameSpaceAdminActions.enterNamespaceName(value); - } - - @Then("Enter the Namespace Description with value: {string}") - public void enterNamespaceDescriptionValue(String value) { - CdfNameSpaceAdminActions.enterNamespaceDescription(value); - } - - @Then("Verify the failed error message: {string} displayed on dialog box") - public void verifyFailedErrorMessageDisplayedOnDialogBox(String errorMessageLocation) { - CdfNameSpaceAdminActions.verifyFailedErrorMessageOnDialogBox(errorMessageLocation); - } - @Then("Switch to the newly created Namespace") public void switchToNewNameSpace() { CdfNameSpaceAdminActions.switchToNewNameSpace(); @@ -150,14 +85,4 @@ public void addConnectionInNameSpaceAdmin(String connectionType, String connecti public void verifyThatNamespacePageIsSuccessfullyOpened() { CdfNameSpaceAdminActions.verifyElementIsDisplayed(); } - - @Then("Verify the Create a Profile page is loaded for selected provisioner") - public void verifyTheCreateAProfilePageIsLoaded() { - CdfNameSpaceAdminActions.verifyCreateProfilePageLoaded(); - } - - @Then("Verify the created compute profile: {string} is displayed in system compute profile list") - public void verifyTheCreatedComputeProfile(String profile) { - CdfNameSpaceAdminActions.verifyProvisionerPresentComputeProfile(profile); - } } From c5b3b1035100ce16d42519208de3b955b3c41bf3 Mon Sep 17 00:00:00 2001 From: rahuldash171 Date: Wed, 29 Nov 2023 16:48:00 +0530 Subject: [PATCH 4/4] Renamed the texts pluginProperty to correct naming . --- .../pages/locators/CdfNameSpaceAdminLocators.java | 12 ++++++------ src/main/java/stepsdesign/NameSpaceadminSteps.java | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java b/src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java index 5a04aa38b..6f38f818d 100644 --- a/src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java +++ b/src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java @@ -52,19 +52,19 @@ public static WebElement locateMenuLink(String menuLink) { return SeleniumDriver.getDriver().findElement(By.xpath(xpath)); } - public static WebElement locateKeyProperty(String pluginProperty, int row) { - String xpath = "//*[@data-cy='" + pluginProperty + "" + row + "']//input[@placeholder='key']"; + public static WebElement locateKeyProperty(String keyProperty, int row) { + String xpath = "//*[@data-cy='" + keyProperty + "" + row + "']//input[@placeholder='key']"; return SeleniumDriver.getDriver().findElement(By.xpath(xpath)); } - public static WebElement locateValueProperty(String pluginProperty, int row) { - String xpath = "//*[@data-cy='" + pluginProperty + "" + row + "']//input[@placeholder='value']"; + public static WebElement locateValueProperty(String valueProperty, int row) { + String xpath = "//*[@data-cy='" + valueProperty + "" + row + "']//input[@placeholder='value']"; return SeleniumDriver.getDriver().findElement(By.xpath(xpath)); } - public static WebElement locateAddRowButtonProperty(String pluginProperty, int row) { + public static WebElement locateAddRowButtonProperty(String addRowProperty, int row) { String xpath = - "//*[@data-cy='" + pluginProperty + "" + row + "']//span" + "//*[@data-cy='" + addRowProperty + "" + row + "']//span" + "//button[@type='submit' and @class='btn add-row-btn btn-link']"; return SeleniumDriver.getDriver().findElement(By.xpath(xpath)); } diff --git a/src/main/java/stepsdesign/NameSpaceadminSteps.java b/src/main/java/stepsdesign/NameSpaceadminSteps.java index cc94a7204..746754479 100644 --- a/src/main/java/stepsdesign/NameSpaceadminSteps.java +++ b/src/main/java/stepsdesign/NameSpaceadminSteps.java @@ -60,8 +60,8 @@ public void addNamespaceFromHamburgerMenu() { } @Then("Set namespace preferences with key: {string} and value: {string}") - public void setSystemPreferencesWithKeyAndValue(String pluginProperty, String keyValuePairs) { - CdfNameSpaceAdminActions.enterKeyValuePreferences(pluginProperty, keyValuePairs); + public void setNamespacePreferencesWithKeyAndValue(String keyProperty, String keyValuePairs) { + CdfNameSpaceAdminActions.enterKeyValuePreferences(keyProperty, keyValuePairs); } @Then("Switch to the newly created Namespace")