Skip to content

Commit 4aa87ac

Browse files
control center framework steps
1 parent fa28114 commit 4aa87ac

3 files changed

Lines changed: 201 additions & 0 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Copyright © 2023 Cask Data, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package io.cdap.e2e.pages.actions;
17+
18+
import io.cdap.e2e.pages.locators.CdfControlCenterLocators;
19+
import io.cdap.e2e.utils.ElementHelper;
20+
import io.cdap.e2e.utils.SeleniumHelper;
21+
import io.cdap.e2e.utils.WaitHelper;
22+
import org.slf4j.Logger;
23+
import org.slf4j.LoggerFactory;
24+
import stepsdesign.PipelineSteps;
25+
26+
/**
27+
* Represents CdfControlCenterActions
28+
*/
29+
30+
public class CdfControlCenterActions {
31+
32+
private static final Logger logger = LoggerFactory.getLogger(CdfControlCenterActions.class);
33+
public static CdfControlCenterLocators cdfNameSpaceAdminLocators;
34+
35+
static {
36+
cdfNameSpaceAdminLocators = SeleniumHelper.getPropertiesLocators(
37+
CdfControlCenterLocators.class);
38+
}
39+
40+
public static void clickOnHamburgerMenu() {
41+
ElementHelper.clickOnElement(CdfControlCenterLocators.hamburgerMenu);
42+
}
43+
44+
public static void clickOnControlCenterTab() {
45+
ElementHelper.clickOnElement(CdfControlCenterLocators.controlCenterMenu);
46+
}
47+
48+
public static void navigateToControlCenter() {
49+
ElementHelper.clickOnElement(CdfControlCenterLocators.pageHeaderControlCenter);
50+
}
51+
52+
public static void clickOnCreateButtonControlCenterPage() {
53+
ElementHelper.clickOnElement(CdfControlCenterLocators.createButtonControlCenter);
54+
}
55+
56+
public static void pipelinePresentControlCenterPage() {
57+
ElementHelper.clickOnElement(CdfControlCenterLocators.dataPipelineControlCenter);
58+
}
59+
60+
public static void clickOnDeleteButtonOnConfirmationBox() {
61+
ElementHelper.clickIfDisplayed(CdfControlCenterLocators.clickOnDeleteButton());
62+
}
63+
64+
public static void deletePipelineControlCenter() {
65+
ElementHelper.clickOnElement(CdfControlCenterLocators.deleteIconControlCenter);
66+
clickOnDeleteButtonOnConfirmationBox();
67+
}
68+
69+
public static void pipelineDeletedIsNotPresent() {
70+
clickOnSearchTabControlCenter(PipelineSteps.pipelineName);
71+
ElementHelper.isElementDisplayed(CdfControlCenterLocators.pipelineDeletedMessage);
72+
}
73+
74+
public static void clickOnSearchTabControlCenter(String message) {
75+
ElementHelper.sendKeys(CdfControlCenterLocators.searchTabControlCenter, message);
76+
}
77+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* Copyright © 2023 Cask Data, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
17+
package io.cdap.e2e.pages.locators;
18+
19+
import org.openqa.selenium.By;
20+
import org.openqa.selenium.WebElement;
21+
import org.openqa.selenium.support.FindBy;
22+
import org.openqa.selenium.support.How;
23+
24+
/**
25+
* Represents CdfControlCenterLocators
26+
*/
27+
28+
public class CdfControlCenterLocators {
29+
30+
@FindBy(how = How.XPATH, using = "//*[@data-cy='navbar-hamburger-icon']")
31+
public static WebElement hamburgerMenu;
32+
33+
@FindBy(how = How.XPATH, using = "//*[@data-cy='navbar-control-center-link']")
34+
public static WebElement controlCenterMenu;
35+
36+
@FindBy(how = How.XPATH, using = "//*[@data-cy='feature-heading'][//div[contains(text(),'Control Center')]]")
37+
public static WebElement pageHeaderControlCenter;
38+
39+
@FindBy(how = How.XPATH, using = "//*[@id='create-pipeline-link']")
40+
public static WebElement createButtonControlCenter;
41+
42+
@FindBy(how = How.XPATH, using = "//span[@class='entity-type'][//span[contains(text(),'Data Pipeline')]]")
43+
public static WebElement dataPipelineControlCenter;
44+
45+
@FindBy(how = How.XPATH, using = "//div[@class='just-added-entities-list']//button[@class='btn btn-link']" +
46+
"//*[@class='icon-svg icon-trash']")
47+
public static WebElement deleteIconControlCenter;
48+
49+
public static By clickOnDeleteButton() {
50+
return By.xpath("//button[@class='btn btn-primary'][//button[@data-cy='Delete']]");
51+
}
52+
53+
@FindBy(how = How.XPATH, using = "//div[@class='empty-message-container']")
54+
public static WebElement pipelineDeletedMessage;
55+
56+
@FindBy(how = How.XPATH, using = "//input[@class='search-input form-control'][@placeholder='Search']")
57+
public static WebElement searchTabControlCenter;
58+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright © 2023 Cask Data, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
17+
package stepsdesign;
18+
19+
import io.cdap.e2e.pages.actions.CdfControlCenterActions;
20+
import io.cdap.e2e.utils.CdfHelper;
21+
import io.cucumber.java.en.Then;
22+
import org.slf4j.Logger;
23+
import org.slf4j.LoggerFactory;
24+
25+
/**
26+
* Represents CdfControlCenterSteps
27+
*/
28+
public class ControlCenterSteps implements CdfHelper {
29+
30+
private static final Logger logger = LoggerFactory.getLogger(ControlCenterSteps.class);
31+
32+
@Then("Click on the Hamburger bar on the left panel")
33+
public static void clickOnTheHamburgerIcon() {
34+
CdfControlCenterActions.clickOnHamburgerMenu();
35+
}
36+
37+
@Then("Click on Control Center link from the hamburger menu")
38+
public void openControlCenterPage() {
39+
CdfControlCenterActions.clickOnControlCenterTab();
40+
}
41+
42+
@Then("Verify that the user is navigated to control center page successfully")
43+
public void navigateControlCenterPage() {
44+
CdfControlCenterActions.navigateToControlCenter();
45+
}
46+
47+
@Then("Verify user is able to click on the create button to create a pipeline successfully")
48+
public void createButtonControlCenterPage() {
49+
CdfControlCenterActions.clickOnCreateButtonControlCenterPage();
50+
}
51+
52+
@Then("Verify the pipeline created successfully is present in control center page")
53+
public void pipelinePresentControlCenterPage() {
54+
CdfControlCenterActions.pipelinePresentControlCenterPage();
55+
}
56+
57+
@Then("Click on the delete icon of the created pipeline and pipeline should get deleted successfully")
58+
public void deleteControlCenterPipeline() {
59+
CdfControlCenterActions.deletePipelineControlCenter();
60+
}
61+
62+
@Then("Verify the deleted pipeline is not present in the control center page")
63+
public void pipelineDeletedIsNotPresent() {
64+
CdfControlCenterActions.pipelineDeletedIsNotPresent();
65+
}
66+
}

0 commit comments

Comments
 (0)