Skip to content

Commit bc441b9

Browse files
committed
Addressed review coments
1 parent 4f86271 commit bc441b9

3 files changed

Lines changed: 51 additions & 14 deletions

File tree

src/main/java/io/cdap/e2e/pages/actions/CdfNameSpaceAdminActions.java

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static void clickOnNameSpaceAdminTabs(String tabName, String nameSpaceNam
4545
CdfNameSpaceAdminLocators.nameSpaceModules(tabName, nameSpaceName));
4646
}
4747

48-
public static void clickOnNameSpaceAdminTab() {
48+
public static void openNamespaceAdminPage() {
4949
ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.namespaceAdminMenu);
5050
}
5151

@@ -57,19 +57,19 @@ public static void clickOnEditPreference() {
5757
ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.editPreferencesButton);
5858
}
5959

60-
public static void switchOnNameSpace(String nameSpaceName) {
60+
public static void switchToNameSpace(String nameSpaceName) {
6161
ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.switchNameSpace(nameSpaceName));
6262
}
6363

64-
public static void createProfileforNameSpace(String nameSpaceName) {
64+
public static void createProfileForNamespace(String nameSpaceName) {
6565
ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.createProfile(nameSpaceName));
6666
}
6767

68-
public static void openNameSpacedropdown() {
68+
public static void openNamespaceDropdown() {
6969
ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.namespaceDropdown);
7070
}
7171

72-
public static void addNameSpacefromHamnugerMenu() {
72+
public static void addNamespaceFromHamburgerMenu() {
7373
ElementHelper.clickOnElement(CdfNameSpaceAdminLocators.addNamespace);
7474
}
7575

@@ -162,7 +162,7 @@ public static void clickOnResetPreference() {
162162
}
163163

164164
/**
165-
* Verify if the added Preferences reset is validated successfully
165+
* Verify if the added Preferences reset is successful
166166
*/
167167
public static void verifyIfResetValidatedSuccessfully() {
168168
WaitHelper.waitForElementToBeDisplayed(CdfNameSpaceAdminLocators.resetSuccessMsg);
@@ -251,4 +251,23 @@ public static void verifySwitchToNewNamespace(String value) {
251251
public static void verifyElementIsDisplayed() {
252252
ElementHelper.isElementDisplayed(CdfNameSpaceAdminLocators.pageHeaderNameSpaceAdmin);
253253
}
254+
255+
/**
256+
* Check whether Create Profile Properties Page is loaded
257+
*/
258+
public static void verifyCreateProfilePageLoaded() {
259+
WaitHelper.waitForElementToBeOptionallyDisplayed(CdfNameSpaceAdminLocators.profilePropertiesPage(),
260+
ConstantsUtil.DEFAULT_TIMEOUT_SECONDS);
261+
}
262+
263+
/**
264+
* Check whether Profile created is present in System Compute Profile tab
265+
*
266+
* @param profileTitle any specific title created
267+
*/
268+
public static void verifyProvisionerPresentComputeProfile(String profileTitle) {
269+
WaitHelper.waitForElementToBeOptionallyDisplayed(CdfNameSpaceAdminLocators.
270+
locateProfileTitle(PluginPropertyUtils.pluginProp(profileTitle)),
271+
ConstantsUtil.DEFAULT_TIMEOUT_SECONDS);
272+
}
254273
}

src/main/java/io/cdap/e2e/pages/locators/CdfNameSpaceAdminLocators.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ public static WebElement locateButtonType(String buttonType) {
113113
.findElement(By.xpath("//button[@data-cy='" + buttonType + "']"));
114114
}
115115

116+
public static By profilePropertiesPage() {
117+
return By.xpath("//h5[contains(text(), 'Create a profile')]");
118+
}
119+
120+
public static By locateProfileTitle(String profileName) {
121+
return By.xpath("//div[@title='" + profileName + "']");
122+
}
123+
116124
@FindBy(how = How.XPATH, using = "//a[contains(text(),\"Switch to\")]")
117125
public static WebElement switchToCreatedNamespace;
118126

src/main/java/stepsdesign/NameSpaceadminSteps.java

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ public static void clickOnTheHamburgerIcon() {
3636

3737
@Then("Click on NameSpace Admin link from the menu")
3838
public void openNameSpaceAdminPage() {
39-
CdfNameSpaceAdminActions.clickOnNameSpaceAdminTab();
39+
CdfNameSpaceAdminActions.openNamespaceAdminPage();
4040
}
4141

4242
@Then("Click on create profile button for {string} Namespace")
4343
public void createProfileinsideNamespaceAdmin(String nameSpace) {
44-
CdfNameSpaceAdminActions.createProfileforNameSpace(nameSpace);
44+
CdfNameSpaceAdminActions.createProfileForNamespace(nameSpace);
4545
}
4646

4747
@Then("Click {string} tab from Configuration page for {string} Namespace")
@@ -56,20 +56,20 @@ public void clickOnEditNameSpacePreferences() {
5656

5757
@Then("Click on Namespace dropdown button")
5858
public void openNameSpaceDropdown() {
59-
CdfNameSpaceAdminActions.openNameSpacedropdown();
59+
CdfNameSpaceAdminActions.openNamespaceDropdown();
6060
}
6161

6262
@Then("Click on the Add Namespace tab")
6363
public void addNamespaceFromHamburgerMenu() {
64-
CdfNameSpaceAdminActions.addNameSpacefromHamnugerMenu();
64+
CdfNameSpaceAdminActions.addNamespaceFromHamburgerMenu();
6565
}
6666

6767
@Then("Select navigation item: {string} from the Hamburger menu list")
6868
public void selectNavigationItemFromMenu(String tabName) {
6969
CdfNameSpaceAdminActions.selectHamburgerMenuList(tabName);
7070
}
7171

72-
@Then("Set nameSpace preferences with key: {string} and value: {string}")
72+
@Then("Set namespace preferences with key: {string} and value: {string}")
7373
public void setSystemPreferencesWithKeyAndValue(String pluginProperty, String keyValuePairs) {
7474
CdfNameSpaceAdminActions.enterKeyValuePreferences(pluginProperty, keyValuePairs);
7575
}
@@ -134,7 +134,7 @@ public void switchToNewNameSpace() {
134134
CdfNameSpaceAdminActions.switchToNewNameSpace();
135135
}
136136

137-
@Then("Verify if the switch is successful by checking the current {string} value")
137+
@Then("Verify the namespace is switched to {string} successfully")
138138
public void verifyNameSpaceSwitch(String newNameSpaceName) {
139139
CdfNameSpaceAdminActions.verifySwitchToNewNamespace(newNameSpaceName);
140140
}
@@ -146,8 +146,18 @@ public void addConnectionInNameSpaceAdmin(String connectionType, String connecti
146146
CdfPluginPropertiesActions.replaceValueInInputProperty("projectId", "projectId");
147147
}
148148

149-
@Then("Verify that the user is navigated to nameSpace admin page successfully")
150-
public void verifyThatHubPageIsSuccessfullyOpened() {
149+
@Then("Verify if user successfully navigated to namespace admin page")
150+
public void verifyThatNamespacePageIsSuccessfullyOpened() {
151151
CdfNameSpaceAdminActions.verifyElementIsDisplayed();
152152
}
153+
154+
@Then("Verify the Create a Profile page is loaded for selected provisioner")
155+
public void verifyTheCreateAProfilePageIsLoaded() {
156+
CdfNameSpaceAdminActions.verifyCreateProfilePageLoaded();
157+
}
158+
159+
@Then("Verify the created compute profile: {string} is displayed in system compute profile list")
160+
public void verifyTheCreatedComputeProfile(String profile) {
161+
CdfNameSpaceAdminActions.verifyProvisionerPresentComputeProfile(profile);
162+
}
153163
}

0 commit comments

Comments
 (0)