Skip to content
Snippets Groups Projects
Commit 453505d6 authored by shota niioka's avatar shota niioka Committed by Yas Naoi
Browse files

Issue #3284361 by shota niioka, kumikoono, yas: Add a BDD test suite for K8s...

Issue #3284361 by shota niioka, kumikoono, yas: Add a BDD test suite for K8s Cluster Role (Read and Update)
parent b5018b97
No related branches found
No related tags found
No related merge requests found
@minimal @ci_job
Feature: Create and delete a cluster role K8s as "Authenticated User"
Feature: Create, read, update and delete a cluster role K8s as "Authenticated User"
@api @javascript
Scenario: Create a cluster role
Given I am logged in as user "{{ user_name }}"
When I visit "/clouds/k8s/{{ cloud_context }}/cluster_role/add"
And I fill in "Detail" with:
"""
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ cluster_role_name }}
rules:
- apiGroups: ["{{ role_api }}"]
resources: ["{{ role_resource }}"]
verbs: ["{{ role_verb }}"]
"""
"""
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ cluster_role_name }}
rules:
- apiGroups: ["{{ role_api }}"]
resources: ["{{ role_resource }}"]
verbs: ["{{ role_verb }}"]
"""
And I press "Save"
And I wait for AJAX to finish
Then the url should match "/clouds/k8s/{{ cloud_context }}/cluster_role"
......@@ -24,18 +24,61 @@ Feature: Create and delete a cluster role K8s as "Authenticated User"
And I should see "{{ cluster_role_name }}"
@api @javascript
Scenario: Delete a cluster role
Scenario: Read the cluster role
Given I am logged in as user "{{ user_name }}"
When I visit "/clouds/k8s/{{ cloud_context }}/cluster_role"
And I click "Refresh"
And I should see the link "{{ cluster_role_name }}"
And I wait {{ wait }} milliseconds
And I click "{{ cluster_role_name }}"
And the url should match "/cluster_role/"
Then the url should match "/clouds/k8s/{{ cloud_context }}/cluster_role/"
And I should see "{{ cluster_role_name }}"
And I should see "{{ role_resource }}"
And I should see neither error nor warning messages
@api @javascript
Scenario: Update the cluster role
Given I am logged in as user "{{ user_name }}"
When I visit "/clouds/k8s/{{ cloud_context }}/cluster_role"
And I click "Refresh"
And I should see the link "{{ cluster_role_name }}"
And I wait {{ wait }} milliseconds
And I click "{{ cluster_role_name }}"
Then the url should match "/clouds/k8s/{{ cloud_context }}/cluster_role/"
And I click "Edit"
And I fill in "Detail" with:
"""
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ cluster_role_name }}
rules:
- apiGroups: ["{{ role_api }}"]
resources: ["{{ role_resource }}"]
verbs: ["{{ role_verb_edit }}"]
"""
And I press "Save"
And I wait for AJAX to finish
Then the url should match "/clouds/k8s/{{ cloud_context }}/cluster_role"
And I should see the success message "has been updated"
And I should see neither error nor warning messages
And I click "{{ cluster_role_name }}"
Then the url should match "/clouds/k8s/{{ cloud_context }}/cluster_role/"
And I should see "{{ role_verb_edit }}"
@api @javascript
Scenario: Delete the cluster role
Given I am logged in as user "{{ user_name }}"
When I visit "/clouds/k8s/{{ cloud_context }}/cluster_role"
And I click "Refresh"
And I should see the link "{{ cluster_role_name }}"
And I wait {{ wait }} milliseconds
And I click "{{ cluster_role_name }}"
Then the url should match "/clouds/k8s/{{ cloud_context }}/cluster_role/"
And I click "Delete"
And the url should match "/delete"
And I press "Delete"
And I should be on "/clouds/k8s/{{ cloud_context }}/cluster_role"
Then I should be on "/clouds/k8s/{{ cloud_context }}/cluster_role"
And I should see the success message "has been deleted"
And I should see neither error nor warning messages
And I click "Refresh"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment