diff --git a/src/main/java/io/cdap/e2e/pages/actions/CdfControlCenterActions.java b/src/main/java/io/cdap/e2e/pages/actions/CdfControlCenterActions.java new file mode 100644 index 000000000..b9b4ed02d --- /dev/null +++ b/src/main/java/io/cdap/e2e/pages/actions/CdfControlCenterActions.java @@ -0,0 +1,434 @@ +/* + * 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.pages.locators.CdfPluginPropertiesLocators; +import io.cdap.e2e.utils.AssertionHelper; +import io.cdap.e2e.utils.ElementHelper; +import io.cdap.e2e.utils.PluginPropertyUtils; +import io.cdap.e2e.utils.SeleniumDriver; +import io.cdap.e2e.utils.SeleniumHelper; +import io.cdap.e2e.utils.WaitHelper; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; +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 cdfControlCenterLocators = + SeleniumHelper.getPropertiesLocators(CdfControlCenterLocators.class); + + /** + * Click on the Hamburger menu icon. + */ + public static void clickOnHamburgerMenu() { + ElementHelper.clickOnElement(CdfControlCenterLocators.hamburgerMenu); + } + + /** + * Click on the Control Center Tab. + */ + public static void clickOnControlCenterTab() { + ElementHelper.clickOnElement(CdfControlCenterLocators.controlCenterMenu); + } + + /** + * Navigate to control center page. + */ + public static void navigateToControlCenter() { + ElementHelper.clickOnElement(CdfControlCenterLocators.pageHeaderControlCenter); + } + + /** + * Click on the Create Button. + */ + public static void clickOnCreateButtonControlCenterPage() { + ElementHelper.clickOnElement(CdfControlCenterLocators.createButtonControlCenter); + } + + /** + * Check for the pipeline present in control center page. + */ + public static void pipelinePresentControlCenterPage() { + ElementHelper.clickOnElement(CdfControlCenterLocators.dataPipelineControlCenter); + } + + /** + * Click on the delete button confirmation box. + */ + public static void clickOnDeleteButtonOnConfirmationBox() { + ElementHelper.clickIfDisplayed(CdfControlCenterLocators.clickOnDeleteButton()); + } + + /** + * Click on the delete icon. + */ + public static void deletePipelineControlCenter() { + ElementHelper.clickOnElement(CdfControlCenterLocators.deleteIconControlCenter); + clickOnDeleteButtonOnConfirmationBox(); + } + + /** + * Check for the pipeline deleted is not present. + */ + public static void pipelineDeletedIsNotPresent() { + clickOnSearchTabControlCenter(PipelineSteps.pipelineName); + ElementHelper.isElementDisplayed(CdfControlCenterLocators.pipelineDeletedMessage); + } + + /** + * Click on the SearchTab Control Center. + */ + public static void clickOnSearchTabControlCenter(String message) { + ElementHelper.sendKeys(CdfControlCenterLocators.searchTabControlCenter, message); + } + + /** + * Click on the Set Preferences Icon. + */ + public static void clickOnSetPreferencesIcon() { + ElementHelper.clickOnElement(CdfControlCenterLocators.setPreferencesIcon); + } + + /** + * Enter the key in the key input field. + */ + public static void enterKeyInputValue(String value) { + WebElement pluginPropertyInput = CdfControlCenterLocators.keyInputField(); + String valueFromPluginPropertiesFile = PluginPropertyUtils.pluginProp(value); + if (valueFromPluginPropertiesFile == null) { + ElementHelper.sendKeys(pluginPropertyInput, value); + return; + } + ElementHelper.sendKeys(pluginPropertyInput, valueFromPluginPropertiesFile); + } + + /** + * Enter the value in the value input field. + */ + public static void enterValueInput(String value) { + WebElement pluginPropertyInput = CdfControlCenterLocators.valueInputField(); + String valueFromPluginPropertiesFile = PluginPropertyUtils.pluginProp(value); + if (valueFromPluginPropertiesFile == null) { + ElementHelper.sendKeys(pluginPropertyInput, value); + return; + } + ElementHelper.sendKeys(pluginPropertyInput, valueFromPluginPropertiesFile); + } + + /** + * Click on the Save And Close Button. + */ + public static void clickOnSaveAndCloseButton() { + ElementHelper.clickOnElement(CdfControlCenterLocators.saveAndCloseButton); + } + + /** + * Click on the DataPipeline. + */ + public static void clickOnDataPipelineTab() { + ElementHelper.clickOnElement(CdfControlCenterLocators.dataPipelineTab); + } + + /** + * Click on the ViewDetails Tab of Dataset. + */ + public static void clickOnDeleteIconSetPreferences() { + ElementHelper.clickOnElement(CdfControlCenterLocators.deleteIconSetPreferences); + } + + /** + * Click on the Dataset Entity. + */ + public static void clickOnDatasetEntityIcon() { + ElementHelper.clickOnElement(CdfControlCenterLocators.datasetEntityIcon); + } + + /** + * Navigate to Details Page of Dataset. + */ + public static void navigateDetailsPageDatasetEntity() { + ElementHelper.clickOnElement(CdfControlCenterLocators.datasetEntityDetailsPage); + } + + /** + * Click on the Delete Icon of Dataset. + */ + public static void clickOnDeleteDatasetEntity() { + ElementHelper.clickOnElement(CdfControlCenterLocators.datasetDeleteIcon); + clickOnDeleteButtonOnConfirmationBox(); + } + + /** + * Click on the Truncate Button Confirmation Box. + */ + public static void clickOnTruncateButtonOnConfirmationBox() { + ElementHelper.clickIfDisplayed(CdfControlCenterLocators.clickOnTruncateButton()); + } + + /** + * Click on the ViewDetails Tab of Dataset. + */ + public static void clickOnTruncateDatasetEntity() { + ElementHelper.clickOnElement(CdfControlCenterLocators.truncateDatasetEntity); + clickOnTruncateButtonOnConfirmationBox(); + } + + /** + * Check for the deleted dataset not present in control center page. + */ + public static void deletedDatasetNotPresent(String message) { + ElementHelper.sendKeys(CdfControlCenterLocators.searchTabControlCenter, message); + ElementHelper.isElementDisplayed(CdfControlCenterLocators.pipelineDeletedMessage); + } + + /** + * Click on the ViewDetails Tab of Dataset. + */ + public static void clickOnViewDetailsPageDataset() { + ElementHelper.clickOnElement(CdfControlCenterLocators.viewDetailsTabDatasetEntity); + } + + /** + * Navigate on the ViewDetails Tab of Dataset. + */ + public static void navigateToViewDetailsPageDataset() { + ElementHelper.clickOnElement(CdfControlCenterLocators.navigateOnViewDetailsPageDatasetEntity); + } + + /** + * Click on the Back Tab. + */ + public static void clickOnBackTabDatasetEntity() { + ElementHelper.clickOnElement(CdfControlCenterLocators.backTabDatasetEntity); + } + + /** + * Click on the Close Tab. + */ + public static void clickOnCloseTabDatasetEntity() { + ElementHelper.clickOnElement(CdfControlCenterLocators.closeTabDatasetEntity); + } + + /** + * Click on the Dataset Artifact Message Displayed. + */ + public static void clickOnDatasetApplicationArtifactsMessage(String allEntitiesDisplayedMessage) { + String allEntitiesDisplayedExpectedMessage = PluginPropertyUtils.pluginProp(allEntitiesDisplayedMessage); + WaitHelper.waitForElementToBeDisplayed(CdfControlCenterLocators.filterOptionMessage); + AssertionHelper.verifyElementContainsText(CdfControlCenterLocators.filterOptionMessage, + allEntitiesDisplayedExpectedMessage); + logger.info("Verifying that the element: " + CdfControlCenterLocators.filterOptionMessage + " contains text: " + + allEntitiesDisplayedExpectedMessage); + } + + /** + * Select type from filter in control center . + * + * @param option Artifacts Applications Datasets + */ + public static void selectFilterDropdownOption(String pluginProperty, String option) { + String pluginPropertyDataCyAttribute = PluginPropertyUtils.getPluginPropertyDataCyAttribute(pluginProperty); + if (pluginPropertyDataCyAttribute == null) { + pluginPropertyDataCyAttribute = pluginProperty; + } + String optionFromPluginPropertiesFile = PluginPropertyUtils.pluginProp(option); + if (optionFromPluginPropertiesFile == null) { + ElementHelper.selectDropdownOption(CdfPluginPropertiesLocators + .locatePropertyElement(pluginPropertyDataCyAttribute), + CdfControlCenterLocators.locateDropdownListItem(option)); + } else { + ElementHelper.selectDropdownOption(CdfPluginPropertiesLocators.locatePropertyElement + (pluginPropertyDataCyAttribute), + CdfControlCenterLocators.locateDropdownListItem( + optionFromPluginPropertiesFile)); + } + } + + /** + * Click on the Schema Tab. + */ + public static void clickOnSchemaTabDataset() { + ElementHelper.clickOnElement(CdfControlCenterLocators.schemaTabDatasetEntity); + } + + /** + * Check for the displayed Schema page. + */ + public static void navigateToSchemaTabPage() { + ElementHelper.clickOnElement(CdfControlCenterLocators.schemaTabDatasetEntityPage); + } + + /** + * Click on the Programs Tab. + */ + public static void clickOnProgramsTabDataset() { + ElementHelper.clickOnElement(CdfControlCenterLocators.programsTabDatasetEntity); + } + + /** + * Check for the displayed programs page. + */ + public static void navigateToProgramsTabPage() { + ElementHelper.clickOnElement(CdfControlCenterLocators.programsTabDatasetEntityPage); + } + + /** + * Check for the displayed message when sorted by Newest. + */ + public static void clickOnNewestOptionMessage(String newFilterMessage) { + String newestOptionExpectedMessage = PluginPropertyUtils.pluginProp(newFilterMessage); + WaitHelper.waitForElementToBeDisplayed(CdfControlCenterLocators.filterOptionMessage); + AssertionHelper.verifyElementContainsText(CdfControlCenterLocators.filterOptionMessage, + newestOptionExpectedMessage); + logger.info("Verifying that the element: " + CdfControlCenterLocators.filterOptionMessage + " contains text: " + + newestOptionExpectedMessage); + } + + /** + * Check for the displayed message when sorted by Oldest. + */ + public static void clickOnOldestOptionMessage(String oldestFilterMessage) { + String oldestOptionExpectedMessage = PluginPropertyUtils.pluginProp(oldestFilterMessage); + WaitHelper.waitForElementToBeDisplayed(CdfControlCenterLocators.filterOptionMessage); + AssertionHelper.verifyElementContainsText(CdfControlCenterLocators.filterOptionMessage, + oldestOptionExpectedMessage); + logger.info("Verifying that the element: " + CdfControlCenterLocators.filterOptionMessage + " contains text: " + + oldestOptionExpectedMessage); + } + + /** + * Check for the displayed message when sorted by Z To A. + */ + public static void clickOnZToAOptionMessage(String zToAFilterMessage) { + String zToAOptionExpectedMessage = PluginPropertyUtils.pluginProp(zToAFilterMessage); + WaitHelper.waitForElementToBeDisplayed(CdfControlCenterLocators.filterOptionMessage); + AssertionHelper.verifyElementContainsText(CdfControlCenterLocators.filterOptionMessage, + zToAOptionExpectedMessage); + logger.info("Verifying that the element: " + CdfControlCenterLocators.filterOptionMessage + " contains text: " + + zToAOptionExpectedMessage); + } + + /** + * Check for the displayed message when sorted by A To Z. + */ + public static void clickOnAToZOptionMessage(String aToZFilterMessage) { + String aToZOptionExpectedMessage = PluginPropertyUtils.pluginProp(aToZFilterMessage); + WaitHelper.waitForElementToBeDisplayed(CdfControlCenterLocators.filterOptionMessage); + AssertionHelper.verifyElementContainsText(CdfControlCenterLocators.filterOptionMessage, + aToZOptionExpectedMessage); + logger.info("Verifying that the element: " + CdfControlCenterLocators.filterOptionMessage + " contains text: " + + aToZOptionExpectedMessage); + } + + /** + * Click on the sort by dropdown. + */ + public static void selectSortDropdown() { + ElementHelper.clickOnElement(CdfControlCenterLocators.sortDropdown); + } + + /** + * Select the dropdown with value. + */ + public static void selectSortDropdownOptionValue(String option) { + ElementHelper.clickOnElement(CdfControlCenterLocators.selectSortDropdownValue(option)); + } + + /** + * Click on the plus add button to add a tag. + */ + public static void clickOnAddTagIcon() { + ElementHelper.clickOnElement(CdfControlCenterLocators.addTagIconDatasetEntity); + } + + /** + * Enter the value of the tag. + */ + public static void enterValueTagInputField(String value) { + WebElement pluginPropertyInput = CdfControlCenterLocators.enterAddTagIconDatasetEntityValue(); + String valueFromPluginPropertiesFile = PluginPropertyUtils.pluginProp(value); + if (valueFromPluginPropertiesFile == null) { + ElementHelper.sendKeys(pluginPropertyInput, value); + return; + } + ElementHelper.sendKeys(pluginPropertyInput, valueFromPluginPropertiesFile); + } + + /** + * Check for the count when user adds the tag. + */ + public static void tagCountIncreasesDataset() { + ElementHelper.clickOnElement(CdfControlCenterLocators.tagCountIconIncreaseDatasetEntity); + } + + /** + * Click on close tab of tags in Dataset Entity Details Page. + */ + public static void clickOnCloseIcon() { + ElementHelper.clickOnElement(CdfControlCenterLocators.closeTagIconDatasetEntity); + } + + /** + * Check for the count when user removes the tag. + */ + public static void tagCountDecreasesDataset(String tagCountDecreaseMessage) { + String tagCountDecreaseExpectedMessage = PluginPropertyUtils.pluginProp(tagCountDecreaseMessage); + WaitHelper.waitForElementToBeDisplayed(CdfControlCenterLocators.tagCounDecreaseIconDatasetEntityMessage); + AssertionHelper.verifyElementContainsText(CdfControlCenterLocators.tagCounDecreaseIconDatasetEntityMessage, + tagCountDecreaseExpectedMessage); + logger.info("Verifying that the element: " + CdfControlCenterLocators.tagCounDecreaseIconDatasetEntityMessage + + " contains text: " + tagCountDecreaseExpectedMessage); + } + + /** + * Click on Search tab in control center. + */ + public static void enterTextInSearchBarInControlCenter(String searchedText) { + ElementHelper.sendKeys(CdfControlCenterLocators.searchTabControlCenter, searchedText); + ElementHelper.clickOnElement(CdfControlCenterLocators.searchTabControlCenter); + } + + /** + * Search for the added tag in control center. + */ + public static void searchedTagDisplayedMessage(String searchedTagDisplayedMessage) { + String searchedTagDisplayedExpectedMessage = PluginPropertyUtils.pluginProp(searchedTagDisplayedMessage); + WaitHelper.waitForElementToBeDisplayed(CdfControlCenterLocators.filterOptionMessage); + AssertionHelper.verifyElementContainsText(CdfControlCenterLocators.filterOptionMessage, + searchedTagDisplayedExpectedMessage); + logger.info("Verifying that the element: " + CdfControlCenterLocators.filterOptionMessage + " contains text: " + + searchedTagDisplayedExpectedMessage); + } + + /** + * Press Enter Key. + */ + public static void pressEnterKey() { + logger.info("Press Enter Key"); + Actions act = new Actions(SeleniumDriver.getDriver()); + act.sendKeys(Keys.ENTER).perform(); + } +} diff --git a/src/main/java/io/cdap/e2e/pages/locators/CdfControlCenterLocators.java b/src/main/java/io/cdap/e2e/pages/locators/CdfControlCenterLocators.java new file mode 100644 index 000000000..07c194bcc --- /dev/null +++ b/src/main/java/io/cdap/e2e/pages/locators/CdfControlCenterLocators.java @@ -0,0 +1,153 @@ +/* + * 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 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; + +/** + * Represents CdfControlCenterLocators + */ + +public class CdfControlCenterLocators { + + @FindBy(how = How.XPATH, using = "//*[@data-testid='navbar-hamburger-icon']") + public static WebElement hamburgerMenu; + + @FindBy(how = How.XPATH, using = "//*[@data-testid='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 = "//div[@class='entity-card-header datapipeline']") + 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; + + @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']") + public static WebElement searchTabControlCenter; + + @FindBy(how = How.XPATH, using = "//div[@class='just-added-entities-list']//button[@class='btn btn-link']" + + "//*['icon-svg icon-wrench']") + public static WebElement setPreferencesIcon; + + @FindBy(how = How.XPATH, using = "//button[@data-testid='save-prefs-btn']") + public static WebElement saveAndCloseButton; + + @FindBy(how = How.XPATH, using = "//div[@class='just-added-entities-list']" + + "//*[@class='icon-svg icon-ETLBatch entity-icon']") + public static WebElement dataPipelineTab; + + @FindBy(how = How.XPATH, using = "//i[@class='fa fa-trash']") + public static WebElement deleteIconSetPreferences; + + @FindBy(how = How.XPATH, using = "//div[@class='entity-card-header dataset']" + + "//*[@class='icon-svg icon-datasets entity-icon']") + public static WebElement datasetEntityIcon; + + @FindBy(how = How.XPATH, using = "//div[@class='header']//*[@class='icon-svg icon-datasets']") + public static WebElement datasetEntityDetailsPage; + + @FindBy(how = How.XPATH, using = "(//*[@class='icon-svg icon-trash'])[1]") + public static WebElement datasetDeleteIcon; + + @FindBy(how = How.XPATH, using = "(//*[@class='icon-svg icon-cut'])[1]") + public static WebElement truncateDatasetEntity; + + @FindBy(how = How.XPATH, using = "//a[@class='link-to-detail']") + public static WebElement viewDetailsTabDatasetEntity; + + @FindBy(how = How.XPATH, using = "//*[@class='icon-svg icon-datasets']") + public static WebElement navigateOnViewDetailsPageDatasetEntity; + + @FindBy(how = How.XPATH, using = "//a[contains(text(),'Back')]") + public static WebElement backTabDatasetEntity; + + @FindBy(how = How.XPATH, using = "//*[@class='icon-svg icon-close']") + public static WebElement closeTabDatasetEntity; + + @FindBy(how = How.XPATH, using = "//a[contains(text(),'Schema')]") + public static WebElement schemaTabDatasetEntity; + + @FindBy(how = How.XPATH, using = "//a[contains(text(),'Programs')]") + public static WebElement programsTabDatasetEntity; + + @FindBy(how = How.XPATH, using = "//div[@class='schema-tab']") + public static WebElement schemaTabDatasetEntityPage; + + @FindBy(how = How.XPATH, using = "//div[@class='program-tab clearfix']") + public static WebElement programsTabDatasetEntityPage; + + @FindBy(how = How.XPATH, using = "//div[@class='list-view-header subtitle']") + public static WebElement filterOptionMessage; + + @FindBy(how = How.XPATH, using = "//div[@id='filter-tooltip-target-id']") + public static WebElement sortDropdown; + + @FindBy(how = How.XPATH, using = "//span[@data-testid='tag-plus-button']") + public static WebElement addTagIconDatasetEntity; + + @FindBy(how = How.XPATH, using = "//*[contains(text(),'Tags (1)')]") + public static WebElement tagCountIconIncreaseDatasetEntity; + + @FindBy(how = How.XPATH, using = "//span[@class='tag-content']//*[@class='icon-svg icon-close']") + public static WebElement closeTagIconDatasetEntity; + + @FindBy(how = How.XPATH, using = "//div[@class='tags-holder']") + public static WebElement tagCounDecreaseIconDatasetEntityMessage; + + public static By clickOnDeleteButton() { + return By.xpath("//button[@class='btn btn-primary'][//button[@data-testid='Delete']]"); + } + + public static By clickOnTruncateButton() { + return By.xpath("//div//button[@data-testid='Truncate']"); + } + + public static WebElement keyInputField() { + return SeleniumDriver.getDriver().findElement(By.xpath("//input[@class='form-control key-input']")); + } + + public static WebElement valueInputField() { + return SeleniumDriver.getDriver().findElement(By.xpath("//input[@class='form-control value-input']")); + } + + public static By locateDropdownListItem(String option) { + return By.xpath + ("//input[@data-testid='" + option + "']"); + } + + public static WebElement selectSortDropdownValue(String option) { + return SeleniumDriver.getDriver().findElement(By.xpath("//*[contains(text(),'" + option + "')]")); + } + + public static WebElement enterAddTagIconDatasetEntityValue() { + return SeleniumDriver.getDriver().findElement(By.xpath("//input[@data-testid='tag-input']")); + } +} diff --git a/src/main/java/stepsdesign/ControlCenterSteps.java b/src/main/java/stepsdesign/ControlCenterSteps.java new file mode 100644 index 000000000..cb75833d6 --- /dev/null +++ b/src/main/java/stepsdesign/ControlCenterSteps.java @@ -0,0 +1,233 @@ +/* + * 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("Enter the text in search tab {string} in control center") + public static void openSearchControlCenter(String value) { + CdfControlCenterActions.enterTextInSearchBarInControlCenter(value); + } + + @Then("Verify the searched tag is displayed successfully on control center page: {string}") + public static void searchedTagDisplayedMessage(String searchedTagDisplayedMessage) { + CdfControlCenterActions.searchedTagDisplayedMessage(searchedTagDisplayedMessage); + } + + @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("Click on create button to create a pipeline") + 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(); + } + + @Then("Verify the user is able to set the preferences for the created pipeline in the control center page") + public void setPreferencesForPipeline() { + CdfControlCenterActions.clickOnSetPreferencesIcon(); + } + + @Then("Verify the user is able to enter the value in the key input field {string}") + public void setPreferencesKeyInputValue(String value) { + CdfControlCenterActions.enterKeyInputValue(value); + } + + @Then("Verify the user is able to enter the value of the key in the value input field {string}") + public void setPreferencesValueInput(String value) { + CdfControlCenterActions.enterValueInput(value); + } + + @Then("Verify user is able to click on save and close button of set preferences") + public void clickSaveAndCloseButton() { + CdfControlCenterActions.clickOnSaveAndCloseButton(); + } + + @Then("Verify user is able to click on the data pipeline added in the control center page") + public void clickOnDataPipelineTab() { + CdfControlCenterActions.clickOnDataPipelineTab(); + } + + @Then("Verify user is able to click on the delete icon of preferences to delete the added preferences successfully") + public void clickOnDeleteIconSetPreferences() { + CdfControlCenterActions.clickOnDeleteIconSetPreferences(); + } + + @Then("Verify the user is able to click dataset entity icon to navigate to details page") + public void clickOnDatasetEntityIcon() { + CdfControlCenterActions.clickOnDatasetEntityIcon(); + } + + @Then("Verify user is navigated to the details page of the dataset entity icon successfully") + public void navigateDetailsPageDatasetEntity() { + CdfControlCenterActions.navigateDetailsPageDatasetEntity(); + } + + @Then("Click delete and verify the dataset is deleted successfully") + public void deleteDatasetEntity() { + CdfControlCenterActions.clickOnDeleteDatasetEntity(); + } + + @Then("Verify the deleted dataset {string} entity is not present in control center page") + public void deletedDatasetIsNotPresent(String value) { + CdfControlCenterActions.deletedDatasetNotPresent(value); + } + + @Then("Click truncate and verify the successful truncate of dataset entity") + public void truncateDatasetEntity() { + CdfControlCenterActions.clickOnTruncateDatasetEntity(); + } + + @Then("Click on view details tab of dataset entity") + public void clickOnViewDetailsPageDataset() { + CdfControlCenterActions.clickOnViewDetailsPageDataset(); + } + + @Then("Verify user is successfully navigated to details page of the dataset entity") + public void navigatedToViewDetailsPageDataset() { + CdfControlCenterActions.navigateToViewDetailsPageDataset(); + } + + @Then("Click on the back link of the view details page of dataset entity") + public void clickBackTabDatasetEntity() { + CdfControlCenterActions.clickOnBackTabDatasetEntity(); + } + + @Then("Click on close link to close the details page of dataset entity") + public void clickCloseTabDatasetEntity() { + CdfControlCenterActions.clickOnCloseTabDatasetEntity(); + } + + @Then("Select dropdown : {string} with option value: {string} in control center") + public void selectDropdownFilterOptionValue(String pluginProperty, String option) { + CdfControlCenterActions.selectFilterDropdownOption(pluginProperty, option); + } + + @Then("Verify the all entities message is displayed with the filter selection: {string}") + public void displayFilterDatasetApplicationArtifactsMessage(String allEntitiesDisplayedMessage) { + CdfControlCenterActions.clickOnDatasetApplicationArtifactsMessage(allEntitiesDisplayedMessage); + } + + @Then("Click on the schema link of the dataset entity details page") + public void clickOnSchemaTabLink() { + CdfControlCenterActions.clickOnSchemaTabDataset(); + } + + @Then("Verify user is navigated to the schema details page of the dataset entity page") + public void navigateToSchemaTabLinkPage() { + CdfControlCenterActions.navigateToSchemaTabPage(); + } + + @Then("Click on the programs link of the dataset entity details page") + public void clickOnProgramsTabLink() { + CdfControlCenterActions.clickOnProgramsTabDataset(); + } + + @Then("Verify user is navigated to the programs details page of the dataset entity page") + public void navigateToProgramsTabLinkPage() { + CdfControlCenterActions.navigateToProgramsTabPage(); + } + + @Then("Select the sort by dropdown with option value: {string}") + public void selectDropdownSortOptionValue(String option) { + CdfControlCenterActions.selectSortDropdown(); + CdfControlCenterActions.selectSortDropdownOptionValue(option); + } + + @Then("Verify the entities are sorted by the newest option: {string}") + public void clickOnNewestOptionMessage(String newFilterMessage) { + CdfControlCenterActions.clickOnNewestOptionMessage(newFilterMessage); + } + + @Then("Verify the entities are sorted by the oldest option: {string}") + public void clickOnOldestOptionMessage(String oldestFilterMessage) { + CdfControlCenterActions.clickOnOldestOptionMessage(oldestFilterMessage); + } + + @Then("Verify the entities are sorted by the Z to A option: {string}") + public void clickOnZToAOptionMessage(String zToAFilterMessage) { + CdfControlCenterActions.clickOnZToAOptionMessage(zToAFilterMessage); + } + + @Then("Verify the entities are sorted by the A to Z option: {string}") + public void clickOnAToZOptionMessage(String aToZFilterMessage) { + CdfControlCenterActions.clickOnAToZOptionMessage(aToZFilterMessage); + } + + @Then("Click on the plus button to add the tag for a dataset entity") + public void clickOnAddTagIcon() { + CdfControlCenterActions.clickOnAddTagIcon(); + } + + @Then("Verify user is able to enter the values in tag input field: {string}") + public void enterValueInTagInputField(String value) { + CdfControlCenterActions.enterValueTagInputField(value); + CdfControlCenterActions.pressEnterKey(); + } + + @Then("Verify the tag count of dataset entity when user adds the tag") + public void tagCountIncreasesDataset() { + CdfControlCenterActions.tagCountIncreasesDataset(); + } + + @Then("Click on the close icon of tag added") + public void clickOnCloseIconAndTagCountDecreases() { + CdfControlCenterActions.clickOnCloseIcon(); + } + + @Then("Verify the tag count of dataset entity decreases message: {string}") + public void tagCountDecreasesDataset(String tagCountDecreaseMessage) { + CdfControlCenterActions.tagCountDecreasesDataset(tagCountDecreaseMessage); + } +}