-
Notifications
You must be signed in to change notification settings - Fork 2
new sysadmin locators, actions and steps definition #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,8 @@ | |
|
|
||
| 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; | ||
|
|
@@ -51,4 +53,47 @@ public class CdfSysAdminLocators { | |
|
|
||
| @FindBy(how = How.XPATH, using = "//*[@data-cy='Clear All']") | ||
| public static WebElement clearAll; | ||
|
|
||
| @FindBy(how = How.XPATH, using = "//*[@data-cy='wizard-result-icon-close-btn']") | ||
| public static WebElement clickOnCloseNamespaceWindow; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove using click while defining locators , click/sendKeys are user functions which we can use in methods but not in while declaring locators . the naming should be like CloseNamespaceWindowButton .
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change done in final PR and in this as well. |
||
|
|
||
| public static WebElement namespaceAdded(String nameSpace) { | ||
| String path = "//*[@href=\"/cdap/ns/" + nameSpace + "/details\"]"; | ||
| return SeleniumDriver.getDriver().findElement(By.xpath(path)); | ||
| } | ||
|
|
||
| @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 = "//a[@href='/cdap/httpexecutor']") //remove later | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this comment in final code Or specify a proper comment
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed here and also In Final PR code while merging this is removed. |
||
| public static WebElement makeHttpCall; | ||
|
|
||
| @FindBy(how = How.XPATH, using = "//span[contains(@title, 'Successfully created the namespace')] ") | ||
| public static WebElement locateNameSpaceSuccessMessage; | ||
|
|
||
| @FindBy(how = How.XPATH, using = "//span[contains(text(),'Edit')]") | ||
| public static WebElement editPreferencesButton; | ||
|
|
||
| @FindBy(how = How.XPATH, using = "//*[@data-cy='navbar-hamburger-icon']") | ||
| public static WebElement hamburgerMenu; | ||
|
|
||
| public static WebElement locateMenuLink(String menuLink) { | ||
| String xpath = "//*[@data-cy='navbar-" + menuLink + "-link']"; | ||
| return SeleniumDriver.getDriver().findElement(By.xpath(xpath)); | ||
| } | ||
|
|
||
| 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 By locateDropdownItem(String option) { | ||
| return By.xpath("//select//option[@value='" + option + "']"); | ||
| } | ||
|
|
||
| @FindBy(how = How.XPATH, using = "//*[@data-cy='request-method-selector']") | ||
| public static WebElement requestMethod; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| /* | ||
| * 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.CdfSysAdminActions; | ||
| import io.cdap.e2e.utils.CdfHelper; | ||
| import io.cucumber.java.en.Then; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| /** | ||
| * CDF sysadmin related step design. | ||
| */ | ||
| public class SysadminSteps implements CdfHelper { | ||
|
|
||
| private static final Logger logger = LoggerFactory.getLogger(SysadminSteps.class); | ||
|
|
||
| @Then("Verify the namespace created success message displayed on confirmation window") | ||
| public void verifyNamespaceCreatedSuccessMessageDisplayed() { | ||
| CdfSysAdminActions.namespaceCreatedSuccessMessage(); | ||
| } | ||
|
|
||
| @Then("Verify the created namespace: {string} is displayed in Namespace tab") | ||
| public void verifyCreatedNamespaceIsDisplayed(String namespace) { | ||
| CdfSysAdminActions.verifyCreatedNamespaceIsDisplayed(namespace); | ||
| } | ||
|
|
||
| @Then("Click on close icon of successful namespace confirmation window") | ||
| public void closeWindowIcon() { | ||
| CdfSysAdminActions.clickOnCloseIconOnNamespaceWindow(); | ||
| } | ||
|
|
||
| @Then("Click on Make HTTP calls from the System admin configuration page") | ||
| public void clickOnMakeHttpCalls() { | ||
| CdfSysAdminActions.clickOnMakeHttpCalls(); | ||
| } | ||
|
|
||
| @Then("Click on send button") | ||
| public void clickOnSendButton() { | ||
| CdfSysAdminActions.sendRequest(); | ||
| } | ||
|
|
||
| @Then("Verify the status code for success response") | ||
| public void verifyStatusCode() { | ||
| CdfSysAdminActions.verifySuccess(); | ||
| } | ||
|
|
||
| @Then("Click on edit namespace preferences to set namespace preferences") | ||
| public void clickOnEditNameSpacePreferences() { | ||
| CdfSysAdminActions.clickOnEditNamespacePreference(); | ||
| } | ||
|
|
||
| @Then("Click on the Hamburger menu on the left panel") | ||
| public static void clickOnTheHamburgerMenu() { | ||
| CdfSysAdminActions.clickOnHamburgerMenu(); | ||
| } | ||
|
|
||
| @Then("Click {string} tab from Configuration page for {string} Namespace") | ||
| public void openNameSpaceAdminPageTabs(String tabName, String nameSpace) { | ||
| CdfSysAdminActions.clickOnNameSpaceAdminTabs(tabName, nameSpace); | ||
| } | ||
|
|
||
| @Then("Select navigation item: {string} from the Hamburger menu list") | ||
| public void selectNavigationItemFromMenu(String tabName) { | ||
| CdfSysAdminActions.selectHamburgerMenuList(tabName); | ||
| } | ||
|
|
||
| @Then("Click on the switch to namespace button") | ||
| public static void clickOnTheSwitchToButton() { | ||
| CdfSysAdminActions.clickOnSwitchToButton(); | ||
| } | ||
|
|
||
| @Then("Select request dropdown property with option value: {string}") | ||
| public void selectDropdownPluginPropertyOptionValue(String option) { | ||
| CdfSysAdminActions.selectRequestDropdownOption(option); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change
objSelecttoselectRequestMethodThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to selectRequestMethod