Skip to content

Commit

Permalink
addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkitCLI committed Oct 25, 2023
1 parent 107421d commit 5134bfe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
11 changes: 6 additions & 5 deletions src/main/java/io/cdap/e2e/pages/actions/CdfHubActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,29 @@ public static void clickOnFinish() {
public static void clickOnOptions(String option) {
ElementHelper.clickOnElement(CdfHubLocators.locateOptions(option));
}
public static void clickOnCLoseButton() {
public static void clickOnCloseButton() {
ElementHelper.clickOnElement(CdfHubLocators.closeButton);
}
public static void clickOnSearchTab(String message) {
ElementHelper.sendKeys(CdfHubLocators.searchTab, message);
}
public static void clickOnSearch(String pluginName) {
ElementHelper.sendKeys(CdfHubLocators.searchTabControlCenter, pluginName);
}
public static void verifyErrorMessageOnHeader(String errorMessageLocation) {
String expectedErrorMessage = PluginPropertyUtils.errorProp(errorMessageLocation);
AssertionHelper.verifyElementContainsText(CdfHubLocators.errorMessage, expectedErrorMessage);
}
public static void verifyElementIsDisplayed() {
ElementHelper.isElementDisplayed(CdfHubLocators.locateHub);
}
public static void verifyPluginIsDeleted() {
ElementHelper.isElementDisplayed(CdfHubLocators.verifyDelete);
}
public static void clickOnDeleteButton() {
ElementHelper.clickIfDisplayed(CdfHubLocators.clickOnDeleteButton());
ElementHelper.clickOnElement(CdfHubLocators.deleteButton());
}
public static void deletePluginControlCenter() {
ElementHelper.clickOnElement(CdfHubLocators.deleteIconControlCenter);
clickOnDeleteButton();
verifyPluginIsDeleted();
}
public static void verifyPluginIsDeployed(String pluginName) {
String pluginPropertyDataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute(pluginName);
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/io/cdap/e2e/pages/locators/CdfHubLocators.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ public class CdfHubLocators {

@FindBy(how = How.XPATH, using = "//input[@class='search-input form-control'][@placeholder='Search by name']")
public static WebElement searchTab;
@FindBy(how = How.XPATH, using = "//input[@class='search-input form-control'][@placeholder='Search']")
public static WebElement searchTabControlCenter;
@FindBy(how = How.XPATH, using = "//div[@data-cy='hub-close-btn']")
@FindBy(how = How.XPATH, using = "//*[@data-cy='hub-close-btn']")
public static WebElement closeButton;
@FindBy(how = How.XPATH, using = "//button[@data-cy='one_step_deploy_plugin-btn']")
public static WebElement deployButton;
Expand All @@ -44,6 +42,8 @@ public class CdfHubLocators {
public static WebElement toHomePage;
@FindBy(how = How.XPATH, using = "//button[@id='navbar-hub']")
public static WebElement hubPage;
@FindBy(how = How.XPATH, using = "//*[contains(text(),'No entities found in namespace \"default\"')]")
public static WebElement verifyDelete;
@FindBy(how = How.XPATH, using = "//div[@class='just-added-entities-list']//button[@class='btn btn-link']" +
"//*[@class='icon-svg icon-trash']")
public static WebElement deleteIconControlCenter;
Expand All @@ -60,7 +60,8 @@ public static WebElement locatePluginName(String pluginName) {
return SeleniumDriver.getDriver().findElement(By.xpath("//*[contains(text(),'" + pluginName + "')]"));
}

public static By clickOnDeleteButton() {
return By.xpath("//button[@class='btn btn-primary'][//button[@data-cy='Delete']]");
public static WebElement deleteButton() {
return SeleniumDriver.getDriver().findElement(By.xpath("//button[@class='btn btn-primary']" +
"[//button[@data-cy='Delete']]"));
}
}
6 changes: 1 addition & 5 deletions src/main/java/stepsdesign/CdfHubSteps.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void openOptions(String option) {
}
@Then("Click on close button")
public static void closeButton() {
CdfHubActions.clickOnCLoseButton();
CdfHubActions.clickOnCloseButton();
}
@Then("Deploy the plugin")
public static void deployPlugin() {
Expand All @@ -58,10 +58,6 @@ public static void deployPlugin() {
public static void openSearch(String value) {
CdfHubActions.clickOnSearchTab(value);
}
@Then("Enter the text in search tab in control center {string}")
public static void openSearchControlCenter(String value) {
CdfHubActions.clickOnSearch(value);
}
@Then("Verify that search displaying an error message: {string} on the header")
public void verifyErrorMessageDisplayedOnPluginHeader(String errorMessageLocation) {
CdfHubActions.verifyErrorMessageOnHeader(errorMessageLocation);
Expand Down

0 comments on commit 5134bfe

Please sign in to comment.