forked from cdapio/cdap-e2e-tests
-
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
Open
itsmekumari
wants to merge
3
commits into
develop
Choose a base branch
from
e2e_sysadmin
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
|
|
||
| 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; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 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 .
Uh oh!
There was an error while loading. Please reload this page.
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.
Change done in final PR and in this as well.