Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
65 changes: 65 additions & 0 deletions e2e-test/features/DesignTimeSLT.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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.
Feature: Design Time SLT Scenario

@SLT @Design-Time @Sanity

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@SLT tag can be added on Feature instead of duplicating on each scenario.

Scenario Outline: User is able to provides input to SLT parameters

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

->Verify user is able to provides input to SLT parameters

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Similar comment for all scenario descriptions

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Working in progress.

Given Open CDF replication and initiate pipeline creation
When Source is SAP SLT
Then User is able to set SLT parameter "<option>" as "<input>"
Examples:
| option | input |

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Check all Examples table -> Update headers with Title Case

i.e option -> Option , input -> Input

| gcsDataPath | invalid |
| guid | invalidguid |
| massTransferId | ZZZ66 |
| sapJcoLibGcsPath |gs://ga_slt_cdf|
| jco.client.ashost | invalid |
| jco.client.sysnr | abc |
| jco.client.client | abc |
| jco.client.lang | invalid |
| jco.client.user | invalid |
| jco.client.passwd | invalid |

@SLT @Design-Time @Sanity
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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

-> Then verify Replicate Existing Data is set to false

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Working in progress.


@SLT @Design-Time @Sanity
Scenario: User is able to set suspend Slt Job as true
Given Open CDF replication and initiate pipeline creation
When Source is SAP SLT
Then Suspend Slt Job is set to true

@SLT @Design-Time @Sanity
Scenario Outline: User is able to configured job for "<table>"
Given User crates new MTID on "Automation" SAP
When User updates mtid config in CDF_R_SLT_SETTINGS program
Then Update mass transfer id table: "<table>" job mode to "replication"
Given Open CDF replication and initiate pipeline creation
When Source is SAP SLT fill connection parameters
Then Click on next
Then Select Table "<table>"
Then Click on next
Then Enter the BigQuery Properties for slt datasource
Then Click on next
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"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Add validation

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Working in progress.

Examples:
| table |
| vbap |
| ekko |
36 changes: 36 additions & 0 deletions e2e-test/features/DesignTimeSLTError.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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.
Feature: Design Time SLT Negative Scenario

@SLT @Design-Time @Sanity @Negative
Scenario Outline: User provides wrong parameters and able to verify error messages
Given Open CDF replication and initiate pipeline creation
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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

-> Verify user is able...............

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Working in progress.

Examples:
| option | input | errorMessage |
| gcsDataPath | invalid | invalidgcsDataPath |
| guid | invalidguid | invalidMTorGUID |
| massTransferId | ZZZ66 | invalidMTorGUID |
| sapJcoLibGcsPath |gs://ga_slt_cdf|invalidsapJcoLibGcsPath|
| jco.client.ashost | invalid | invalidIP |
| jco.client.sysnr | abc | invalidSysNr |
| jco.client.client | abc | invalidClient |
| jco.client.lang | invalid | invalidLang |
| jco.client.user | invalid | invalidCred |
| jco.client.passwd | invalid | invalidCred |


162 changes: 162 additions & 0 deletions e2e-test/features/RunTimeSLT.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# 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.
Feature:Run-Time SLT Scenario

@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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Add validation step

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Working in progress.


@SLT @Run-Time @Sanity
Scenario Outline: User configured SLT job for table containing all data types
Given User crates new MTID on "Automation" SAP
When User updates mtid config in CDF_R_SLT_SETTINGS program
Then Update mass transfer id table: "<table>" job mode to "stop_load"
Given Open CDF replication and initiate pipeline creation
When User fetches the record count of table : "<table>" from SAP
Then Delete GCS folder for mass transfer id table "<table>"
Then Drop target BigQuery table "<table>"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Perform this as test prerequisite in @Before scenario

Then Update mass transfer id table: "<table>" job mode to "<mode>"
When Source is SAP SLT fill connection parameters
Then Click on next
Then Select Table "<table>"
Then Click on next
Then Enter the BigQuery Properties for slt datasource
Then Click on next
Then Click on next
Then Click on next

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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"

Then Click on Deploy Replication Pipeline
Then Run the slt Pipeline in Runtime
Then Open Logs of SLT Pipeline
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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

->Validate record count in BQ matches with count in SAP

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Working in progress.

Examples:
| table | mode |
| ZDATA_TYPE | replication |

@SLT @Run-Time @Sanity
Scenario Outline: User configured SLT job in LTRC and executes pipeline in Initial Load Mode
Given User crates new MTID on "Automation" SAP
When User updates mtid config in CDF_R_SLT_SETTINGS program
Then Update mass transfer id table: "<table>" job mode to "stop_load"
Given Open CDF replication and initiate pipeline creation
When User fetches the record count of table : "<table>" from SAP
Then Delete GCS folder for mass transfer id table "<table>"
Then Drop target BigQuery table "<table>"
Then Update mass transfer id table: "<table>" job mode to "<mode>"
When Source is SAP SLT fill connection parameters
Then Click on next
Then Select Table "<table>"
Then Click on next
Then Enter the BigQuery Properties for slt datasource
Then Click on next
Then Click on next
Then Click on next
Then Click on Deploy Replication Pipeline
Then Run the slt Pipeline in Runtime
Then Open Logs of SLT Pipeline
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
Examples:
| table | mode |
| adr6 | initial_load |
| t001 | initial_load |
| t006a | initial_load |
| t023t | initial_load |
| t023 | initial_load |


@SLT @Run-Time
Scenario Outline: User configured SLT job in LTRC and executes pipeline in Replication
Given User crates new MTID on "Automation" SAP
When User updates mtid config in CDF_R_SLT_SETTINGS program
Then Update mass transfer id table: "<table>" job mode to "stop_load"
Given Open CDF replication and initiate pipeline creation
When User fetches the record count of table : "<table>" from SAP
Then Delete GCS folder for mass transfer id table "<table>"
Then Drop target BigQuery table "<table>"
Then Update mass transfer id table: "<table>" job mode to "<mode>"
When Source is SAP SLT fill connection parameters
Then Click on next
Then Select Table "<table>"
Then Click on next
Then Enter the BigQuery Properties for slt datasource
Then Click on next
Then Click on next
Then Click on next
Then Click on Deploy Replication Pipeline
Then Run the slt Pipeline in Runtime
Then Open Logs of SLT Pipeline
Then Wait till SLT pipeline is in running state and no error occurs
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
Then "<cud_type>" the "<count>" records with "<rfc>" in the sap table
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
Then "<cud_type>" the "<count>" records with "<rfc>" in the sap table
Then Run the slt Pipeline in Runtime
Then Open Logs of SLT Pipeline
Then Wait till SLT pipeline is in running state and no error occurs
Then Close logs and stop the pipeline
When User fetches the record count of table : "<table>" from SAP
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
Then Update mass transfer id table: "<table>" job mode to "stop_load"
Examples:
| table | mode | count | cud_type| rfc |
| mara | replication | 1 | create | rfc_matnr |

@SLT @Run-Time
Scenario Outline: User is able to verify only replication data transfers when Replicate Existing Data is false
Given User crates new MTID on "Automation" SAP
When User updates mtid config in CDF_R_SLT_SETTINGS program
Then Update mass transfer id table: "<table>" job mode to "stop_load"
Given Open CDF replication and initiate pipeline creation
When User fetches the record count of table : "<table>" from SAP
Then Delete GCS folder for mass transfer id table "<table>"
Then Drop target BigQuery table "<table>"
Then Update mass transfer id table: "<table>" job mode to "<mode>"
When Source is SAP SLT fill connection parameters
Then Replicate Existing Data is set to false
Then Click on next
Then Select Table "<table>"
Then Click on next
Then Enter the BigQuery Properties for slt datasource
Then Click on next
Then Click on next
Then Click on next
Then Click on Deploy Replication Pipeline
Then "<cud_type>" the "<count>" records with "<rfc>" in the sap table
Then Run the slt Pipeline in Runtime
Then Open Logs of SLT Pipeline
Then Wait till SLT pipeline is in running state and no error occurs
Then Close logs and stop the pipeline
When User fetches the record count of table : "<table>" from SAP
Then Get Count of no of records transferred from SLT to BigQuery in "<table>"
Then User is able to validate only replication data is loaded ie "<count>"
Then Update mass transfer id table: "<table>" job mode to "stop_load"
Examples:
| table | mode | count | cud_type| rfc |
| mara | replication | 1 | create | rfc_matnr |

@SLT @Run-Time
Scenario: User is able to delete MTID
Then User deletes the mtid

111 changes: 111 additions & 0 deletions e2e-test/java/io/cdap/plugin/slt/actions/SLTActions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* 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.plugin.slt.actions;

import io.cdap.e2e.utils.ElementHelper;
import io.cdap.e2e.utils.SeleniumDriver;
import io.cdap.e2e.utils.SeleniumHelper;
import io.cdap.plugin.slt.locators.SLTLocators;
import io.cdap.plugin.slt.utils.CDAPUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

import java.io.IOException;

/**
* SLT Actions.
*/
public class SLTActions {
public static SLTLocators sltLocators = new SLTLocators();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Remove this Instantiation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed

private static WebDriver CDFDriver;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

CDFDriver -> cdfDriver

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

updated

private static ElementHelper elementHelper = new ElementHelper();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Remove this Instantiation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed


static {
CDFDriver = SeleniumDriver.getDriver();
sltLocators = SeleniumHelper.getPropertiesLocators(SLTLocators.class);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

assignment to sltLocators is not required. You can use directly with classname
i.e. likeSLTLocators.name SLTLocators.gcsDataPath


}
public static void name_fill(String name) {
sltLocators.name.sendKeys(name);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Use ElementHelper.sendKeys

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated

}
public void required_config(String gcpProjectId,
String gcsDataPath,
String massTransferId,
String sapJcoLibGcsPath,
String jcoclienthost,
String jcoclient,
String jcoclientsysnr,
String jcoclientuser,
String jcoclientpasswd) throws IOException {
elementHelper.replaceElementValue(sltLocators.gcpProjectId,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

elementHelper -> ElementHelper

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

check all occurrences of elementHelper.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed Object.

CDAPUtils.getPluginProp(gcpProjectId));
elementHelper.sendKeys(sltLocators.gcsDataPath, CDAPUtils.getPluginProp(gcsDataPath));
elementHelper.sendKeys(sltLocators.massTransferId, massTransferId);
elementHelper.sendKeys(sltLocators.sapJcoLibGcsPath, CDAPUtils.getPluginProp(sapJcoLibGcsPath));
elementHelper.sendKeys(sltLocators.jcoclienthost, CDAPUtils.getPluginProp(jcoclienthost));
elementHelper.sendKeys(sltLocators.jcoclient, CDAPUtils.getPluginProp(jcoclient));
elementHelper.sendKeys(sltLocators.jcoclientsysnr,CDAPUtils.getPluginProp(jcoclientsysnr));
elementHelper.sendKeys(sltLocators.jcoclientuser, CDAPUtils.getPluginProp(jcoclientuser));
elementHelper.sendKeys(sltLocators.jcoclientpasswd, CDAPUtils.getPluginProp(jcoclientpasswd));
}
public void sltplugin_click() {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Use generic plugin click action from CdfStudioActions

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Method updated.

elementHelper.clickOnElement(sltLocators.sltplugin);
}

public String rowError_color() {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

rowError_color -> getRowErrorBorderColor

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

getRowErrorBorderColor used.

return elementHelper.getElementCssProperty(SLTLocators.rowError, "border-color");
}

public void next_click() {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

clickNextButton

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated as per method action.

elementHelper.clickOnElement(sltLocators.next);
}

public void select_table(String tableName) {
elementHelper.clickOnElement(sltLocators.table(tableName));
}

public void datasetName_fill (String stagingBucket) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

enterDatasetName

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated as per method action.

elementHelper.sendKeys(sltLocators.datasetName, stagingBucket);
}

public void deployPipelineClick() {
elementHelper.clickOnElement(sltLocators.deployPipeline);
}

public void startPipeline() {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

clickStartPipelineButton

Check all method names. Should start with action(i.e click , enter , select, get etc)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated as per method action.

elementHelper.clickIfDisplayed(sltLocators.start, 60l);
}

public void stopPipeline() {
elementHelper.clickOnElement(sltLocators.stop);
}

public void replicateExistingDataClick() {
elementHelper.clickOnElement(sltLocators.replicateExistingData);
}

public String replicateExistingDataGetText() {
return elementHelper.getElementText(sltLocators.replicateExistingData);
}

public void suspendSltJobClick() {
elementHelper.clickOnElement(sltLocators.suspendSltJob);
}

public String suspendSltJobGetText() {
return elementHelper.getElementText(sltLocators.suspendSltJob);
}
}
20 changes: 20 additions & 0 deletions e2e-test/java/io/cdap/plugin/slt/actions/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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.
*/

/**
* contains SLT Actions.
*/
package io.cdap.plugin.slt.actions;
Binary file not shown.
Binary file not shown.
Loading