forked from cdapio/cdap-e2e-tests
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa28114
commit 4aa87ac
Showing
3 changed files
with
201 additions
and
0 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
src/main/java/io/cdap/e2e/pages/actions/CdfControlCenterActions.java
This file contains 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,77 @@ | ||
/* | ||
* 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.CdfControlCenterLocators; | ||
import io.cdap.e2e.utils.ElementHelper; | ||
import io.cdap.e2e.utils.SeleniumHelper; | ||
import io.cdap.e2e.utils.WaitHelper; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import stepsdesign.PipelineSteps; | ||
|
||
/** | ||
* Represents CdfControlCenterActions | ||
*/ | ||
|
||
public class CdfControlCenterActions { | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(CdfControlCenterActions.class); | ||
public static CdfControlCenterLocators cdfNameSpaceAdminLocators; | ||
|
||
static { | ||
cdfNameSpaceAdminLocators = SeleniumHelper.getPropertiesLocators( | ||
CdfControlCenterLocators.class); | ||
} | ||
|
||
public static void clickOnHamburgerMenu() { | ||
ElementHelper.clickOnElement(CdfControlCenterLocators.hamburgerMenu); | ||
} | ||
|
||
public static void clickOnControlCenterTab() { | ||
ElementHelper.clickOnElement(CdfControlCenterLocators.controlCenterMenu); | ||
} | ||
|
||
public static void navigateToControlCenter() { | ||
ElementHelper.clickOnElement(CdfControlCenterLocators.pageHeaderControlCenter); | ||
} | ||
|
||
public static void clickOnCreateButtonControlCenterPage() { | ||
ElementHelper.clickOnElement(CdfControlCenterLocators.createButtonControlCenter); | ||
} | ||
|
||
public static void pipelinePresentControlCenterPage() { | ||
ElementHelper.clickOnElement(CdfControlCenterLocators.dataPipelineControlCenter); | ||
} | ||
|
||
public static void clickOnDeleteButtonOnConfirmationBox() { | ||
ElementHelper.clickIfDisplayed(CdfControlCenterLocators.clickOnDeleteButton()); | ||
} | ||
|
||
public static void deletePipelineControlCenter() { | ||
ElementHelper.clickOnElement(CdfControlCenterLocators.deleteIconControlCenter); | ||
clickOnDeleteButtonOnConfirmationBox(); | ||
} | ||
|
||
public static void pipelineDeletedIsNotPresent() { | ||
clickOnSearchTabControlCenter(PipelineSteps.pipelineName); | ||
ElementHelper.isElementDisplayed(CdfControlCenterLocators.pipelineDeletedMessage); | ||
} | ||
|
||
public static void clickOnSearchTabControlCenter(String message) { | ||
ElementHelper.sendKeys(CdfControlCenterLocators.searchTabControlCenter, message); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/main/java/io/cdap/e2e/pages/locators/CdfControlCenterLocators.java
This file contains 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,58 @@ | ||
/* | ||
* 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 org.openqa.selenium.By; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
import org.openqa.selenium.support.How; | ||
|
||
/** | ||
* Represents CdfControlCenterLocators | ||
*/ | ||
|
||
public class CdfControlCenterLocators { | ||
|
||
@FindBy(how = How.XPATH, using = "//*[@data-cy='navbar-hamburger-icon']") | ||
public static WebElement hamburgerMenu; | ||
|
||
@FindBy(how = How.XPATH, using = "//*[@data-cy='navbar-control-center-link']") | ||
public static WebElement controlCenterMenu; | ||
|
||
@FindBy(how = How.XPATH, using = "//*[@data-cy='feature-heading'][//div[contains(text(),'Control Center')]]") | ||
public static WebElement pageHeaderControlCenter; | ||
|
||
@FindBy(how = How.XPATH, using = "//*[@id='create-pipeline-link']") | ||
public static WebElement createButtonControlCenter; | ||
|
||
@FindBy(how = How.XPATH, using = "//span[@class='entity-type'][//span[contains(text(),'Data Pipeline')]]") | ||
public static WebElement dataPipelineControlCenter; | ||
|
||
@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; | ||
|
||
public static By clickOnDeleteButton() { | ||
return By.xpath("//button[@class='btn btn-primary'][//button[@data-cy='Delete']]"); | ||
} | ||
|
||
@FindBy(how = How.XPATH, using = "//div[@class='empty-message-container']") | ||
public static WebElement pipelineDeletedMessage; | ||
|
||
@FindBy(how = How.XPATH, using = "//input[@class='search-input form-control'][@placeholder='Search']") | ||
public static WebElement searchTabControlCenter; | ||
} |
This file contains 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,66 @@ | ||
/* | ||
* 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.CdfControlCenterActions; | ||
import io.cdap.e2e.utils.CdfHelper; | ||
import io.cucumber.java.en.Then; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Represents CdfControlCenterSteps | ||
*/ | ||
public class ControlCenterSteps implements CdfHelper { | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(ControlCenterSteps.class); | ||
|
||
@Then("Click on the Hamburger bar on the left panel") | ||
public static void clickOnTheHamburgerIcon() { | ||
CdfControlCenterActions.clickOnHamburgerMenu(); | ||
} | ||
|
||
@Then("Click on Control Center link from the hamburger menu") | ||
public void openControlCenterPage() { | ||
CdfControlCenterActions.clickOnControlCenterTab(); | ||
} | ||
|
||
@Then("Verify that the user is navigated to control center page successfully") | ||
public void navigateControlCenterPage() { | ||
CdfControlCenterActions.navigateToControlCenter(); | ||
} | ||
|
||
@Then("Verify user is able to click on the create button to create a pipeline successfully") | ||
public void createButtonControlCenterPage() { | ||
CdfControlCenterActions.clickOnCreateButtonControlCenterPage(); | ||
} | ||
|
||
@Then("Verify the pipeline created successfully is present in control center page") | ||
public void pipelinePresentControlCenterPage() { | ||
CdfControlCenterActions.pipelinePresentControlCenterPage(); | ||
} | ||
|
||
@Then("Click on the delete icon of the created pipeline and pipeline should get deleted successfully") | ||
public void deleteControlCenterPipeline() { | ||
CdfControlCenterActions.deletePipelineControlCenter(); | ||
} | ||
|
||
@Then("Verify the deleted pipeline is not present in the control center page") | ||
public void pipelineDeletedIsNotPresent() { | ||
CdfControlCenterActions.pipelineDeletedIsNotPresent(); | ||
} | ||
} |