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

Issue #3291595 by shota niioka, kumikoono, yas: Add a BDD test suite for snapshots (CRUD)

parent 440e5588
Loading
Loading
Loading
Loading
+90 −0
Original line number Diff line number Diff line
@minimal @ci_job
Feature: Create, read, update and delete a Snapshot for OpenStack as "Authenticated User"

  @api @javascript
  Scenario: Create a snapshot
    Given I am logged in as user "{{ drupal_user_name }}"
    # Add a volume
    When I visit "/clouds/openstack/{{ cloud_context }}/volume/add"
    And I should see the heading "Add Openstack Volume"
    And I enter "{{ volume_name }}" for "Name"
    And I enter "{{ volume_size }}" for "Size (GiB)"
    And I press "Save"
    Then the url should match "/clouds/openstack/{{ cloud_context }}/volume"
    And I should see the success message "has been created"
    And I should see neither error nor warning messages
    And I should see "{{ volume_name }}"
    # Add a snapshot
    And I visit "/clouds/openstack/{{ cloud_context }}/snapshot/add"
    And I should see the heading "Add OpenStack Snapshot"
    And I enter "{{ snapshot_name }}" for "Name"
    And I select "{{ volume_name }}" from "Volume ID"
    And I press "Save"
    And I wait for AJAX to finish
    Then the url should match "/clouds/openstack/{{ cloud_context }}/snapshot"
    And I should see the success message "has been created"
    And I should see neither error nor warning messages
    And I should see "{{ snapshot_name }}"

  @api @javascript
  Scenario: read the snapshot
    Given I am logged in as user "{{ drupal_user_name }}"
    When I visit "/clouds/openstack/{{ cloud_context }}/snapshot"
    And I click "Refresh"
    And I should see the link "{{ snapshot_name }}"
    And I wait {{ wait }} milliseconds
    And I click "{{ snapshot_name }}"
    Then the url should match "/clouds/openstack/{{ cloud_context }}/snapshot/"
    And I should see "{{ snapshot_name }}"
    And I should see "{{ volume_size }}"

  @api @javascript
  Scenario: update the snapshot
    Given I am logged in as user "{{ drupal_user_name }}"
    When I visit "/clouds/openstack/{{ cloud_context }}/snapshot"
    And I click "Refresh"
    And I should see the link "{{ snapshot_name }}"
    And I wait {{ wait }} milliseconds
    And I click "{{ snapshot_name }}"
    Then the url should match "/clouds/openstack/{{ cloud_context }}/snapshot/"
    And I click "Edit"
    Then the url should match "/edit"
    And I enter "{{ snapshot_name_edit }}" for "Name"
    And I press "Save"
    And I should see "{{ snapshot_name_edit }}"

  @api @javascript
  Scenario: delete the snapshot
    Given I am logged in as user "{{ drupal_user_name }}"
    When I visit "/clouds/openstack/{{ cloud_context }}/snapshot"
    And I click "Refresh"
    And I should see the link "{{ snapshot_name_edit }}"
    And I wait {{ wait }} milliseconds
    And I click "{{ snapshot_name_edit }}"
    Then the url should match "/clouds/openstack/{{ cloud_context }}/snapshot/"
    And I click "Delete"
    Then the url should match "/delete"
    And I press "Delete"
    Then I should be on "/clouds/openstack/{{ cloud_context }}/snapshot"
    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 "{{ snapshot_name_edit }}"

  @api @javascript
  Scenario: delete the volume
    Given I am logged in as user "{{ drupal_user_name }}"
    When I visit "/clouds/openstack/{{ cloud_context }}/volume"
    And I click "Refresh"
    And I should see the link "{{ volume_name }}"
    And I wait {{ wait }} milliseconds
    And I click "{{ volume_name }}"
    Then the url should match "/clouds/openstack/{{ cloud_context }}/volume/"
    And I click "Delete"
    Then the url should match "/delete"
    And I press "Delete"
    Then I should be on "/clouds/openstack/{{ cloud_context }}/volume"
    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 "{{ volume_name }}"
+8 −0
Original line number Diff line number Diff line
@@ -49,11 +49,19 @@ security_group_description:
  testing for bdd
security_group_name:
  BDD_SG_@Random
snapshot_name:
  BDD_snapshot_@Random
snapshot_name_edit:
  BDD_snapshot_@Random_edit
status:
  available
user_name:
  # You need to change the value here, or define the key-value
user_password:
  # You need to change the value here, or define the key-value
volume_name:
  BDD_volume_@Random
volume_size:
  1
wait:
  500