Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public class CdfBigQueryPropertiesActions {
cdfBigQueryPropertiesLocators = SeleniumHelper.getPropertiesLocators(CdfBigQueryPropertiesLocators.class);
}

/**
* @deprecated
* Call individual actions as per test scenario in step design file.
*/
@Deprecated
public static void enterBigQueryProperties(String tableProp) throws InterruptedException, IOException {
CdfStudioLocators.bigQueryProperties.click();
CdfBigQueryPropertiesLocators.bigQueryReferenceName.sendKeys(AUTOMATION_TEST);
Expand All @@ -51,9 +56,8 @@ public static void enterBigQueryProperties(String tableProp) throws InterruptedE
SeleniumHelper.waitElementIsVisible(CdfBigQueryPropertiesLocators.textSuccess, ONE);
}

public static void enterCmekProperty(String prop) throws IOException {
CdfStudioLocators.bigQueryProperties.click();
CdfBigQueryPropertiesLocators.cmekKey.sendKeys(SeleniumHelper.readParameters(prop));
public static void enterCmekProperty(String cmek) throws IOException {
CdfBigQueryPropertiesLocators.cmekKey.sendKeys(cmek);
}

public static void enterFilePath(String path) throws InterruptedException, IOException {
Expand Down Expand Up @@ -120,6 +124,12 @@ public static void enterTemporaryBucketName(String bucket) throws IOException {
SeleniumHelper.replaceElementValue(CdfBigQueryPropertiesLocators.temporaryBucketName, bucket);
}

/**
* @deprecated
* Use either {@link io.cdap.e2e.utils.CdfHelper#openSinkPluginPreviewData(String)}
* or {@link io.cdap.e2e.utils.CdfHelper#openSourcePluginPreviewData(String)} as per plugin type.
*/
@Deprecated
public static void clickPreviewData() {
SeleniumHelper.waitAndClick(CdfBigQueryPropertiesLocators.previewData);
}
Expand Down
60 changes: 59 additions & 1 deletion src/main/java/io/cdap/e2e/pages/actions/CdfGcsActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import java.io.IOException;
import java.util.Map;
import java.util.UUID;

import static io.cdap.e2e.utils.ConstantsUtil.DELIMITER;
Expand Down Expand Up @@ -65,6 +66,11 @@ public static void enterFormat() {
SeleniumDriver.getDriver().findElement(By.xpath("//*[contains(text(),'csv')]")).click();
}

/**
* @deprecated
* Use {@link CdfGcsActions#enterSampleSize(String)}
*/
@Deprecated
public static void enterSamplesize() {
CdfGCSLocators.samplesize.sendKeys(SAMPLE_SIZE);
}
Expand All @@ -73,6 +79,12 @@ public static void closeButton() {
CdfGCSLocators.closeButton.click();
}

/**
* @deprecated
* Use either {@link io.cdap.e2e.utils.CdfHelper#openSinkPluginProperties(String)}
* or {@link io.cdap.e2e.utils.CdfHelper#openSourcePluginProperties(String)} as per plugin type.
*/
@Deprecated
public static void gcsProperties() {
CdfGCSLocators.gcsProperties.click();
}
Expand All @@ -85,6 +97,11 @@ public static void getSchema() {
CdfGCSLocators.getSchemaButton.click();
}

/**
* @deprecated
* Use {@link CdfGcsActions#enterDelimiterField(String)}
*/
@Deprecated
public static void delimiter() throws IOException {
CdfGCSLocators.delimiter.sendKeys(SeleniumHelper.readParameters(DELIMITER));
}
Expand All @@ -95,6 +112,11 @@ public static void selectFormat(String formatType) throws InterruptedException {
"//li[@data-value='" + formatType + "']")));
}

/**
* @deprecated
* Use {@link io.cdap.e2e.utils.CdfHelper#validateSchema(Map)}
*/
@Deprecated
public static void validateSchema() {
for (WebElement schema : CdfGCSLocators.schemaSection) {
String actualStr = schema.getAttribute(VALUE);
Expand All @@ -109,7 +131,7 @@ public static void clickValidateButton() {
}

public static void validateSuccessMessage() {
Assert.assertTrue(CdfGCSLocators.successMessage.isDisplayed());
Assert.assertTrue(CdfGCSLocators.validationSuccessMessage.isDisplayed());
}

public static void selectFileEncoding(String encoding) {
Expand Down Expand Up @@ -147,10 +169,46 @@ public static void enterDelimiterField(String delimiter) {
CdfGCSLocators.delimiterField.sendKeys(delimiter);
}

/**
* @deprecated
* Use either {@link io.cdap.e2e.utils.CdfHelper#openSinkPluginPreviewData(String)}
* or {@link io.cdap.e2e.utils.CdfHelper#openSourcePluginPreviewData(String)} as per plugin type.
*/
@Deprecated
public static void clickPreviewData() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add @deprecated annotation here and elsewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added annotations

SeleniumHelper.waitAndClick(CdfGCSLocators.gcsPreviewData);
}
public static void enterSampleSize(String sampleSize) {
SeleniumHelper.replaceElementValue(CdfGCSLocators.samplesize, sampleSize);
}

public static void enterPathSuffix(String pathSuffix) {
SeleniumHelper.replaceElementValue(CdfGCSLocators.pathSuffix, pathSuffix);
}

public static void toggleWriteHeader() {
CdfGCSLocators.writeHeaderSwitch.click();
}

public static void enterLocation(String location) {
SeleniumHelper.replaceElementValue(CdfGCSLocators.location, location);
}

public static void selectContentType(String contentType) {
CdfGCSLocators.contentType.click();
SeleniumHelper.waitAndClick(SeleniumDriver.getDriver().findElement(By.xpath(
"//li[@data-value='" + contentType + "']")));
}

public static void enterEncryptionKeyName(String cmek) {
CdfGCSLocators.cmekKey.sendKeys(cmek);
}

public static void enterOutputFilePrefix(String filePrefix) {
CdfGCSLocators.outputFilePrefix.sendKeys(filePrefix);
}

public static void enterFileSystemProperties(String fileSystemProperties) {
CdfGCSLocators.fileSystemProperties.sendKeys(fileSystemProperties);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,4 @@ public static String captureRawLogs() {
return logs;
}

public static void schemaStatusValidation() {
Assert.assertTrue(CdfPipelineRunLocators.getSchemaSuccessStatus.isDisplayed());
}
}
38 changes: 37 additions & 1 deletion src/main/java/io/cdap/e2e/pages/actions/CdfStudioActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,30 @@ public class CdfStudioActions {
cdfStudioLocators = SeleniumHelper.getPropertiesLocators(CdfStudioLocators.class);
}

/**
* @deprecated
* Use {@link io.cdap.e2e.utils.CdfHelper#selectSourcePlugin(String)}
*/
@Deprecated
public static void selectGCS() throws InterruptedException {
WebElement element = CdfStudioLocators.gcsBucket;
SeleniumHelper.waitAndClick(element);
}

/**
* @deprecated
* Use {@link io.cdap.e2e.utils.CdfHelper#selectSourcePlugin(String)}
*/
@Deprecated
public static void clickSource() {
CdfStudioLocators.source.click();
}

/**
* @deprecated
* Use {@link CdfStudioActions#clickSink()} and {@link io.cdap.e2e.utils.CdfHelper#selectSinkPlugin(String)}
*/
@Deprecated
public static void sinkBigQuery() {
CdfStudioLocators.sink.click();
CdfStudioLocators.bigQueryObject.click();
Expand Down Expand Up @@ -77,7 +92,7 @@ public static void pipelineDeploy() {
}

public static String bannerErrorMessage() {
return CdfStudioLocators.bannerMssge.getText();
return CdfStudioLocators.statusBannerText.getText();
}

public static void clickSink() {
Expand All @@ -88,11 +103,22 @@ public static void clickValidateButton() {
CdfStudioLocators.validateButton.click();
}

/**
* @deprecated
* Use either {@link io.cdap.e2e.utils.CdfHelper#openSinkPluginProperties(String)}
* or {@link io.cdap.e2e.utils.CdfHelper#openSourcePluginProperties(String)} as per plugin type.
*/
@Deprecated
public static void clickProperties(String plugin) {
SeleniumDriver.getDriver().findElement(
By.xpath("//*[contains(@title,'" + plugin + "')]//following-sibling::div")).click();
}

/**
* @deprecated
* Use {@link io.cdap.e2e.utils.CdfHelper#connectSourceAndSink(String, String)}
*/
@Deprecated
public static void connectSourceAndSink(String source, String sink) {
SeleniumHelper.waitElementIsVisible(SeleniumDriver.getDriver().findElement(
By.xpath("//*[contains(@title,'" + sink + "')]")));
Expand All @@ -101,6 +127,11 @@ public static void connectSourceAndSink(String source, String sink) {
SeleniumDriver.getDriver().findElement(By.xpath("//*[contains(@title,'" + sink + "')]")));
}

/**
* @deprecated
* Use {@link io.cdap.e2e.utils.CdfHelper#selectSourcePlugin(String)}
*/
@Deprecated
public static void selectBQ() throws InterruptedException {
SeleniumHelper.waitAndClick(CdfStudioLocators.sourceBigQuery);
}
Expand All @@ -109,6 +140,11 @@ public static void clickCloseButton() {
SeleniumHelper.waitAndClick(CdfStudioLocators.closeButton);
}

/**
* @deprecated
* Use {@link CdfStudioActions#clickSink()} and {@link io.cdap.e2e.utils.CdfHelper#selectSinkPlugin(String)}
*/
@Deprecated
public static void sinkGcs() {
CdfStudioLocators.sink.click();
CdfStudioLocators.gcs.click();
Expand Down
25 changes: 23 additions & 2 deletions src/main/java/io/cdap/e2e/pages/locators/CdfGCSLocators.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public class CdfGCSLocators {
@FindBy(how = How.XPATH, using = "//*[@data-cy='plugin-properties-validate-btn']")
public static WebElement validateBtn;

@FindBy(how = How.XPATH, using = "//*[@data-cy='plugin-properties-validate-btn']")
public static WebElement successMessage;
@FindBy(how = How.XPATH, using = "//*[@data-cy='plugin-validation-success-msg']")
public static WebElement validationSuccessMessage;

@FindBy(how = How.XPATH, using = "//*[@placeholder='Field name']")
public static List<WebElement> schemaSection;
Expand Down Expand Up @@ -103,4 +103,25 @@ public class CdfGCSLocators {

@FindBy(how = How.XPATH, using = "//*[@data-cy=\"delimiter\" and @class=\"MuiInputBase-input\"]")
public static WebElement delimiterField;

@FindBy(how = How.XPATH, using = "//input[@data-cy='suffix']")
public static WebElement pathSuffix;

@FindBy(how = How.XPATH, using = "//*[@data-cy='switch-writeHeader']")
public static WebElement writeHeaderSwitch;

@FindBy(how = How.XPATH, using = "//input[@data-cy='location']")
public static WebElement location;

@FindBy(how = How.XPATH, using = "//*[@data-cy='select-contentType']")
public static WebElement contentType;

@FindBy(how = How.XPATH, using = "//input[@data-cy='cmekKey']")
public static WebElement cmekKey;

@FindBy(how = How.XPATH, using = "//input[@data-cy='outputFileNameBase']")
public static WebElement outputFilePrefix;

@FindBy(how = How.XPATH, using = "//textarea[@data-cy='fileSystemProperties']")
public static WebElement fileSystemProperties;
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ public class CdfPipelineRunLocators {
@FindBy(how = How.XPATH, using = "(//*[contains(@class, 'metric-records-out-label')])[2]/following-sibling::span")
public static WebElement recordsOutCount;

@FindBy(how = How.XPATH, using = "//*[@data-cy='plugin-validation-success-msg']")
public static WebElement getSchemaSuccessStatus;

@FindBy(how = How.XPATH, using = "//*[contains(text(),'saved successfully.')]")
public static WebElement savedSuccessMessage;

Expand Down
45 changes: 45 additions & 0 deletions src/main/java/io/cdap/e2e/pages/locators/CdfSchemaLocators.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright © 2021 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 org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;

import java.util.List;

/**
* Represents CdfSchemaLocators
*/
public class CdfSchemaLocators {
@FindBy(how = How.XPATH,
using = "//div[@data-cy='Output Schema']//div[@data-cy='schema-fields-list']//*[@placeholder='Field name']")
public static List<WebElement> outputSchemaColumnNames;

@FindBy(how = How.XPATH, using = "//div[@data-cy='Output Schema']//div[@data-cy='schema-fields-list']//select")
public static List<WebElement> outputSchemaDataTypes;

@FindBy(how = How.XPATH,
using = "//div[@data-cy='Input Schema']//div[@data-cy='schema-fields-list']//*[@placeholder='Field name']")
public static List<WebElement> inputSchemaColumnNames;

@FindBy(how = How.XPATH, using = "//div[@data-cy='Input Schema']//div[@data-cy='schema-fields-list']//select")
public static List<WebElement> inputSchemaDataTypes;

@FindBy(how = How.XPATH, using = "//*[@data-cy='get-schema-btn']//span[text()='Get Schema']")
public static WebElement getSchemaLoadComplete;
}
16 changes: 13 additions & 3 deletions src/main/java/io/cdap/e2e/pages/locators/CdfStudioLocators.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;

import java.util.List;

/**
* Represents CdfStudioLocators
*/
Expand Down Expand Up @@ -57,9 +59,6 @@ public class CdfStudioLocators {
@FindBy(how = How.XPATH, using = "//*[contains(text(),'Preview')]")
public static WebElement preview;

@FindBy(how = How.XPATH, using = "//*[@class='ng-binding ng-scope']")
public static WebElement bannerMssge;

@FindBy(how = How.XPATH, using = "//*[@class=\"pipeline-name ng-binding ng-scope placeholder\"]")
public static WebElement pipelineName;

Expand Down Expand Up @@ -107,4 +106,15 @@ public class CdfStudioLocators {

@FindBy(how = How.XPATH, using = "//*[@title=\"GCS\"]//following-sibling::div")
public static WebElement gcsProperties;

@FindBy(how = How.XPATH,
using = "(//h2[text()='Input Records']/parent::div//div[not(@data-cy='preview-data-row')]/div[text()!=''])")
public static List<WebElement> previewInputRecordColumnNames;

@FindBy(how = How.XPATH,
using = "(//h2[text()='Output Records']/parent::div//div[not(@data-cy='preview-data-row')]/div[text()!=''])")
public static List<WebElement> previewOutputRecordColumnNames;

@FindBy(how = How.XPATH, using = "//*[@role='tablist']/li[contains(text(),'Properties')]")
public static WebElement previewPropertiesTab;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
import java.util.Optional;

/**
* Represents GcpClient
* Represents BigQuery Client
*/
public class GcpClient {
public class BigQueryClient {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will effect SAP ODP PR as well, data-integrations/sap#10.


private static BigQuery bigQueryService = null;

Expand All @@ -56,7 +56,7 @@ public static void dropBqQuery(String table) throws IOException, InterruptedExce

/**
* @deprecated
* Use {@link GcpClient#getSoleQueryResult(String)} instead and parsing needs to be done by caller.
* Use {@link BigQueryClient#getSoleQueryResult(String)} instead and parsing needs to be done by caller.
*/
@Deprecated
public static int executeQuery(String query) throws InterruptedException, IOException {
Expand Down
Loading