Conversation
| @@ -0,0 +1,59 @@ | |||
| /* | |||
There was a problem hiding this comment.
Delete this file. Use PluginPropertyUtils.java from e2e frameweork
| invalidClient=CDF_SAP_01404 - SAP connection test failed. Please verify the connection parameters. Root Cause: JCO_ERROR_CONFIGURATION - Parameter SAP client ('jco.client.client') needs to be a three digit number string instead of 'abc' | ||
| invalidLang=CDF_SAP_01404 - SAP connection test failed. Please verify the connection parameters. Root Cause: JCO_ERROR_CONFIGURATION - Parameter logon language ('jco.client.lang') code 'invalid' is invalid | ||
| invalidCred=CDF_SAP_01404 - SAP connection test failed. Please verify the connection parameters. Root Cause: JCO_ERROR_LOGON_FAILURE - Name or password is incorrect (repeat logon) | ||
|
|
| bqProjectId=cdf-athena | ||
| dataset=sap_automation | ||
| IM_GCP_KEY_NAME=CDFSLT | ||
|
|
| @@ -0,0 +1,19 @@ | |||
| /* | |||
| * Copyright © 2021 Cask Data, Inc. | |||
| public static SLTLocators sltLocators = new SLTLocators(); | ||
| public static String rawLog = null; | ||
| private static WebDriver CDFDriver; | ||
| BigQueryClient bqClient = new BigQueryClient(); |
| elementHelper.sendKeys(sltLocators.jcoclientuser, CDAPUtils.getPluginProp(jcoclientuser)); | ||
| elementHelper.sendKeys(sltLocators.jcoclientpasswd, CDAPUtils.getPluginProp(jcoclientpasswd)); | ||
| } | ||
| public void sltplugin_click() { |
There was a problem hiding this comment.
Use generic plugin click action from CdfStudioActions
| elementHelper.clickOnElement(sltLocators.sltplugin); | ||
| } | ||
|
|
||
| public String rowError_color() { |
There was a problem hiding this comment.
rowError_color -> getRowErrorBorderColor
There was a problem hiding this comment.
getRowErrorBorderColor used.
| return elementHelper.getElementCssProperty(SLTLocators.rowError, "border-color"); | ||
| } | ||
|
|
||
| public void next_click() { |
There was a problem hiding this comment.
Updated as per method action.
| elementHelper.clickOnElement(sltLocators.table(tableName)); | ||
| } | ||
|
|
||
| public void datasetName_fill (String stagingBucket) { |
There was a problem hiding this comment.
Updated as per method action.
| elementHelper.clickOnElement(sltLocators.deployPipeline); | ||
| } | ||
|
|
||
| public void startPipeline() { |
There was a problem hiding this comment.
clickStartPipelineButton
Check all method names. Should start with action(i.e click , enter , select, get etc)
There was a problem hiding this comment.
Updated as per method action.
|
Please add proper PR title. |
|
Indent looks incorrect. Please reformat all files in the PR using this settings file - https://cdap.atlassian.net/wiki/spaces/CE/pages/1594098619/Coding+Standard |
|
|
||
| static { | ||
| CDFDriver = SeleniumDriver.getDriver(); | ||
| sltLocators = SeleniumHelper.getPropertiesLocators(SLTLocators.class); |
There was a problem hiding this comment.
assignment to sltLocators is not required. You can use directly with classname
i.e. likeSLTLocators.name SLTLocators.gcsDataPath
|
|
||
| import java.io.FileInputStream; | ||
| import java.io.IOException; | ||
| import java.util.*; |
| private static String guid = null; | ||
| static boolean errorExist = false; | ||
| static String color; | ||
| private static AssertionHelper assertionHelper = new AssertionHelper(); |
There was a problem hiding this comment.
Remove instantiation. Use directly with className (AssertionHelper, ElementHelper, WaitHelper)
| sapRecordsCount = 0; | ||
| } | ||
|
|
||
| @When("^Source is SAP SLT fill connection parameters$") |
There was a problem hiding this comment.
Separate steps
1.Select source plugin
2.Configure plugin with required properties
| sltActions.next_click(); | ||
| } | ||
|
|
||
| @Then("^Select Table \"([^\"]*)\"$") |
There was a problem hiding this comment.
Why are u using regular expressions.
You can simplify it like - > @then("Select Table {string}")
Applies to all
| Then Click on next | ||
| Then Click on next | ||
| Then Click on Deploy Replication Pipeline | ||
| Then Update mass transfer id table: "<table>" job mode to "stop_load" |
| Feature: Design Time SLT Scenario | ||
|
|
||
| @SLT @Design-Time @Sanity | ||
| Scenario Outline: User is able to provides input to SLT parameters |
There was a problem hiding this comment.
->Verify user is able to provides input to SLT parameters
There was a problem hiding this comment.
Similar comment for all scenario descriptions
| When User crates new MTID on "Automation" SAP | ||
| When User updates mtid config in CDF_R_SLT_SETTINGS program | ||
| When Source is SAP SLT fill connection parameters | ||
| Then User is able to set SLT parameter <option> as <input> and getting row <errorMessage> for wrong input |
There was a problem hiding this comment.
-> Verify user is able...............
e2e-test/features/RunTimeSLT.feature
Outdated
| @SLT @Run-Time @Sanity | ||
| Scenario: User is able to create MTID and update CDF_R_SLT_SETTINGS program | ||
| Given User crates new MTID on "Automation" SAP | ||
| When User updates mtid config in CDF_R_SLT_SETTINGS program |
e2e-test/features/RunTimeSLT.feature
Outdated
| Then Wait till SLT pipeline is in running state and no error occurs | ||
| Then Close logs and stop the pipeline | ||
| Then Get Count of no of records transferred from SLT to BigQuery in "<table>" | ||
| Then User is able to validate record count in BQ matches with count in SAP |
There was a problem hiding this comment.
->Validate record count in BQ matches with count in SAP
harshit-google
left a comment
There was a problem hiding this comment.
Pushed the code all the comments except updates required in Feature file. Will push those changes tomorrow.
| Feature: Design Time SLT Scenario | ||
|
|
||
| @SLT @Design-Time @Sanity | ||
| Scenario Outline: User is able to provides input to SLT parameters |
| Scenario: User is able to set Replicate Existing Data as false | ||
| Given Open CDF replication and initiate pipeline creation | ||
| When Source is SAP SLT | ||
| Then Replicate Existing Data is set to false |
| Then Click on next | ||
| Then Click on next | ||
| Then Click on Deploy Replication Pipeline | ||
| Then Update mass transfer id table: "<table>" job mode to "stop_load" |
| When User crates new MTID on "Automation" SAP | ||
| When User updates mtid config in CDF_R_SLT_SETTINGS program | ||
| When Source is SAP SLT fill connection parameters | ||
| Then User is able to set SLT parameter <option> as <input> and getting row <errorMessage> for wrong input |
e2e-test/features/RunTimeSLT.feature
Outdated
| @SLT @Run-Time @Sanity | ||
| Scenario: User is able to create MTID and update CDF_R_SLT_SETTINGS program | ||
| Given User crates new MTID on "Automation" SAP | ||
| When User updates mtid config in CDF_R_SLT_SETTINGS program |
| CDFDriver = SeleniumDriver.getDriver(); | ||
| } | ||
|
|
||
| @FindBy(how = How.XPATH, using = "//input[@data-cy=\"name\"]") |
There was a problem hiding this comment.
Using ' for all the locators
| @FindBy(how = How.XPATH, using = "//input[@data-cy=\"name\"]") | ||
| public static WebElement name; | ||
| @FindBy(how = How.XPATH, using = "//input[@data-cy=\"gcpProjectId\"]") | ||
| public static WebElement gcpProjectId; |
| @FindBy(how = How.XPATH, using = "//input[@data-cy=\"gcpProjectId\"]") | ||
| public static WebElement gcpProjectId; | ||
| @FindBy(how = How.XPATH, using = "//div[contains(text(),'SAP Landscape Transformation (SLT)')]") | ||
| public static WebElement sltplugin; |
There was a problem hiding this comment.
As Replicator UI is quite different than Batch source cant use any of the existing Methods available in e2e.
| @FindBy(how = How.XPATH, using = "//input[@data-cy=\"sapJcoLibGcsPath\"]") | ||
| public static WebElement sapJcoLibGcsPath; | ||
| @FindBy(how = How.XPATH, using = "//input[@data-cy=\"jco.client.ashost\"]") | ||
| public static WebElement jcoclienthost; |
| public static WebElement viewsummary; | ||
| @FindBy(how = How.XPATH, using = "//span[contains(text(),'Deploy Replication Job')]") | ||
| public static WebElement deployPipeline; | ||
| @FindBy(how = How.XPATH, using = "//*[contains(text(), 'Logs')]") |
There was a problem hiding this comment.
Tried to use data-cy tag as much possible for uniformity but for the tags I have used best possible option available.
| Then Enter the BigQuery Properties for slt datasource | ||
| Then Click on next | ||
| Then Click on next | ||
| Then Click on next |
There was a problem hiding this comment.
We have three steps clicking on the Next button. I believe, they are clicking the Next button element on three different pages. It will make test more readable if the step can be enhanced to take the page name and print it in the logs.
Then Click on next button on "String"
|
|
||
| public static By replicationStatus = By.xpath("//*[contains(text(),'replication status: Process: ')]"); | ||
|
|
||
| public static WebElement table (String tableName) { |
There was a problem hiding this comment.
Update the locator name: locateTable(String tableName).
Use the same naming convention for all the methods in PO class: locateXYZ()
| } | ||
| } | ||
|
|
||
| @Then("{string} the {string} records with {string} in the sap table") |
There was a problem hiding this comment.
@then("CUD action {string} the count {string} records with mode {string} in the sap table")
| } | ||
|
|
||
| @Then("{string} the {string} records with {string} in the sap table") | ||
| public void createTheRecordsInTheSLTDatasourceFromJCO(String process, String recordcount, String rfcName) |
There was a problem hiding this comment.
->performCUDOperationInTheSLTDatasourceFromJCO
| } | ||
|
|
||
| @Then("{string} the {string} records with {string} in the sap table") | ||
| public void createTheRecordsInTheSLTDatasourceFromJCO(String process, String recordcount, String rfcName) |
There was a problem hiding this comment.
recordcount -> recordsCount
| @Given("^Open CDF replication and initiate pipeline creation") | ||
| public void open_cdf_replication() throws IOException, InterruptedException { | ||
| openCdf(); | ||
| SeleniumDriver.getDriver().get("http://localhost:11011/cdap/ns/default/replication/create"); |
There was a problem hiding this comment.
pass url as parameter from properties file
| } | ||
|
|
||
|
|
||
| @Given("^Open CDF replication and initiate pipeline creation") |
There was a problem hiding this comment.
check and remove regex from all stepDefinitions
| } | ||
|
|
||
| public static WebElement inputParameter(String inputParameter) { | ||
| return SeleniumDriver.getDriver().findElement(By.xpath("//*[@data-cy='" + |
There was a problem hiding this comment.
xpath can be simplified -> //input[@data-cy='" + inputParameter + "']
| sltActions.clickSltPlugin(); | ||
| } | ||
|
|
||
| @Then("Verify that after setting SLT parameter {string} as {string} plugin is throws error {string}") |
There was a problem hiding this comment.
Separate steps:
- Enter SLT parameter {string} with value {string}
- Verify SLT parameter validation error message {string} is displayed
| } | ||
|
|
||
| @Then("Validate Replicate Existing Data can be set to false") | ||
| public void replicate_existing_data() { |
There was a problem hiding this comment.
->validateReplicateExistingDataState
Check all step definition's method names. Should align with step description
| sltActions.clickNextButton(); | ||
| } | ||
|
|
||
| @Then("Validate Table is available and can be selected {string}") |
There was a problem hiding this comment.
No validation in this definition.
-> @then("Select table {string}")
| } | ||
|
|
||
| @Then("Validate Table is available and can be selected {string}") | ||
| public void select_table_something(String table) { |
There was a problem hiding this comment.
select_table_something -> selectTable
| } | ||
|
|
||
| @Then("^Enter the BigQuery Properties for slt datasource$") | ||
| public void enter_the_bigquery_properties_for_slt_datasource_something() throws IOException { |
| sltActions.enterDatasetName(pluginPropertyUtils.pluginProp("dataset")); | ||
| } | ||
|
|
||
| @Then("Validate Replication Pipeline can be deployed") |
| sltLocators.logs.click(); | ||
| parent = SeleniumDriver.getDriver().getWindowHandle(); | ||
| tabs = new ArrayList(SeleniumDriver.getDriver().getWindowHandles()); | ||
| SeleniumDriver.getDriver().switchTo().window((String) tabs.get(tabs.indexOf(parent) + 1)); |
There was a problem hiding this comment.
Use PageHelper.switchToWindow
| Assert.assertEquals(sapRecordsCount, bqRecordCount); | ||
| } | ||
|
|
||
| @Then("Verify that user is able to update table {string} to {string} on LTRC") |
There was a problem hiding this comment.
-> Verify that user is able to update table {string} to mode {string} on LTRC
| } | ||
|
|
||
| @Then("Verify that user is able to update table {string} to {string} on LTRC") | ||
| public void slt_job_for_mtid_something_table_something_in_something_mode |
| Thread.sleep(10000); //sleep required to wait for async operation to be executed on SAP | ||
| } | ||
|
|
||
| @When("Fetche the record count of table : {string} from SAP") |
| } | ||
|
|
||
| @When("Fetche the record count of table : {string} from SAP") | ||
| public void user_fetches_the_record_count_of_table_something_from_sap(String table) |
| } | ||
|
|
||
| @When("Validate that MTID can be Updated using CDF_R_SLT_SETTINGS program") | ||
| public void user_updates_mtid_in_program() |
There was a problem hiding this comment.
Check all step definition's method names. Should align with step description.
Applies to all
| public static SLTActions sltActions = new SLTActions(); | ||
| public static SLTLocators sltLocators = new SLTLocators(); | ||
| public static String rawLog = null; | ||
| BigQueryClient bqClient = new BigQueryClient(); |
| When Select SAP SLT as source | ||
| Then Validate SLT parameter "<option>" can be set as "<input>" | ||
| Examples: | ||
| | option | input | |
There was a problem hiding this comment.
Check all Examples table -> Update headers with Title Case
i.e option -> Option , input -> Input
| # the License. | ||
| Feature: Design Time SLT Scenario | ||
|
|
||
| @SLT @Design-Time @Sanity |
There was a problem hiding this comment.
@SLT tag can be added on Feature instead of duplicating on each scenario.
| Given Open CDF replication and initiate pipeline creation | ||
| When Fetche the record count of table : "<table>" from SAP | ||
| Then Delete GCS folder for mass transfer id table "<table>" | ||
| Then Drop target BigQuery table "<table>" |
There was a problem hiding this comment.
Perform this as test prerequisite in @Before scenario
Indent still looks incorrect... check all files in PR |
@sawantpritam @poojantcs
Sap slt plugins e2e selenium integration test.
This PR includes