Skip to content

Commit

Permalink
SystemAdmin feature scenarios addition
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmekumari committed Oct 17, 2023
1 parent e1d660c commit 2fac2df
Show file tree
Hide file tree
Showing 7 changed files with 216 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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 {
}
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 4 additions & 0 deletions cdap-e2e-tests/src/e2e-test/resources/errorMessage.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions cdap-e2e-tests/src/e2e-test/resources/pluginParameters.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2fac2df

Please sign in to comment.