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

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

Issue #3283536 by shota niioka, kumikoono, yas: Add a BDD test suite for K8s Service Accounts (Read and Update)
parent 97911cca
Loading
Loading
Loading
Loading
+42 −2
Original line number Diff line number Diff line
@minimal @ci_job
Feature: Create and delete a service account for K8s as "Authenticated User"
Feature: Create, read, update and delete a service account for K8s as "Authenticated User"

  @api @javascript
  Scenario: Create a service account
@@ -21,6 +21,46 @@ Feature: Create and delete a service account for K8s as "Authenticated User"
    And I should see neither error nor warning messages
    And I should see "{{ serviceaccount_name }}" in the "{{ namespace }}" row

  @api @javascript
  Scenario: Read the service account
    Given I am logged in as user "{{ user_name }}"
    When I visit "/clouds/k8s/{{ cloud_context }}/service_account"
    And I click "Refresh"
    And I wait {{ wait }} milliseconds
    And I should see the link "{{ serviceaccount_name }}"
    And I click "{{ serviceaccount_name }}"
    Then the url should match "/k8s/{{ cloud_context }}/service_account/"
    And I should see "{{ serviceaccount_name }}"
    And I should see "{{ namespace }}"
    And I should see neither error nor warning messages

  @api @javascript
  Scenario: Update the service account
    Given I am logged in as user "{{ user_name }}"
    When I visit "/clouds/k8s/{{ cloud_context }}/service_account"
    And I click "Refresh"
    And I wait {{ wait }} milliseconds
    And I should see the link "{{ serviceaccount_name }}"
    And I click "{{ serviceaccount_name }}"
    Then the url should match "clouds/k8s/{{ cloud_context }}/service_account/"
    And I click "Edit"
    And I fill in "Detail" with:
    """
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: {{ serviceaccount_name }}
      labels:
        app: {{ app_name }}
    """
    And I press "Save"
    And I wait for AJAX to finish
    Then the url should match "clouds/k8s/{{ cloud_context }}/service_account"
    And I should see the success message "has been updated"
    And I should see neither error nor warning messages
    And I click "{{ serviceaccount_name }}"
    And I should see "{{ app_name }}"

  @api @javascript
  Scenario: Delete the service account
    Given I am logged in as user "{{ user_name }}"
@@ -29,7 +69,7 @@ Feature: Create and delete a service account for K8s as "Authenticated User"
    And I wait {{ wait }} milliseconds
    And I should see the link "{{ serviceaccount_name }}"
    And I click "{{ serviceaccount_name }}"
    And the url should match "/k8s/{{ cloud_context }}/service_account/"
    Then the url should match "clouds/k8s/{{ cloud_context }}/service_account/"
    And I click "Delete" in the "actions"
    And the url should match "/delete"
    And I press "Delete"