From 2fac2df4424766655b8226143cda448334f6ec4e Mon Sep 17 00:00:00 2001 From: suryakumari Date: Fri, 22 Sep 2023 19:03:04 +0530 Subject: [PATCH] SystemAdmin feature scenarios addition --- .../systemadmin/SysAdminDesignTime.feature | 69 +++++++++++++++++++ .../SysAdminDesignTimeValidation.feature | 64 +++++++++++++++++ .../cdap/systemadmin/runners/TestRunner.java | 36 ++++++++++ .../systemadmin/runners/package-info.java | 20 ++++++ .../resources/errorMessage.properties | 4 ++ .../pluginDataCyAttributes.properties | 11 +++ .../resources/pluginParameters.properties | 12 ++++ 7 files changed, 216 insertions(+) create mode 100644 cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTime.feature create mode 100644 cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTimeValidation.feature create mode 100644 cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/TestRunner.java create mode 100644 cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/package-info.java create mode 100644 cdap-e2e-tests/src/e2e-test/resources/errorMessage.properties create mode 100644 cdap-e2e-tests/src/e2e-test/resources/pluginDataCyAttributes.properties diff --git a/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTime.feature b/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTime.feature new file mode 100644 index 000000000000..04763e7414ab --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTime.feature @@ -0,0 +1,69 @@ +# +# Copyright © 2023 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. +# + +@Sysadmin +Feature: Sysadmin - Validate system admin page design time scenarios + + @Sysadmin + Scenario:Validate user is able to create new system preferences and able to delete the added system preferences successfully + Given Open Datafusion Project to configure pipeline + Then Open "System Admin" menu + Then Click on the Configuration link on the System admin page + Then Select "systemPreferences" option from Configuration page + Then Click on edit system preferences + Then Set system preferences with key: "keyValue" and value: "systemPreferences1" + Then Click on the Save & Close preferences button + Then Select "systemPreferences" option from Configuration page + Then Click on edit system preferences + Then Delete the preferences + Then Click on the Save & Close preferences button + + Scenario:Validate user is able to add multiple system preferences inside system admin successfully + Given Open Datafusion Project to configure pipeline + Then Open "System Admin" menu + Then Click on the Configuration link on the System admin page + Then Select "systemPreferences" option from Configuration page + Then Click on edit system preferences + Then Set system preferences with key: "keyValue" and value: "systemPreferences2" + Then Click on the Save & Close preferences button + Then Click on edit system preferences + Then Delete the preferences + Then Delete the preferences + Then Click on the Save & Close preferences button + + Scenario:Validate user is able to successfully reload system artifacts using reload + Given Open Datafusion Project to configure pipeline + Then Open "System Admin" menu + Then Click on the Configuration link on the System admin page + Then Click on Reload System Artifacts from the System admin page + Then Click on Reload button on popup to reload the System Artifacts successfully + Then Select "systemPreferences" option from Configuration page + + Scenario:Validate user is able to open compute profile page and create a compute profile for selected provisioner + Given Open Datafusion Project to configure pipeline + Then Open "System Admin" menu + Then Click on the Configuration link on the System admin page + Then Click on the Compute Profile from the System admin page + Then Click on create compute profile button + Then Select a provisioner: "remoteHadoopProvisioner" for the compute profile + Then Verify the Create a Profile page is loaded for selected provisioner + Then Enter input plugin property: "profileLabel" with value: "validProfile" + Then Enter textarea plugin property: "profileDescription" with value: "validDescription" + Then Enter input plugin property: "host" with value: "testHost" + Then Enter input plugin property: "user" with value: "testUser" + Then Enter textarea plugin property: "sshKey" with value: "testSSHKey" + Then Click on: "Create" button in the properties + Then Verify the created compute profile: "validProfile" is displayed in system compute profile list diff --git a/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTimeValidation.feature b/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTimeValidation.feature new file mode 100644 index 000000000000..447265b68963 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTimeValidation.feature @@ -0,0 +1,64 @@ +# +# Copyright © 2023 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. +# + +@Sysadmin +Feature: Sysadmin - Validate system admin page design time validation scenarios + + Scenario:Validate user is able reset the system preferences added inside system admin successfully + Given Open Datafusion Project to configure pipeline + Then Open "System Admin" menu + Then Click on the Configuration link on the System admin page + Then Select "systemPreferences" option from Configuration page + Then Click on edit system preferences + Then Set system preferences with key: "keyValue" and value: "systemPreferences1" + Then Reset the preferences + Then Verify the reset is successful for added preferences + + Scenario:To verify the validation error message with invalid cluster name + Given Open Datafusion Project to configure pipeline + Then Open "System Admin" menu + Then Click on the Configuration link on the System admin page + Then Click on the Compute Profile from the System admin page + Then Click on create compute profile button + Then Select a provisioner: "existingDataProc" for the compute profile + Then Enter input plugin property: "profileLabel" with value: "validProfile" + Then Enter textarea plugin property: "profileDescription" with value: "validDescription" + Then Enter input plugin property: "clusterName" with value: "invalidClusterName" + Then Click on: "Create" button in the properties + Then Verify that the compute profile is displaying an error message: "errorInvalidClusterName" on the footer + + Scenario:To verify the validation error message with invalid profile name + Given Open Datafusion Project to configure pipeline + Then Open "System Admin" menu + Then Click on the Configuration link on the System admin page + Then Click on the Compute Profile from the System admin page + Then Click on create compute profile button + Then Select a provisioner: "existingDataProc" for the compute profile + Then Enter input plugin property: "profileLabel" with value: "invalidProfile" + Then Enter textarea plugin property: "profileDescription" with value: "validDescription" + Then Enter input plugin property: "clusterName" with value: "validClusterName" + Then Click on: "Create" button in the properties + Then Verify that the compute profile is displaying an error message: "errorInvalidProfileName" on the footer + + Scenario:To verify the validation error message with invalid namespace name + Given Open Datafusion Project to configure pipeline + Then Open "System Admin" menu + Then Click on the Configuration link on the System admin page + Then Click on Create New Namespace button + Then Enter the New Namespace Name with value: "invalidNamespaceName" + Then Enter the Namespace Description with value: "validNamespaceDescription" + Then Click on: "Finish" button in the properties + Then Verify the failed error message: "errorInvalidNamespace" displayed on dialog box diff --git a/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/TestRunner.java b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/TestRunner.java new file mode 100644 index 000000000000..dfdd7ccc1486 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/TestRunner.java @@ -0,0 +1,36 @@ +/* + * Copyright © 2023 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.cdap.systemadmin.runners; + +import io.cucumber.junit.Cucumber; +import io.cucumber.junit.CucumberOptions; +import org.junit.runner.RunWith; + +/** + * Test Runner to execute system admin related test cases. + */ +@RunWith(Cucumber.class) +@CucumberOptions( + features = {"src/e2e-test/features"}, + glue = {"io.cdap.cdap.systemadmin.stepsdesign", "stepsdesign"}, + tags = {"@Sysadmin"}, + plugin = {"pretty", "html:target/cucumber-html-report/systemadmin", + "json:target/cucumber-reports/cucumber-systemadmin.json", + "junit:target/cucumber-reports/cucumber-systemadmin.xml"} +) +public class TestRunner { +} diff --git a/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/package-info.java b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/package-info.java new file mode 100644 index 000000000000..084b2e6019c7 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright © 2023 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 contains the runners for system admin features. + */ +package io.cdap.cdap.systemadmin.runners; diff --git a/cdap-e2e-tests/src/e2e-test/resources/errorMessage.properties b/cdap-e2e-tests/src/e2e-test/resources/errorMessage.properties new file mode 100644 index 000000000000..ae069094bc11 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/resources/errorMessage.properties @@ -0,0 +1,4 @@ +validationResetSuccessMessage=Reset Successful +errorInvalidClusterName=Unable to get credentials from the environment. Please explicitly set the account key. +errorInvalidProfileName=Invalid profile ID: 6*&gjh879. Should only contain alphanumeric characters and _ or -. +errorInvalidNamespace=Failed to Add namespace diff --git a/cdap-e2e-tests/src/e2e-test/resources/pluginDataCyAttributes.properties b/cdap-e2e-tests/src/e2e-test/resources/pluginDataCyAttributes.properties new file mode 100644 index 000000000000..e7da1a0d6c62 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/resources/pluginDataCyAttributes.properties @@ -0,0 +1,11 @@ +systemPreferences=system-prefs-accordion +keyValue=key-value-pair- +existingDataProc=provisioner-gcp-existing-dataproc +gcpDataProc=provisioner-gcp-dataproc +remoteHadoopProvisioner=provisioner-remote-hadoop +Create=profile-create-btn +Finish=wizard-finish-btn +Next=wizard-next-btn +Previous=wizard-previous-btn +profileName=profile-list- +amazonEMRProvisioner=provisioner-aws-emr diff --git a/cdap-e2e-tests/src/e2e-test/resources/pluginParameters.properties b/cdap-e2e-tests/src/e2e-test/resources/pluginParameters.properties index f91925346d6d..a1834299268a 100644 --- a/cdap-e2e-tests/src/e2e-test/resources/pluginParameters.properties +++ b/cdap-e2e-tests/src/e2e-test/resources/pluginParameters.properties @@ -3,3 +3,15 @@ clientUrl=http://localhost:11011 serverUrl=https://placeholder.com/api # command to generate token: gcloud auth print-access-token serverAccessToken=placeholder + +## SYSTEMADMIN-PROPERTIES-START +systemPreferences1=[{"key":"dataset","value":"test_automation"}] +systemPreferences2=[{"key":"projectId","value":"cdf-athena"},{"key":"datasetprojectId","value":"cdf-athena"}] +validProfile=TestProfile +validDescription=TestDescription +validClusterName=TestClusterName +invalidNamespaceName=^%&&3%% +validNamespaceDescription=Test Description +invalidProfile=6*&gjh879 +invalidClusterName=$^%%&^GHJJH89 +## SYSTEMADMIN-PROPERTIES-END