diff --git a/src/main/java/io/cdap/e2e/pages/actions/WranglerActions.java b/src/main/java/io/cdap/e2e/pages/actions/WranglerActions.java index 88aa76163..baa0db74a 100644 --- a/src/main/java/io/cdap/e2e/pages/actions/WranglerActions.java +++ b/src/main/java/io/cdap/e2e/pages/actions/WranglerActions.java @@ -61,55 +61,72 @@ public static void selectDirectiveAndOption(String columnName, String directive, throws InterruptedException { ElementHelper.clickOnElement(WranglerLocators.locateTransformationButton(columnName)); String pluginPropertyDirective = PluginPropertyUtils.getPluginPropertyElementTestId(directive); + String pluginPropertyDirectiveOption = PluginPropertyUtils.getPluginPropertyElementTestId(option); switch (directive) { case "CustomTransform": ElementHelper.clickOnElement(WranglerLocators.locateDirectivesTitle(pluginPropertyDirective)); - ElementHelper.sendKeysToTextarea(WranglerLocators.filterTextArea, option); - ElementHelper.clickOnElement(WranglerLocators.applyButton); + ElementHelper.sendKeysToTextarea(WranglerLocators.enterTextArea(pluginPropertyDirective), option); + ElementHelper.clickOnElement(WranglerLocators.applyButton(pluginPropertyDirective)); + break; + + case "MaskData": + case "Explode": + ElementHelper.hoverOverElement(WranglerLocators.scrollButton); + WaitHelper.waitForElementToBeDisplayed(WranglerLocators.locateDirectivesTitle(pluginPropertyDirective)); + ElementHelper.clickOnElement(WranglerLocators.locateDirectivesTitle(pluginPropertyDirective)); + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOptionsTag(pluginPropertyDirective, + pluginPropertyDirectiveOption)); break; case "Filter": - case "Sendtoerror": + case "SendToError": ElementHelper.clickOnElement(WranglerLocators.locateDirectivesTitle(pluginPropertyDirective)); - Select selectDropdown = new Select(WranglerLocators.filterSelect); - ElementHelper.scrollToElementUsingJsExecutor(WranglerLocators.selectDirectiveOption(option)); - selectDropdown.selectByVisibleText(option); - ElementHelper.clickOnElement(WranglerLocators.applyButton); + Select selectDropdown = new Select(WranglerLocators.selectDropdownOption(pluginPropertyDirective)); + ElementHelper.scrollToElementUsingJsExecutor(WranglerLocators. + selectFilterOptions(pluginPropertyDirective, + pluginPropertyDirectiveOption)); + selectDropdown.selectByVisibleText(PluginPropertyUtils.pluginProp("filterEmptyProperty")); + ElementHelper.clickOnElement(WranglerLocators.applyButton(pluginPropertyDirective)); break; case "FillNullOrEmptyCells": case "CopyColumn": ElementHelper.clickOnElement(WranglerLocators.locateDirectivesTitle(pluginPropertyDirective)); - ElementHelper.replaceElementValue(WranglerLocators.enterText, option); - ElementHelper.clickOnElement(WranglerLocators.applyButton); + if (directive.equals("FillNullOrEmptyCells")) { + ElementHelper.replaceElementValue(WranglerLocators.enterText(pluginPropertyDirective), option); + } else { + ElementHelper.replaceElementValue(WranglerLocators.enterText(pluginPropertyDirective), option); + } + ElementHelper.clickOnElement(WranglerLocators.applyButton(pluginPropertyDirective)); break; case "Hash": ElementHelper.hoverOverElement(WranglerLocators.scrollButton); - WaitHelper.waitForElementToBeDisplayed(WranglerLocators.scrollButtonDisabled); + WaitHelper.waitForElementToBeDisplayed(WranglerLocators.locateDirectivesTitle(pluginPropertyDirective)); ElementHelper.clickOnElement(WranglerLocators.locateDirectivesTitle(pluginPropertyDirective)); - Select select = new Select(WranglerLocators.filterSelect); - ElementHelper.scrollToElementUsingJsExecutor(WranglerLocators.selectDirectiveOption(option)); + Select select = new Select(WranglerLocators.selectDropdownOption(pluginPropertyDirective)); + ElementHelper.scrollToElementUsingJsExecutor(WranglerLocators.selectHashOption(option)); select.selectByVisibleText(option); - ElementHelper.clickOnElement(WranglerLocators.applyButton); + ElementHelper.clickOnElement(WranglerLocators.applyButton(pluginPropertyDirective)); break; case "Decode": case "Encode": ElementHelper.hoverOverElement(WranglerLocators.scrollButton); - WaitHelper.waitForElementToBeDisplayed(WranglerLocators.scrollButtonDisabled); + WaitHelper.waitForElementToBeDisplayed(WranglerLocators.encodeDirective); if (directive.equals("Encode")) { ElementHelper.clickOnElement(WranglerLocators.encodeDirective); } else { ElementHelper.clickOnElement(WranglerLocators.decodeDirective); } - ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(option)); + ElementHelper.clickOnElement(WranglerLocators.encodeDecodeOptions(option)); break; default: ElementHelper.clickOnElement(WranglerLocators.locateDirectivesTitle(pluginPropertyDirective)); - ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(option)); + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(pluginPropertyDirective + , pluginPropertyDirectiveOption)); } } @@ -130,7 +147,7 @@ public static void selectDirectiveTypeWithDropdownAndText(String columnName, Str String pluginPropertyDirective = PluginPropertyUtils.getPluginPropertyElementTestId(directive); ElementHelper.clickOnElement(WranglerLocators.locateDirectivesTitle(pluginPropertyDirective)); - if (pluginPropertyDirective.equals("findAndReplace")) { + if (directive.equals("FindAndReplace")) { ElementHelper.sendKeys(WranglerLocators.enterOldValue, directiveType); ElementHelper.sendKeys(WranglerLocators.enterNewValue, text); ElementHelper.clickOnElement(WranglerLocators.replaceAllButton); @@ -143,15 +160,26 @@ public static void selectDirectiveTypeWithDropdownAndText(String columnName, Str case "value starts with": case "value ends with": case "value matches regex": - Select select = new Select(WranglerLocators.filterSelect); + Select select = new Select(WranglerLocators.selectDropdownOption(pluginPropertyDirective)); select.selectByVisibleText(directiveType); - ElementHelper.sendKeysToTextarea(WranglerLocators.enterText, text); + if (directive.equals("Filter")) { + ElementHelper.sendKeysToTextarea(WranglerLocators.enterText(pluginPropertyDirective), text); + } else if (directive.equals("SendToError")) { + ElementHelper.sendKeysToTextarea(WranglerLocators.enterText(pluginPropertyDirective), text); + } + ElementHelper.clickOnElement(WranglerLocators.applyButton(pluginPropertyDirective)); break; case "Custom condition": - Select selectCustom = new Select(WranglerLocators.filterSelect); - selectCustom.selectByVisibleText(directiveType); - ElementHelper.sendKeysToTextarea(WranglerLocators.filterTextArea, text); + if (directive.equals("Filter")) { + Select selectCustom = new Select(WranglerLocators.selectDropdownOption(pluginPropertyDirective)); + selectCustom.selectByVisibleText(directiveType); + ElementHelper.sendKeysToTextarea(WranglerLocators.enterTextArea(pluginPropertyDirective), text); + } else if (directive.equals("SendToError")) { + Select selectCustom = new Select(WranglerLocators.selectDropdownOption(pluginPropertyDirective)); + selectCustom.selectByVisibleText(directiveType); + ElementHelper.sendKeysToTextarea(WranglerLocators.enterTextArea(pluginPropertyDirective), text); + } break; } } @@ -163,45 +191,73 @@ public static void selectDirectiveTypeWithThreeOptions(String columnName, String throws InterruptedException { ElementHelper.clickOnElement(WranglerLocators.locateTransformationButton(columnName)); String pluginPropertyDirective = PluginPropertyUtils.getPluginPropertyElementTestId(directive); + String pluginPropertyDirectiveOption = PluginPropertyUtils.getPluginPropertyElementTestId(directiveType); + String optionType = PluginPropertyUtils.getPluginPropertyElementTestId(option); ElementHelper.clickOnElement(WranglerLocators.locateDirectivesTitle(pluginPropertyDirective)); - ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(directiveType)); switch (directiveType) { case "Decimal": - ElementHelper.sendKeys(WranglerLocators.scaleText, option); + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(pluginPropertyDirective, + pluginPropertyDirectiveOption)); + ElementHelper.sendKeys(WranglerLocators.scaleText, optionType); ElementHelper.clickOnElement(WranglerLocators.applyButtonUppercase); break; - case "Character count": - ElementHelper.replaceElementValue(WranglerLocators.enterText, option); - ElementHelper.clickOnElement(WranglerLocators.applyButton); + case "CSV": + case "LOG": + case "SIMPLEDATE": + case "DATETIME": + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(pluginPropertyDirective, directiveType)); + ElementHelper.clickOnElement(WranglerLocators.parseModalOption(pluginPropertyDirective, + pluginPropertyDirectiveOption, optionType)); + ElementHelper.clickOnElement(WranglerLocators.parseModalApplyButton(pluginPropertyDirectiveOption)); + break; + + case "Character_count": + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(pluginPropertyDirective, + pluginPropertyDirectiveOption)); + ElementHelper.replaceElementValue(WranglerLocators.enterText(pluginPropertyDirective), optionType); + ElementHelper.clickOnElement(WranglerLocators.subMenuApplyButton(pluginPropertyDirective)); + break; + + case "FIXEDLENGTH": + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(pluginPropertyDirective, directiveType)); + ElementHelper.sendKeys(WranglerLocators.columnWidths, optionType); + ElementHelper.clickOnElement(WranglerLocators.parseModalApplyButton(pluginPropertyDirectiveOption)); break; - case "Fixed length": - ElementHelper.sendKeys(WranglerLocators.columnWidths, option); - ElementHelper.clickOnElement(WranglerLocators.applyButton); + case "XMLTOJSON": + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(pluginPropertyDirective, directiveType)); + ElementHelper.replaceElementValue(WranglerLocators.enterDepthXmlToJson, optionType); + ElementHelper.clickOnElement(WranglerLocators.parseModalApplyButton(pluginPropertyDirectiveOption)); break; - case "XML to JSON": case "JSON": - ElementHelper.replaceElementValue(WranglerLocators.enterDepth, option); - ElementHelper.clickOnElement(WranglerLocators.applyButton); + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(pluginPropertyDirective, directiveType)); + ElementHelper.replaceElementValue(WranglerLocators.enterDepthJson, optionType); + ElementHelper.clickOnElement(WranglerLocators.parseModalApplyButton(pluginPropertyDirectiveOption)); break; - case "Excel": - ElementHelper.replaceElementValue(WranglerLocators.excelSheetNumber, option); - ElementHelper.clickOnElement(WranglerLocators.applyButton); + case "EXCEL": + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(pluginPropertyDirective, directiveType)); + ElementHelper.replaceElementValue(WranglerLocators.excelSheetNumber, optionType); + ElementHelper.clickOnElement(WranglerLocators.parseModalApplyButton(pluginPropertyDirectiveOption)); break; - case "Using patterns": - ElementHelper.clickOnElement(WranglerLocators.selectPattern); - ElementHelper.clickOnElement(WranglerLocators.selectOptionForPatterns(option)); - ElementHelper.clickOnElement(WranglerLocators.extractButton); + case "Using_patterns": + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOptionsTag(pluginPropertyDirective, + pluginPropertyDirectiveOption)); + ElementHelper.clickOnElement(WranglerLocators.selectPatternButton); + ElementHelper.clickOnElementUsingJsExecutor(WranglerLocators.selectOptionForPatterns(optionType)); + ElementHelper.clickOnElement(WranglerLocators.extractFieldsApplyButton(pluginPropertyDirectiveOption)); break; - default: - ElementHelper.clickOnElement(WranglerLocators.selectRadioButton(option)); - ElementHelper.clickOnElement(WranglerLocators.applyButton); + case "Using_delimiters": + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOptionsTag(pluginPropertyDirective, + pluginPropertyDirectiveOption)); + ElementHelper.clickOnElement(WranglerLocators.selectDelimiterOptions(option)); + ElementHelper.clickOnElement(WranglerLocators.extractFieldsApplyButton(pluginPropertyDirectiveOption)); + break; } } @@ -220,32 +276,37 @@ public static void selectDirectiveTypeWithFourOption(String columnName, String d throws InterruptedException { ElementHelper.clickOnElement(WranglerLocators.locateTransformationButton(columnName)); String pluginPropertyDirective = PluginPropertyUtils.getPluginPropertyElementTestId(directive); + String pluginPropertyDirectiveOption = PluginPropertyUtils.getPluginPropertyElementTestId(directiveType); + String optionType = PluginPropertyUtils.getPluginPropertyElementTestId(option); ElementHelper.clickOnElement(WranglerLocators.locateDirectivesTitle(pluginPropertyDirective)); switch (directiveType) { case "Concatenate": - ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(directiveType)); - ElementHelper.sendKeys(WranglerLocators.enterText, text); - Select selectDropdown = new Select(WranglerLocators.filterSelect); + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(pluginPropertyDirective, + pluginPropertyDirectiveOption)); + ElementHelper.sendKeys(WranglerLocators.enterText(pluginPropertyDirective), text); + Select selectDropdown = new Select(WranglerLocators.selectDropdownOption(pluginPropertyDirective)); selectDropdown.selectByVisibleText(option); - ElementHelper.clickOnElementUsingJsExecutor(WranglerLocators.selectDirectiveOption(option)); + ElementHelper.clickOnElement(WranglerLocators.subMenuApplyButton(pluginPropertyDirective)); break; - case "Datetime": - case "Simple date": - if (option.equals("Custom format")) { - ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(directiveType)); - ElementHelper.clickOnElement(WranglerLocators.selectRadioButton(option)); + case "SIMPLEDATE": + case "DATETIME": + ElementHelper.clickOnElement(WranglerLocators.selectDirectiveOption(pluginPropertyDirective, directiveType)); + if (option.equals("Custom_Format")) { + ElementHelper.clickOnElement(WranglerLocators.parseModalOption(pluginPropertyDirective, + pluginPropertyDirectiveOption, optionType)); ElementHelper.sendKeys(WranglerLocators.customDate, text); + ElementHelper.clickOnElement(WranglerLocators.parseModalApplyButton(pluginPropertyDirectiveOption)); } break; case "Always": - Select select = new Select(WranglerLocators.filterSelect); + Select select = new Select(WranglerLocators.selectDropdownOption(pluginPropertyDirective)); select.selectByVisibleText(directiveType); ElementHelper.sendKeysToTextarea(WranglerLocators.enterCounterName, text); ElementHelper.replaceElementValue(WranglerLocators.incrementCount, option); + ElementHelper.clickOnElement(WranglerLocators.applyButton(pluginPropertyDirective)); break; } - ElementHelper.clickOnElement(WranglerLocators.applyButton); } /** @@ -267,9 +328,9 @@ public static void selectDirectiveTypeWithFiveOption(String columnName, String d ElementHelper.clickOnElement(WranglerLocators.locateDirectivesTitle(pluginPropertyDirective)); switch (directive) { case "SetCounter": - Select select = new Select(WranglerLocators.filterSelect); + Select select = new Select(WranglerLocators.selectDropdownOption(pluginPropertyDirective)); select.selectByVisibleText(option1); - ElementHelper.sendKeysToTextarea(WranglerLocators.filterTextArea, option2); + ElementHelper.sendKeysToTextarea(WranglerLocators.enterTextArea(pluginPropertyDirective), option2); ElementHelper.sendKeysToTextarea(WranglerLocators.enterCounterName, option4); ElementHelper.replaceElementValue(WranglerLocators.incrementCount, option3); break; @@ -281,13 +342,13 @@ public static void selectDirectiveTypeWithFiveOption(String columnName, String d Select selectVar = new Select(WranglerLocators.selectRow); selectVar.selectByVisibleText(option1); if (option1.equals("Custom condition")) { - ElementHelper.sendKeysToTextarea(WranglerLocators.filterTextArea, option2); + ElementHelper.sendKeysToTextarea(WranglerLocators.enterTextArea(pluginPropertyDirective), option2); } else { ElementHelper.sendKeysToTextarea(WranglerLocators.variableValue, option2); } break; } - ElementHelper.clickOnElement(WranglerLocators.applyButton); + ElementHelper.clickOnElement(WranglerLocators.applyButton(pluginPropertyDirective)); } /** @@ -297,10 +358,11 @@ public static void selectDirectiveTypeWithFiveOption(String columnName, String d * @throws InterruptedException If interrupted while waiting. */ public static void enterDirectiveFromCommandLine(String directive) throws InterruptedException { + WaitHelper.waitForElementToBeClickable(WranglerLocators.directiveCommandLine); ElementHelper.sendKeys(WranglerLocators.directiveCommandLine, directive); Actions act = new Actions(SeleniumDriver.getDriver()); act.sendKeys(new CharSequence[]{Keys.ENTER}).perform(); - WaitHelper.waitForElementToBeClickable(WranglerLocators.directiveCommandLine); + } /** diff --git a/src/main/java/io/cdap/e2e/pages/locators/WranglerLocators.java b/src/main/java/io/cdap/e2e/pages/locators/WranglerLocators.java index 198641ad8..03c6f5c82 100644 --- a/src/main/java/io/cdap/e2e/pages/locators/WranglerLocators.java +++ b/src/main/java/io/cdap/e2e/pages/locators/WranglerLocators.java @@ -25,20 +25,13 @@ * CDF wrangler related locators. */ public class WranglerLocators { - @FindBy(how = How.XPATH, using = "//div[@data-testid='common-components-scrollableList-scrollDownButton']") + @FindBy(how = How.XPATH, using = "//*[@data-testid='common-components-scrollableList-scrollDownButton']") public static WebElement scrollButton; - @FindBy(how = How.XPATH, using = "//div[@class='scroll-down-container text-center disabled']" + - "[@data-testid='common-components-scrollableList-scrollDownButton']") - public static WebElement scrollButtonDisabled; - - @FindBy(how = How.XPATH, using = "//div[@data-testid='features-dataprep-directives-changeDataType-submenu-decimal" + + @FindBy(how = How.XPATH, using = "//*[@data-testid='features-dataprep-directives-changeDataType-submenu-decimal" + "-scaleInput']/input") public static WebElement scaleText; - @FindBy(how = How.XPATH, using = "//button[contains(text(),'Extract')]") - public static WebElement extractButton; - @FindBy(how = How.XPATH, using = "//button[@data-testid='features-dataprep-directives-findAndReplace-applyButton']") public static WebElement replaceAllButton; @@ -53,9 +46,6 @@ public class WranglerLocators { "-decimal-applyButton']") public static WebElement applyButtonUppercase; - @FindBy(how = How.XPATH, using = "//button[contains(text(), 'Apply')]") - public static WebElement applyButton; - @FindBy(how = How.XPATH, using = "//input[@data-testid='features-dataprep-directives-defineVariable-" + "conditionTextInput']") public static WebElement variableValue; @@ -64,30 +54,21 @@ public class WranglerLocators { "sheetNumberInput']") public static WebElement excelSheetNumber; - @FindBy(how = How.XPATH, using = "//button[@data-testid='features-dataprep-directives-extractFields-modal-" + - "patterns-patternsSelector']") - public static WebElement selectPattern; - - @FindBy(how = How.XPATH, using = "//div[contains(@class, 'level-popover')]//input") - public static WebElement enterText; - @FindBy(how = How.XPATH, using = "//input[@data-testid='features-dataprep-directives-findAndReplace-oldValueInput']") public static WebElement enterOldValue; - @FindBy(how = How.XPATH, using = "//div[@data-testid='features-dataprep-directives-encodeDecode-title-Encode']") + @FindBy(how = How.XPATH, using = "//*[@data-testid='features-dataprep-directives-encodeDecode-title-Encode']") public static WebElement encodeDirective; - @FindBy(how = How.XPATH, using = "//div[@data-testid='features-dataprep-directives-encodeDecode-title-Decode']") + @FindBy(how = How.XPATH, using = "//*[@data-testid='features-dataprep-directives-encodeDecode-title-Decode']") public static WebElement decodeDirective; @FindBy(how = How.XPATH, using = "//input[@data-testid='features-dataprep-directives-findAndReplace-newValueInput']") public static WebElement enterNewValue; - @FindBy(how = How.XPATH, using = "//div[contains(@class, 'level-popover')]//textarea") - public static WebElement filterTextArea; - - @FindBy(how = How.XPATH, using = "//div[contains(@class, 'level-popover')]//select") - public static WebElement filterSelect; + @FindBy(how = How.XPATH, using = "button[@data-testid='features-dataprep-directives-extractFields-modal-patterns-" + + "patternsSelector']") + public static WebElement selectPatternButton; @FindBy(how = How.XPATH, using = "//input[@data-testid='features-dataprep-directives-parse-modal-singleField-" + "mainFieldInput']") @@ -101,8 +82,12 @@ public class WranglerLocators { "conditionSelector']") public static WebElement selectRow; - @FindBy(how = How.XPATH, using = "//input[@placeholder='Enter depth']") - public static WebElement enterDepth; + @FindBy(how = How.XPATH, using = "//*[@data-testid='features-dataprep-directives-parse-modal-" + + "singleField-mainFieldInput']") + public static WebElement enterDepthJson; + + @FindBy(how = How.XPATH, using = "//*[@data-testid='features-dataprep-directives-parse-modal-xmlToJson-depthInput']") + public static WebElement enterDepthXmlToJson; @FindBy(how = How.XPATH, using = "//input[@data-testid='features-dataprep-directives-parse-modal-dateFormats-" + "customFormatInput']") @@ -117,13 +102,14 @@ public class WranglerLocators { public static WebElement locateTransformationButton(String columnName) { return SeleniumDriver.getDriver() - .findElement(By.xpath("//th[@id='column-" + columnName + "']//button[@data-testid='features-dataprep-workspace" + + .findElement(By.xpath("//th[@id='column-" + columnName + "']//button[@data-testid='" + + "features-dataprep-workspace" + "-dataTable-head-directivesDropdown-toggleButton']")); } public static WebElement locateDirectivesTitle(String directiveName) { return SeleniumDriver.getDriver() - .findElement(By.xpath("//div[@data-testid='features-dataprep-" + + .findElement(By.xpath("//*[@data-testid='features-dataprep-" + "directives-" + directiveName + "-title']")); } @@ -133,12 +119,14 @@ public static WebElement locateCheckboxOfColumn(String columnName) { "features-dataprep-workspace-dataTable-head-columnSelectToggle']")); } - public static WebElement selectDirectiveOption(String option) { - return SeleniumDriver.getDriver().findElement(By.xpath("//*[text()='" + option + "']")); + public static WebElement selectDirectiveOption(String directive, String option) { + return SeleniumDriver.getDriver().findElement(By.xpath("//*[@data-testid='features-dataprep-" + + "directives-" + directive + "-option-" + option + "']")); } - public static WebElement selectRadioButton(String optionType) { - return SeleniumDriver.getDriver().findElement(By.xpath("//span[contains(text(),'" + optionType + "')]")); + public static WebElement selectDirectiveOptionsTag(String directive, String option) { + return SeleniumDriver.getDriver().findElement(By.xpath("//*[@data-testid='features-dataprep-" + + "directives-" + directive + "-options-" + option + "']")); } public static WebElement selectOptionForPatterns(String optionType) { @@ -146,4 +134,69 @@ public static WebElement selectOptionForPatterns(String optionType) { "directives-extractFields-modal-patterns-" + "patternsOption-" + optionType + "']")); } -} + + public static WebElement selectDropdownOption(String option) { + return SeleniumDriver.getDriver().findElement(By.xpath("//*[@data-testid='features-dataprep-" + + "directives-" + option + "-title']//select")); + } + + public static WebElement applyButton(String directiveName) { + return SeleniumDriver.getDriver().findElement(By.xpath("//button[@data-testid='features-dataprep-" + + "directives-" + directiveName + "-applyButton']")); + } + + public static WebElement subMenuApplyButton(String directiveName) { + return SeleniumDriver.getDriver().findElement(By.xpath("//button[@data-testid='features-dataprep-" + + "directives-" + directiveName + "-submenu-applyButton']")); + } + + public static WebElement extractFieldsApplyButton(String optionName) { + return SeleniumDriver.getDriver().findElement(By.xpath("//button[@data-testid='features-dataprep-" + + "directives-extractFields-" + + "modal-" + optionName + "-applyButton']")); + } + + public static WebElement parseModalApplyButton(String directiveType) { + return SeleniumDriver.getDriver().findElement(By.xpath("//button[@data-testid='features-dataprep-" + + "directives-parse-" + + "modal-" + directiveType + "-applyButton']")); + } + + public static WebElement enterText(String directive) { + return SeleniumDriver.getDriver().findElement(By.xpath("//*[@data-testid='features-dataprep-" + + "directives-" + directive + "-title']//input")); + } + + public static WebElement enterTextArea(String directive) { + return SeleniumDriver.getDriver().findElement(By.xpath("//*[@data-testid='features-dataprep-" + + "directives-" + directive + "-title']//textarea")); + } + + public static WebElement selectHashOption(String option) { + return SeleniumDriver.getDriver().findElement(By.xpath("//*[@data-testid='features-dataprep-" + + "directives-hash-hashOptions-" + option + "']")); + } + + public static WebElement encodeDecodeOptions(String option) { + return SeleniumDriver.getDriver().findElement(By.xpath("//*[@data-testid='features-dataprep-" + + "directives-encodeDecode-options-" + option + "']")); + } + + public static WebElement selectDelimiterOptions(String option) { + return SeleniumDriver.getDriver().findElement(By.xpath("//*[@data-testid='features-dataprep-" + + "directives-extractFields-modal-delimiters-" + + "delimiterOption-" + option + "']")); + } + + public static WebElement selectFilterOptions(String directive, String option) { + return SeleniumDriver.getDriver().findElement(By.xpath("//*[@data-testid='features-dataprep-" + + "directives-" + directive + "-conditionOption-" + option + + "']")); + } + + public static WebElement parseModalOption(String directive, String option, String optionType) { + return SeleniumDriver.getDriver().findElement(By.xpath("//*[@data-testid='features-dataprep-" + + "directives-" + directive + "-modal-" + + option + "-option-" + optionType + "']")); + } + }