-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E2E cloud datastore #49
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
# Copyright © 2024 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. | ||
|
||
@DataStore | ||
Feature: DataStore - Verification of Datastore to Datastore Successful Data Transfer | ||
|
||
@DATASTORE_SOURCE_ENTITY @datastore_Required | ||
Scenario: To verify data is getting transferred from Datastore to Datastore successfully using filter and custom index | ||
Given Open Datafusion Project to configure pipeline | ||
Then Select plugin: "Datastore" from the plugins list as: "Source" | ||
And Navigate to the properties page of plugin: "Datastore" | ||
Then Replace input plugin property: "project" with value: "projectId" | ||
Then Enter input plugin property: "referenceName" with value: "ReferenceName" | ||
Then Enter key value pairs for plugin property: "filters" with values from json: "filterOptions" | ||
Then Enter kind for datastore plugin | ||
Then Select dropdown plugin property: "keyType" with option value: "None" | ||
Then Click on the Get Schema button | ||
Then Validate "Datastore" plugin properties | ||
Then Close the Plugin Properties page | ||
And Select Sink plugin: "Datastore" from the plugins list | ||
Then Connect plugins: "Datastore" and "Datastore2" to establish connection | ||
Then Navigate to the properties page of plugin: "Datastore2" | ||
Then Replace input plugin property: "project" with value: "projectId" | ||
Then Enter input plugin property: "referenceName" with value: "refName" | ||
Then Enter kind for datastore plugin | ||
Then Select dropdown plugin property: "indexStrategy" with option value: "Custom" | ||
Then Enter Value for plugin property table key : "indexedProperties" with values: "propertyName" | ||
Then Validate "datastore2" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Save and Deploy Pipeline | ||
Then Run the Pipeline in Runtime | ||
Then Wait till pipeline is in running state | ||
Then Validate OUT record count is equal to IN record count | ||
Then Open and capture logs | ||
Then Verify the pipeline status is "Succeeded" | ||
Then Close the pipeline logs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add data validation step in all scenarios, refer ITN if added. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now we are not going with data validation step for datastore. |
||
Then Validate The Data From Datastore To Datastore With Actual And Expected File for: "dsExpectedFile" | ||
|
||
@DATASTORE_SOURCE_ENTITY @datastore_Required | ||
Scenario: To verify data is getting transferred from Datastore to Datastore using Urlsafekey | ||
Given Open Datafusion Project to configure pipeline | ||
Then Select plugin: "Datastore" from the plugins list as: "Source" | ||
And Navigate to the properties page of plugin: "Datastore" | ||
Then Replace input plugin property: "project" with value: "projectId" | ||
Then Enter input plugin property: "referenceName" with value: "ReferenceName" | ||
Then Enter key value pairs for plugin property: "filters" with values from json: "filterOptions" | ||
Then Enter kind for datastore plugin | ||
Then Select dropdown plugin property: "keyType" with option value: "URL-safe key" | ||
Then Enter input plugin property: "keyAlias" with value: "fieldName" | ||
Then Click on the Get Schema button | ||
Then Validate "Datastore" plugin properties | ||
Then Close the Plugin Properties page | ||
And Select Sink plugin: "Datastore" from the plugins list | ||
Then Connect plugins: "Datastore" and "Datastore2" to establish connection | ||
Then Navigate to the properties page of plugin: "Datastore2" | ||
Then Replace input plugin property: "project" with value: "projectId" | ||
Then Enter input plugin property: "referenceName" with value: "refName" | ||
Then Select dropdown plugin property: "keyType" with option value: "URL-safe key" | ||
Then Enter input plugin property: "keyAlias" with value: "fieldName" | ||
Then Enter kind for datastore plugin | ||
Then Enter Ancestor for the datastore plugin | ||
Then Validate "datastore2" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Save and Deploy Pipeline | ||
Then Run the Pipeline in Runtime | ||
Then Wait till pipeline is in running state | ||
Then Validate OUT record count is equal to IN record count | ||
Then Open and capture logs | ||
Then Verify the pipeline status is "Succeeded" | ||
Then Close the pipeline logs | ||
Then Validate The Data From Datastore To Datastore With Actual And Expected File for: "dsExpectedFile" | ||
|
||
@DATASTORE_SOURCE_ENTITY @datastore_Required | ||
Scenario: To verify data is getting transferred from Datastore to Datastore using Ancestor and Key Literal | ||
Given Open Datafusion Project to configure pipeline | ||
Then Select plugin: "Datastore" from the plugins list as: "Source" | ||
And Navigate to the properties page of plugin: "Datastore" | ||
Then Replace input plugin property: "project" with value: "projectId" | ||
Then Enter input plugin property: "referenceName" with value: "ReferenceName" | ||
Then Enter kind for datastore plugin | ||
Then Enter Ancestor for the datastore plugin | ||
Then Select dropdown plugin property: "keyType" with option value: "Key literal" | ||
Then Enter input plugin property: "keyAlias" with value: "fieldName" | ||
Then Click on the Get Schema button | ||
Then Validate "Datastore" plugin properties | ||
Then Close the Plugin Properties page | ||
And Select Sink plugin: "Datastore" from the plugins list | ||
Then Connect plugins: "Datastore" and "Datastore2" to establish connection | ||
Then Navigate to the properties page of plugin: "Datastore2" | ||
Then Replace input plugin property: "project" with value: "projectId" | ||
Then Enter input plugin property: "referenceName" with value: "refName" | ||
Then Select dropdown plugin property: "keyType" with option value: "Key literal" | ||
Then Enter input plugin property: "keyAlias" with value: "fieldName" | ||
Then Enter kind for datastore plugin | ||
Then Enter Ancestor for the datastore plugin | ||
Then Validate "datastore2" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Save and Deploy Pipeline | ||
Then Run the Pipeline in Runtime | ||
Then Wait till pipeline is in running state | ||
Then Validate OUT record count is equal to IN record count | ||
Then Open and capture logs | ||
Then Verify the pipeline status is "Succeeded" | ||
Then Close the pipeline logs | ||
Then Validate The Data From Datastore To Datastore With Actual And Expected File for: "dsExpectedFile" | ||
|
||
@DATASTORE_SOURCE_ENTITY @datastore_Required | ||
Scenario: To verify data is getting transferred from Datastore to Datastore using Ancestor and Custom Key | ||
Given Open Datafusion Project to configure pipeline | ||
Then Select plugin: "Datastore" from the plugins list as: "Source" | ||
And Navigate to the properties page of plugin: "Datastore" | ||
Then Replace input plugin property: "project" with value: "projectId" | ||
Then Enter input plugin property: "referenceName" with value: "ReferenceName" | ||
Then Enter kind for datastore plugin | ||
Then Enter Ancestor for the datastore plugin | ||
Then Select dropdown plugin property: "keyType" with option value: "Key literal" | ||
Then Enter input plugin property: "keyAlias" with value: "fieldName" | ||
Then Click on the Get Schema button | ||
Then Validate "Datastore" plugin properties | ||
Then Close the Plugin Properties page | ||
And Select Sink plugin: "Datastore" from the plugins list | ||
Then Connect plugins: "Datastore" and "Datastore2" to establish connection | ||
Then Navigate to the properties page of plugin: "Datastore2" | ||
Then Replace input plugin property: "project" with value: "projectId" | ||
Then Enter input plugin property: "referenceName" with value: "refName" | ||
Then Select dropdown plugin property: "keyType" with option value: "Custom name" | ||
Then Enter input plugin property: "keyAlias" with value: "fieldName" | ||
Then Enter kind for datastore plugin | ||
Then Validate "datastore2" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Save and Deploy Pipeline | ||
Then Run the Pipeline in Runtime | ||
Then Wait till pipeline is in running state | ||
Then Validate OUT record count is equal to IN record count | ||
Then Open and capture logs | ||
Then Verify the pipeline status is "Succeeded" | ||
Then Close the pipeline logs | ||
Then Validate The Data From Datastore To Datastore With Actual And Expected File for: "dsExpectedFile" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright © 2024 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.datastore.actions; | ||
|
||
import io.cdap.e2e.utils.ElementHelper; | ||
import io.cdap.e2e.utils.SeleniumHelper; | ||
import io.cdap.plugin.datastore.locators.DataStoreLocators; | ||
import io.cdap.plugin.utils.DataStoreClient; | ||
|
||
/** | ||
* DataStore Plugin related actions. | ||
*/ | ||
public class DataStoreActions { | ||
static { | ||
SeleniumHelper.getPropertiesLocators(DataStoreLocators.class); | ||
} | ||
|
||
/** | ||
* Enters the specified kind name into the appropriate field in the user interface. | ||
* | ||
* @param kindName the name of the kind to be entered | ||
*/ | ||
public static void enterKind(String kindName) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add small java doc for methods. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added |
||
ElementHelper.sendKeys(DataStoreLocators.kind, kindName); | ||
} | ||
|
||
/** | ||
* Enters the key literal of the current entity into the appropriate field in the user interface | ||
* as the ancestor. | ||
*/ | ||
public static void enterAncestor() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we creating method to send text, can't we use existing framework steps ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we are going with as per ganesh's comments to go for locators with data-testid if we can use them, so i just use these 2 new fields with data-testid. |
||
ElementHelper.sendKeys(DataStoreLocators.ancestor, DataStoreClient.getKeyLiteral()); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* Package contains the actions for the DataStore features. | ||
*/ | ||
package io.cdap.plugin.datastore.actions; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright © 2024 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.datastore.locators; | ||
|
||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
import org.openqa.selenium.support.How; | ||
|
||
/** | ||
* DataStore Plugin related step design. | ||
*/ | ||
public class DataStoreLocators { | ||
@FindBy(how = How.XPATH, using = "//input[@data-testid='kind']") | ||
public static WebElement kind; | ||
|
||
@FindBy(how = How.XPATH, using = "//input[@data-testid='ancestor']") | ||
public static WebElement ancestor; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* Package contains the locators for the DataStore features. | ||
*/ | ||
package io.cdap.plugin.datastore.locators; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright © 2024 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.datastore.runner; | ||
|
||
import io.cucumber.junit.Cucumber; | ||
import io.cucumber.junit.CucumberOptions; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* Test Runner to execute Datastore cases. | ||
*/ | ||
@RunWith(Cucumber.class) | ||
@CucumberOptions( | ||
features = {"src/e2e-test/features"}, | ||
glue = {"io.cdap.plugin.datastore.stepsdesign", "io.cdap.plugin.common.stepsdesign", | ||
"stepsdesign"}, | ||
tags = {"@DataStore"}, | ||
monochrome = true, | ||
plugin = {"pretty", "html:target/cucumber-html-report/datastore", | ||
"json:target/cucumber-reports/cucumber-datastore.json", | ||
"junit:target/cucumber-reports/cucumber-datastore.xml"} | ||
) | ||
public class TestRunner { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright © 2024 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.datastore.runner; | ||
|
||
import io.cucumber.junit.Cucumber; | ||
import io.cucumber.junit.CucumberOptions; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* Test Runner to execute only required DataStore cases. | ||
*/ | ||
@RunWith(Cucumber.class) | ||
@CucumberOptions( | ||
features = {"src/e2e-test/features"}, | ||
glue = {"io.cdap.plugin.datastore.stepsdesign", "io.cdap.plugin.common.stepsdesign", | ||
"stepsdesign"}, | ||
tags = {"@datastore_Required"}, | ||
monochrome = true, | ||
plugin = {"pretty", "html:target/cucumber-html-report/datastore-required", | ||
"json:target/cucumber-reports/cucumber-datastore-required.json", | ||
"junit:target/cucumber-reports/cucumber-datastore-required.xml"} | ||
) | ||
|
||
public class TestRunnerRequired { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* Package contains the DataStore runners. | ||
*/ | ||
package io.cdap.plugin.datastore.runner; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the datastore folder name in e2e.yml file to execute the tests on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added.