summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadomir Dopieralski <openstack@dopieralski.pl>2022-05-13 15:35:58 +0200
committerTatiana Ovchinnikova <t.v.ovtchinnikova@gmail.com>2023-02-08 15:58:03 +0000
commit1ea855e310b7ea8bdd5d4ec8342b72c1ccbdc769 (patch)
tree11b7d9a1a305b3d2cd411a66b530d66dc1ebda46
parentcefc8bc0db5c3ed53238bcdca74c65cccd8ade67 (diff)
downloadhorizon-1ea855e310b7ea8bdd5d4ec8342b72c1ccbdc769.tar.gz
Speed up integration tests
We have a place in the form-handling code where we look for the blue form submit button, and if it's not found, we look for the red form submit button. It looks correct at first glance, however it takes 10 seconds to throw NoSuchElementException, because there is a delay that makes sure that the page loads fully before raising that exception. Replacing this with a selector that finds both the blue and the red buttons in one query speeds the whole integration tests suite by half an hour, because there is no more waiting on every delete confirmation dialog. Change-Id: Ie256118c0a84a8868393018b25b0aa049582a17d (cherry picked from commit 2e6eca294718deb7e82f50c071d332377c35085f)
-rw-r--r--openstack_dashboard/test/integration_tests/regions/forms.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/openstack_dashboard/test/integration_tests/regions/forms.py b/openstack_dashboard/test/integration_tests/regions/forms.py
index b738fb941..2476bbf19 100644
--- a/openstack_dashboard/test/integration_tests/regions/forms.py
+++ b/openstack_dashboard/test/integration_tests/regions/forms.py
@@ -298,8 +298,7 @@ class ThemableSelectFormFieldRegion(BaseFormFieldRegion):
class BaseFormRegion(baseregion.BaseRegion):
"""Base class for forms."""
- _submit_locator = (by.By.CSS_SELECTOR, '*.btn.btn-primary')
- _submit_danger_locator = (by.By.CSS_SELECTOR, '*.btn.btn-danger')
+ _submit_locator = (by.By.CSS_SELECTOR, '*.btn.btn-primary,*.btn.btn-danger')
_cancel_locator = (by.By.CSS_SELECTOR, '*.btn.cancel')
_default_form_locator = (by.By.CSS_SELECTOR, 'div.modal-dialog')
@@ -315,10 +314,7 @@ class BaseFormRegion(baseregion.BaseRegion):
@property
def _submit_element(self):
- try:
- submit_element = self._get_element(*self._submit_locator)
- except exceptions.NoSuchElementException:
- submit_element = self._get_element(*self._submit_danger_locator)
+ submit_element = self._get_element(*self._submit_locator)
return submit_element
def submit(self):