diff options
author | Manpreet Kaur <kaurmanpreet2620@gmail.com> | 2021-08-04 16:52:00 +0530 |
---|---|---|
committer | Manpreet Kaur <kaurmanpreet2620@gmail.com> | 2021-08-27 09:07:18 +0530 |
commit | 3230e1fb15789238601da44b38b45a486a0dcb81 (patch) | |
tree | 917ac3e5d1fad4c906778874508eb8814985f1ed | |
parent | fbf4036db3e54a8024f0ebc5859531a82c9ebefc (diff) | |
download | horizon-3230e1fb15789238601da44b38b45a486a0dcb81.tar.gz |
Changes for tacker-horizon integration tests
The tacker-horizon integration test framework has been implemented[1]
While adding integration test cases a selenium exception [2] was
observed for test cases under directory [3].
Tacker-horizon UI Details:
* Most of the Horizon plugins, such as manila-ui and vitrage-dashboard
support integration tests, these plugins reside under "Project" tab.
* Whereas, tacker-horizon, mistral-dashboard are horizon plugins which
have their dashboard anchored directly at the top-level alongside
"Project" tab.
* The tacker-horizon has two-panel groups,
* VNF Management
* NFV Orchestration
* The "VNF Management" is a default panel and remains expanded in NFV
dashboard, whereas "NFV Orchestration" is collapsed initially.
Selenium Exception Details:
* The horizon framework reports an exception
ElementNotInteractableException, while opening pages under
"NFV Orchestration" panel group.
* This error occurs when an element is not clicked or it is not visible
yet.
* The menu item expansion code in the horizon integration framework
expands only those menu items (level first, second or third) if only
the previous menu item at the same level was expanded earlier.
* For example, in order to open a page[4] under NVF Orchestration panel
group, the framework collapses "Project" tab and clicks "NFV"
dashboard.
But it never expands "NFV Orchestration" panel as in second-level no
such transition occured hence it remains collapsed. So test case fails
to find desired page.
On the other hand, test cases for pages under "VNF Management" succeed
as the panel group by default remains open.
This patch adds functionality to detect collapsed menu items and expand
the items.
[1] https://review.opendev.org/c/openstack/tacker-horizon/+/790958
[2] https://zuul.opendev.org/t/openstack/build/b8bd1618206945b68ebdbcdc7f1bdf10/console
[3] tacker_horizon/test/integration/pages/nfv/nfv_orchestration/
[4] tacker_horizon/test/integration/pages/nfv/nfv_orchestration/vimmanagementpage.py
Change-Id: I8fec54eb5f2a9bf218ee36e9c0a1ce9c15c97a26
-rw-r--r-- | openstack_dashboard/test/integration_tests/regions/menus.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/openstack_dashboard/test/integration_tests/regions/menus.py b/openstack_dashboard/test/integration_tests/regions/menus.py index 5dc9e83c4..0e62c9782 100644 --- a/openstack_dashboard/test/integration_tests/regions/menus.py +++ b/openstack_dashboard/test/integration_tests/regions/menus.py @@ -149,8 +149,20 @@ class NavigationAccordionRegion(baseregion.BaseRegion): else: is_already_within_required_item = True + # In case menu item is collapsed, then below code detects the same + # and disable is_already_within_required_item flag. + # For instance, in case of tacker-horizon, selenium report an + # exception ElementNotInteractableException while opening pages + # under 'NFV Orchestration' panel group. This error occurs when + # element is not clickable or it is not visible yet. + # The panel group 'NFV Orchestration' is never clicked/open hence + # requested pages are not visible/clickable. + item = self._get_item(text, loc_craft_func, src_elem) + if "collapsed" == item.get_attribute( + 'class') and is_already_within_required_item is True: + is_already_within_required_item = False + if not is_already_within_required_item: - item = self._get_item(text, loc_craft_func, src_elem) item.click() if get_selected_func is not None: self._wait_until_transition_ends( |