Skip to content
Snippets Groups Projects

Issue #3284361: Add a BDD test suite for K8s Cluster Role (Read and Update)

Merged Issue #3284361: Add a BDD test suite for K8s Cluster Role (Read and Update)
Merged shota niioka requested to merge issue/cloud-3284361:3284361-crole into 5.x
@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"
Loading