Commit f75e251a authored by Kumiko Ono's avatar Kumiko Ono Committed by Yas Naoi
Browse files

Issue #3293224 by kumikoono, makoto suzuki, yas: Add a BDD test suite for...

Issue #3293224 by kumikoono, makoto suzuki, yas: Add a BDD test suite for launch templates (Create and Delete)
parent 6d220afb
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@minimal
@minimal @ci_job @setup
Feature: Create a cloud service provider for VMware as "Cloud administrator"
  In order to start BDD testing
  We need to create a cloud service provider

  @setup
  @api
  Scenario: Add a VMware Cloud service provider
    Given I am logged in as a user with the "Cloud administrator" role
+5 −2
Original line number Diff line number Diff line
@@ -19,11 +19,14 @@ Feature: Create a Drupal role for VMware as "Administrator"
    Then I should be on "/admin/people/roles"
    And I should see "{{ drupal_role_name }}"
    And I visit "/admin/people/permissions/{{ drupal_role_name_machine }}"
    # Access entities
    And I check the box "View any VMware Host"
    # Temporarily adds own permissions, which are supposed to be set by default.
    And I check the box "Delete own VMware VM"
    And I check the box "Edit own VMware VM"
    And I check the box "View any VMware Host"
    And I check the box "View own VMware VM"
    # Temporarily adds any permissions.
    And I check the box "View any cloud launch templates"
    And I check the box "Delete any cloud launch templates"
    # Allow to see the cloud service provider
    And I check the box "Access {{ cloud_service_provider_name }}"
    # Allow to launch an instance.
+105 −0
Original line number Diff line number Diff line
@minimal @ci_job
Feature: Create, read, launch, copy and delete a Launch template 
  for VMware as "Authenticated User"

  @api @javascript
  Scenario: Create a Launch template
    Given I am logged in as user "{{ drupal_user_name }}"
    When I visit "/clouds/design/server_template/{{ cloud_context }}/vmware/add"
    And I should see the heading "Add VMware"
    And I enter "{{ launch_template_name }}" for "Name"
    And I select "{{ vm_guest_os }}" from "Guest OS"
    And I enter {{ vm_disk_size }} for "Disk Size (GiB)"
    And I press "Save"
    And I wait for AJAX to finish
    Then the url should match "/clouds/design/server_template/{{ cloud_context }}/"
    And I should see the success message "has been created"
    And I should see neither error nor warning messages

  @api @javascript
  Scenario: Read the launch template
    Given I am logged in as user "{{ drupal_user_name }}"
    When I visit "/clouds/design/server_template/{{ cloud_context }}"
    And I click "Refresh"
    And I wait {{ wait }} milliseconds
    And I should see the link "{{ launch_template_name }}"
    And I click "{{ launch_template_name }}"
    Then the url should match "/clouds/design/server_template/{{ cloud_context }}"
    And I should see "{{ vm_guest_os }}"
    And I should see "{{ vm_disk_size }}"

  @api @javascript
  Scenario: Launch a launch template
    Given I am logged in as user "{{ drupal_user_name }}"
    When I visit "/clouds/design/server_template/{{ cloud_context }}"
    And I click "Refresh"
    And I wait {{ wait }} milliseconds
    And I should see the link "{{ launch_template_name }}"
    And I click "{{ launch_template_name }}"
    And I click "Launch"
    And the url should match "/launch"
    And I select "{{ host_name }}" from "Host"
    And I select "{{ vm_folder }}" from "Folder"
    And I select "{{ vm_datastore }}" from "Datastore"
    And I press "Launch"
    Then the url should match "/clouds/vmware/{{ cloud_context }}/vm"
    And I should see "{{ launch_template_name }}" in the "POWERED_OFF" row
    And I should see the success message "has been launched"
    And I should see neither error nor warning messages

  @api @javascript
  Scenario: Copy the launch template
    Given I am logged in as user "{{ drupal_user_name }}"
    When I visit "/clouds/design/server_template/{{ cloud_context }}"
    And I click "Refresh"
    And I wait {{ wait }} milliseconds
    And I should see the link "{{ launch_template_name }}"
    And I click "{{ launch_template_name }}"
    And the url should match "/clouds/design/server_template/{{ cloud_context }}"
    And I click "Copy"
    And the url should match "/copy"
    And I enter "{{ launch_template_name_copy }}" for "Name"
    And I press "Copy"
    Then the url should match "/clouds/design/server_template/{{ cloud_context }}"
    And I should see the success message "has been created"
    And I should see neither error nor warning messages
    And I visit "/clouds/design/server_template/{{ cloud_context }}"
    And I should see the link "{{ launch_template_name_copy }}" in the table

  @api @javascript
  Scenario: Delete the copied launch template
    Given I am logged in as user "{{ drupal_user_name }}"
    When I visit "/clouds/design/server_template/{{ cloud_context }}"
    And I click "Refresh"
    And I wait {{ wait }} milliseconds
    And I should see the link "{{ launch_template_name_copy }}"
    And I click "{{ launch_template_name_copy }}"
    And the url should match "/clouds/design/server_template/{{ cloud_context }}"
    And I click "Delete"
    And the url should match "/delete"
    And I press "Delete"
    And I wait for AJAX to finish
    Then I should be on "/clouds/design/server_template/{{ cloud_context }}"
    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 "{{ launch_template_name_copy }}"

  @api @javascript
  Scenario: Delete the launch template
    Given I am logged in as user "{{ drupal_user_name }}"
    When I visit "/clouds/design/server_template/{{ cloud_context }}"
    And I click "Refresh"
    And I wait {{ wait }} milliseconds
    And I should see the link "{{ launch_template_name }}"
    And I click "{{ launch_template_name }}"
    And the url should match "/clouds/design/server_template/{{ cloud_context }}"
    And I click "Delete"
    And the url should match "/delete"
    And I press "Delete"
    And I wait for AJAX to finish
    Then I should be on "/clouds/design/server_template/{{ cloud_context }}"
    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 "{{ launch_template_name }}"
+6 −4
Original line number Diff line number Diff line
@@ -31,6 +31,10 @@ host_name:
  your_host_name
host_power_state:
  POWERED_ON
launch_template_name:
  BDD_launch_@Random
launch_template_name_copy:
  BDD_launch_copy_@Random
vcenter_password:
  # You need to change the value here, or define it in a separate file.
  your_vcenter_pwd
@@ -44,14 +48,12 @@ vm_datastore:
  # You need to change the value here, or define it in a separate file.
  your_datestore
vm_disk_size:
  # You need to change the value here, or define it in a separate file.
  your_disk_size
  10
vm_folder:
  # You need to change the value here, or define it in a separate file.
  your_folder
vm_guest_os:
  # You need to change the value here, or define it in a separate file.
  your_guest_os
  Ubuntu Linux (64 bit)
vm_name:
  BDD_vm_@Random
wait: