Commit 922c6e36 authored by Tomohiro Ono's avatar Tomohiro Ono Committed by Yas Naoi
Browse files

Issue #3279437 by onotm, yas, kumikoono: Add a BDD test suite for K8s...

Issue #3279437 by onotm, yas, kumikoono: Add a BDD test suite for K8s persistent volumes (Create and Delete)
parent 92aa1900
Loading
Loading
Loading
Loading
+49 −0
Original line number Diff line number Diff line
Feature: Create resources for K8s as "Authenticated User"
  As a user
  I need to create and delete a persistent volume

  @api @javascript
  Scenario: Create a persistent volume
    Given I am logged in as user "{{ user_name }}"
    When I visit "/clouds/k8s/{{ cloud_context }}/persistent_volume/add"
    And I should see the heading "Add Persistent volume"
    And I fill in "Detail" with:
    """
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: {{ persistentvolume_name }}
    spec:
      capacity:
        storage: {{ volume_capacity }}
      storageClassName: ''
      volumeMode: Filesystem
      accessModes:
      - ReadWriteOnce
      persistentVolumeReclaimPolicy: Delete
      hostPath:
        path: {{ volume_local_path }}
    """
    And I press "Save"
    And I wait for AJAX to finish
    Then the url should match "/clouds/k8s/{{ cloud_context }}/persistent_volume"
    And I should see "has been created"
    And I should see "{{ persistentvolume_name }}" in the table

  @api @javascript
  Scenario: Delete the persistent volume
    Given I am logged in as user "{{ user_name }}"
    When I visit "/clouds/k8s/{{ cloud_context }}/persistent_volume"
    And I click "Refresh"
    And I wait {{ wait }} milliseconds
    And I should see the link "{{ persistentvolume_name }}"
    And I click "{{ persistentvolume_name }}"
    And the url should match "/k8s/{{ cloud_context }}/persistent_volume/"
    And I click "Delete" in the "actions"
    And the url should match "/delete"
    And I press "Delete"
    And I wait for AJAX to finish
    Then I should be on "/clouds/k8s/{{ cloud_context }}/persistent_volume"
    And I should see "has been deleted"
    And I click "Refresh"
    And I should not see the link "{{ persistentvolume_name }}"
+6 −0
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ namespace:
  bdd-namespace-@random
networkpolicy_name:
  bdd-np-@random
persistentvolume_name:
  bdd-persistentvolume-@random
pod_name:
  bdd-pod-@random
port:
@@ -61,5 +63,9 @@ user_name:
  BDD_user_@Random
user_password:
  BDD_pwd_@Random
volume_capacity:
  100Mi
volume_local_path:
  /tmp/bdd_volume_@random
wait:
  500