Commit a3e7d8a6 authored by shota niioka's avatar shota niioka Committed by Yas Naoi
Browse files

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

Issue #3282193 by shota niioka, yas, kumikoono: Add a BDD test suite for K8s Cluster Role Bindings (Read and Update)
parent 539a8fcf
Loading
Loading
Loading
Loading
+66 −17
Original line number Diff line number Diff line
@minimal @ci_job
Feature: Create and delete cluster role binding for K8s as "Authenticated User"
Feature: Create, read, update and delete cluster role binding for K8s as "Authenticated User"

  @api @javascript
  Scenario: Create a cluster role binding
@@ -24,9 +24,57 @@ Feature: Create and delete cluster role binding for K8s as "Authenticated User"
    And I press "Save"
    And I wait for AJAX to finish
    Then the url should match "/clouds/k8s/{{ cloud_context }}/cluster_role_binding"
    And I should see "has been created"
    And I should see the success message "has been created"
    And I should see neither error nor warning messages
    And I should see "{{ cluster_role_binding_name }}"

  @api @javascript
  Scenario: Read a cluster role binding
    Given I am logged in as user "{{ user_name }}"
    When I visit "/clouds/k8s/{{ cloud_context }}/cluster_role_binding"
    And I click "Refresh"
    And I should see the link "{{ cluster_role_binding_name }}"
    And I wait {{ wait }} milliseconds
    And I click "{{ cluster_role_binding_name }}"
    And the url should match "/cluster_role_binding/"
    And I should see "{{ cluster_role_binding_name }}"
    And I should see "{{ role_binding_sub_user }}"
    And I should see neither error nor warning messages

  @api @javascript
  Scenario: Update cluster role binding
    Given I am logged in as user "{{ user_name }}"
    When I visit "/clouds/k8s/{{ cloud_context }}/cluster_role_binding"
    And I click "Refresh"
    And I should see the link "{{ cluster_role_binding_name }}"
    And I wait {{ wait }} milliseconds
    And I click "{{ cluster_role_binding_name }}"
    And the url should match "/cluster_role_binding/"
    And I click "Edit"
    And I fill in "Detail" with:
    """
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: {{ cluster_role_binding_name }}
    subjects:
    - kind: {{ role_binding_sub_kind }}
      name: {{ role_binding_sub_user_edit }}
      apiGroup: {{ role_binding_api }}
    roleRef:
      kind: {{ cluster_role_binding_role_kind }}
      name: {{ cluster_role_name }} 
      apiGroup: {{ role_binding_api }}
    """
    And I press "Save"
    And I wait for AJAX to finish
    And the url should match "/clouds/k8s/{{ cloud_context }}/cluster_role_binding"
    And I should see the success message "has been updated"
    And I should see neither error nor warning messages
    And I click "{{ cluster_role_binding_name }}"
    And the url should match "/cluster_role_binding/"
    And I should see "{{ role_binding_sub_user_edit }}"

  @api @javascript
  Scenario: Delete a cluster role binding
    Given I am logged in as user "{{ user_name }}"
@@ -40,6 +88,7 @@ Feature: Create and delete cluster role binding for K8s as "Authenticated User"
    And the url should match "/delete"
    And I press "Delete"
    And I should be on "/clouds/k8s/{{ cloud_context }}/cluster_role_binding"
    And I should see "has been deleted"
    And I should see the success message "has been deleted"
    And I should see neither error nor warning messages
    And I click "Refresh"
    And I should not see the link "{{ cluster_role_binding_name }}"