From e23fbb846578febca24cf904ee558b611093d2ba Mon Sep 17 00:00:00 2001
From: "asai.noriaki" <63454-asai.noriaki@users.noreply.drupalcode.org>
Date: Sat, 19 Aug 2023 08:15:41 +0000
Subject: [PATCH] Issue #3382020 by asai.noriaki, yas: Add a delay to allow
 screen rendering in SPA using JavaScript (OpenStack Volume, Snapshot)

---
 .../OpenStack-ATDD-03-10-OperateVolumes.feature | 13 ++++++++++++-
 ...penStack-ATDD-03-11-OperateSnapshots.feature | 17 +++++++++++++++--
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/modules/cloud_service_providers/openstack/tests/src/Behat/features/templates/OpenStack-ATDD-03-10-OperateVolumes.feature b/modules/cloud_service_providers/openstack/tests/src/Behat/features/templates/OpenStack-ATDD-03-10-OperateVolumes.feature
index fed46c8c10..65727f18d9 100644
--- a/modules/cloud_service_providers/openstack/tests/src/Behat/features/templates/OpenStack-ATDD-03-10-OperateVolumes.feature
+++ b/modules/cloud_service_providers/openstack/tests/src/Behat/features/templates/OpenStack-ATDD-03-10-OperateVolumes.feature
@@ -5,10 +5,12 @@ Feature: Create and delete a volume for OpenStack as an "authenticated user"
   Scenario: Create a volume
     Given I am logged in as user "{{ drupal_user_name }}"
     When I visit "/{{ root_path }}/openstack/{{ cloud_context }}/volume/add"
+    And I wait {{ wait_render }} milliseconds
     And I should see the heading "{{ prefix_add_form }} volume"
     And I enter "{{ volume_name_operate }}" for "Name"
     And I enter "{{ volume_size }}" for "Size (GiB)"
     And I press "Save"
+    And I wait {{ wait_render }} milliseconds
     Then the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/volume"
     And I should see the success message "has been created"
     And I should see neither error nor warning messages
@@ -19,7 +21,7 @@ Feature: Create and delete a volume for OpenStack as an "authenticated user"
   Scenario: Refresh volume status
     Given I am logged in as a user with the "Administrator" role
     When I visit "/{{ root_path }}/openstack/{{ cloud_context }}/volume"
-    And I wait {{ wait }} milliseconds
+    And I wait {{ wait_render }} milliseconds
     And I click "Refresh"
     And I should see "available" in the "{{ volume_name_operate }}" row
 
@@ -31,6 +33,7 @@ Feature: Create and delete a volume for OpenStack as an "authenticated user"
     And I should see the link "{{ volume_name_operate }}"
     And I wait {{ wait }} milliseconds
     And I click "{{ volume_name_operate }}"
+    And I wait {{ wait_render }} milliseconds
     Then the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/volume/"
     And I should see "{{ volume_name_operate }}" in the "page_header"
     And I should see "{{ volume_size }}" in the "Size"
@@ -46,6 +49,7 @@ Feature: Create and delete a volume for OpenStack as an "authenticated user"
     And I should see the link "{{ volume_name_operate }}" in the table
     And I wait {{ wait }} milliseconds
     And I click "{{ volume_name_operate }}" in the table
+    And I wait {{ wait_render }} milliseconds
     And the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/volume/"
     And I click "Attach" in the actions
     And the url should match "/attach"
@@ -53,6 +57,7 @@ Feature: Create and delete a volume for OpenStack as an "authenticated user"
     # an instance must be created beforehand
     And I select "{{ instance_name }}" from "Instance ID"
     And I press "Attach"
+    And I wait {{ wait_render }} milliseconds
     Then the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/volume"
     And I should see the success message "is attaching to"
     And I should see neither error nor warning messages
@@ -61,6 +66,7 @@ Feature: Create and delete a volume for OpenStack as an "authenticated user"
     And I should see "in-use" in the "{{ volume_name_operate }}" row
     And I wait {{ wait }} milliseconds
     And I click "{{ volume_name_operate }}" in the table
+    And I wait {{ wait_render }} milliseconds
     And I should see "{{ instance_name }}"
     And I should see "{{ drupal_user_name }}" in the "Authored by"
 
@@ -72,10 +78,12 @@ Feature: Create and delete a volume for OpenStack as an "authenticated user"
     And I should see the link "{{ volume_name_operate }}"
     And I wait {{ wait }} milliseconds
     And I click "{{ volume_name_operate }}"
+    And I wait {{ wait_render }} milliseconds
     And the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/volume/"
     And I click "Detach" in the actions
     And the url should match "/detach"
     And I press "Detach"
+    And I wait {{ wait_render }} milliseconds
     Then the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/volume"
     And I should see the success message "is detaching from"
     And I should see neither error nor warning messages
@@ -84,6 +92,7 @@ Feature: Create and delete a volume for OpenStack as an "authenticated user"
     And I should see "available" in the "{{ volume_name_operate }}" row
     And I wait {{ wait }} milliseconds
     And I click "{{ volume_name_operate }}" in the table
+    And I wait {{ wait_render }} milliseconds
     And I should not see "{{ instance_name }}"
     And I should see "{{ drupal_user_name }}" in the "Authored by"
 
@@ -95,10 +104,12 @@ Feature: Create and delete a volume for OpenStack as an "authenticated user"
     And I should see the link "{{ volume_name_operate }}"
     And I wait {{ wait }} milliseconds
     And I click "{{ volume_name_operate }}"
+    And I wait {{ wait_render }} milliseconds
     And the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/volume/"
     And I click "Delete" in the actions
     Then the url should match "/delete"
     And I press "Delete"
+    And I wait {{ wait_render }} milliseconds
     And I should be on "/{{ root_path }}/openstack/{{ cloud_context }}/volume"
     And I should see the success message "has been deleted"
     And I should see neither error nor warning messages
diff --git a/modules/cloud_service_providers/openstack/tests/src/Behat/features/templates/OpenStack-ATDD-03-11-OperateSnapshots.feature b/modules/cloud_service_providers/openstack/tests/src/Behat/features/templates/OpenStack-ATDD-03-11-OperateSnapshots.feature
index e84e40a3f6..355bd42b1c 100644
--- a/modules/cloud_service_providers/openstack/tests/src/Behat/features/templates/OpenStack-ATDD-03-11-OperateSnapshots.feature
+++ b/modules/cloud_service_providers/openstack/tests/src/Behat/features/templates/OpenStack-ATDD-03-11-OperateSnapshots.feature
@@ -6,10 +6,12 @@ Feature: Create, read, update and delete a snapshot for OpenStack as an "authent
     Given I am logged in as user "{{ drupal_user_name }}"
     # Add a volume
     When I visit "/{{ root_path }}/openstack/{{ cloud_context }}/volume/add"
+    And I wait {{ wait_render }} milliseconds
     And I should see the heading "{{ prefix_add_form }} volume"
     And I enter "{{ volume_name_operate }}" for "Name"
     And I enter "{{ volume_size }}" for "Size (GiB)"
     And I press "Save"
+    And I wait {{ wait_render }} milliseconds
     Then the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/volume"
     And I should see the success message "has been created"
     And I should see neither error nor warning messages
@@ -20,7 +22,7 @@ Feature: Create, read, update and delete a snapshot for OpenStack as an "authent
   Scenario: Refresh volume status
     Given I am logged in as a user with the "Administrator" role
     When I visit "/{{ root_path }}/openstack/{{ cloud_context }}/volume"
-    And I wait {{ wait }} milliseconds
+    And I wait {{ wait_render }} milliseconds
     And I click "Refresh"
     And I should see "available" in the "{{ volume_name_operate }}" row
 
@@ -29,6 +31,7 @@ Feature: Create, read, update and delete a snapshot for OpenStack as an "authent
     Given I am logged in as user "{{ drupal_user_name }}"
     # Confirm the volume is available.
     When I visit "/{{ root_path }}/openstack/{{ cloud_context }}/volume"
+    And I wait {{ wait_render }} milliseconds
     And I should see "available" in the "{{ volume_name_operate }}" row
     # Add a snapshot
     And I visit "/{{ root_path }}/openstack/{{ cloud_context }}/snapshot/add"
@@ -37,6 +40,7 @@ Feature: Create, read, update and delete a snapshot for OpenStack as an "authent
     And I enter "{{ description }}" for "Description"
     And I select "{{ volume_name_operate }}" from "Volume ID"
     And I press "Save"
+    And I wait {{ wait_render }} milliseconds
     Then the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/snapshot"
     And I should see the success message "has been created"
     And I should see neither error nor warning messages
@@ -46,16 +50,18 @@ Feature: Create, read, update and delete a snapshot for OpenStack as an "authent
   Scenario: Refresh snapshot status
     Given I am logged in as a user with the "Administrator" role
     When I visit "/{{ root_path }}/openstack/{{ cloud_context }}/snapshot"
-    And I wait {{ wait }} milliseconds
+    And I wait {{ wait_render }} milliseconds
     And I click "Refresh"
 
   @api
   Scenario: Read the snapshot
     Given I am logged in as user "{{ drupal_user_name }}"
     When I visit "/{{ root_path }}/openstack/{{ cloud_context }}/snapshot"
+    And I wait {{ wait_render }} milliseconds
     And I should see the link "{{ snapshot_name_operate }}"
     And I wait {{ wait }} milliseconds
     And I click "{{ snapshot_name_operate }}"
+    And I wait {{ wait_render }} milliseconds
     Then the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/snapshot/"
     And I should see "{{ snapshot_name_operate }}" in the "page_header"
     And I should see "{{ description }}" in the "Description"
@@ -71,18 +77,21 @@ Feature: Create, read, update and delete a snapshot for OpenStack as an "authent
     And I should see the link "{{ snapshot_name_operate }}"
     And I wait {{ wait }} milliseconds
     And I click "{{ snapshot_name_operate }}"
+    And I wait {{ wait_render }} milliseconds
     And the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/snapshot/"
     And I click "Edit" in the actions
     And the url should match "/edit"
     And I enter "{{ snapshot_name_operate_updated }}" for "Name"
     And I enter "{{ description_updated }}" for "Description"
     And I press "Save"
+    And I wait {{ wait_render }} milliseconds
     Then I should see "{{ snapshot_name_operate_updated }}"
     And I should see the success message "has been updated"
     And I should see neither error nor warning messages
     And I should see the link "{{ snapshot_name_operate_updated }}"
     And I wait {{ wait }} milliseconds
     And I click "{{ snapshot_name_operate_updated }}"
+    And I wait {{ wait_render }} milliseconds
     And I should see "{{ snapshot_name_operate_updated }}"
     And I should see "{{ description_updated }}"
     And I should see "{{ drupal_user_name }}" in the "Authored by"
@@ -95,10 +104,12 @@ Feature: Create, read, update and delete a snapshot for OpenStack as an "authent
     And I should see the link "{{ snapshot_name_operate_updated }}"
     And I wait {{ wait }} milliseconds
     And I click "{{ snapshot_name_operate_updated }}"
+    And I wait {{ wait_render }} milliseconds
     And the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/snapshot/"
     And I click "Delete" in the actions
     And the url should match "/delete"
     And I press "Delete"
+    And I wait {{ wait_render }} milliseconds
     Then I should be on "/{{ root_path }}/openstack/{{ cloud_context }}/snapshot"
     And I should see the success message "has been deleted"
     And I should see neither error nor warning messages
@@ -114,10 +125,12 @@ Feature: Create, read, update and delete a snapshot for OpenStack as an "authent
     And I should see the link "{{ volume_name_operate }}"
     And I wait {{ wait }} milliseconds
     And I click "{{ volume_name_operate }}"
+    And I wait {{ wait_render }} milliseconds
     And the url should match "/{{ root_path }}/openstack/{{ cloud_context }}/volume/"
     And I click "Delete" in the actions
     And the url should match "/delete"
     And I press "Delete"
+    And I wait {{ wait_render }} milliseconds
     Then I should be on "/{{ root_path }}/openstack/{{ cloud_context }}/volume"
     And I should see the success message "has been deleted"
     And I should see neither error nor warning messages
-- 
GitLab