Skip to content

Commit

Permalink
Merge pull request cdapio#213 from cloudsufi/e2e_bq_test_neeraj
Browse files Browse the repository at this point in the history
BigQuery Common steps
  • Loading branch information
Aryan-Verma authored Oct 18, 2023
2 parents d108d61 + 978096b commit fa28114
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,25 @@ public static void pressEscapeKey() {
logger.info("Press Escape Key");
Actions act = new Actions(SeleniumDriver.getDriver());
act.sendKeys(new CharSequence[]{Keys.ESCAPE}).perform();
}

public static void enterKeyInDedupe(String pluginProperty, String value) {
WebElement pluginPropertyInput = CdfPluginPropertiesLocators.deDupeKey(pluginProperty);
String valueFromPluginPropertiesFile = PluginPropertyUtils.pluginProp(value);
if (valueFromPluginPropertiesFile == null) {
ElementHelper.sendKeys(pluginPropertyInput, value);
return;
}
ElementHelper.sendKeys(pluginPropertyInput, valueFromPluginPropertiesFile);
}

public static void enterValueInTableKey(String pluginProperty, String value) {
WebElement pluginPropertyInput = CdfPluginPropertiesLocators.locateTableKey(pluginProperty);
String valueFromPluginPropertiesFile = PluginPropertyUtils.pluginProp(value);
if (valueFromPluginPropertiesFile == null) {
ElementHelper.sendKeys(pluginPropertyInput, value);
return;
}
ElementHelper.sendKeys(pluginPropertyInput, valueFromPluginPropertiesFile);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,16 @@ public static WebElement selectReplicationTable(String tableName) {
String path = "//div[contains(text(),'" + tableName + "')]" + "/preceding-sibling::div/span";
return SeleniumDriver.getDriver().findElement(By.xpath(path));
}

public static WebElement deDupeValue() {
return SeleniumDriver.getDriver().findElement(By.xpath("//div[@data-cy='value']"));
}

public static WebElement locateTableKey(String pluginProperty) {
return SeleniumDriver.getDriver().findElement
(By.xpath("//*[@data-cy='" + pluginProperty + "']//input")); }

public static WebElement deDupeKey(String pluginProperty) {
return SeleniumDriver.getDriver().findElement(By.xpath
("//*[@data-cy='" + pluginProperty + "']//input[@placeholder='Key']")); }
}
10 changes: 10 additions & 0 deletions src/main/java/stepsdesign/PipelineSteps.java
Original file line number Diff line number Diff line change
Expand Up @@ -747,4 +747,14 @@ public void enterKeyPropertyWithValue(String pluginProperty, DataTable table) {
public void pressESCKey() {
CdfPluginPropertiesActions.pressEscapeKey();
}

@Then("Enter key for plugin property: {string} with values: {string}")
public void enterKeyForPluginPropertyWithValue(String pluginProperty, String value) {
CdfPluginPropertiesActions.enterKeyInDedupe(pluginProperty, value);
}

@Then("Enter Value for plugin property table key : {string} with values: {string}")
public void enterValueInTableKey(String pluginProperty, String value) {
CdfPluginPropertiesActions.enterValueInTableKey(pluginProperty, value);
}
}

0 comments on commit fa28114

Please sign in to comment.