I added the switch_window method to pageobject, so that it can be
used by all pages.
The method switches focus between the webdriver windows.
Args:
- window_name: The name of the window to switch to.
- window_index: The index of the window handle to switch to.
If the method is called without arguments it switches to the
last window in the driver window_handles list.
In case only one window exists nothing effectively happens.
Usage:
page.switch_window('_new')
page.switch_window(2)
page.switch_window()
The motivation of writing it was to prevent the inconsistencies
encountered lately, and the common use of a deprecated similar method.
It is not meant for handling pop-ups.
I also modified test_dashboard_help_redirectionת so it now uses
the switch_window method.
Partially implements blueprint: selenium-integration-testing
Closes-Bug: #1354824
Change-Id: Ic90accc37af292994656e1b65ad5c8527b50aaed
I added BaseWebObject, a base class for all web element objects,
i.e. both page objects and regions.
The new class now contains several wrappers for driver's
capabilities, which are required not only by the pages but other
webelements as well, and used to be located within pageobject.
The necessity arose while discussing the regions patch
(https://review.openstack.org/#/c/102227/), that will be
modified accordingly by tnovacik.
In addition, I've made 6 methods private, as they should
not be used outside the pages, definitely not by the tests.
Partially implements blueprint: selenium-integration-testing
Closes-Bug: #1354017
Closes-Bug: #1356774
Change-Id: Id65951160b2016cbdafd8417df48b1b5cd02f99f
Warnings H904, H307 and H405 are new or considerably changed, and will
be fixed in a separate patch.
Closes-bug: #1349820
Partial-bug: #1347472
Change-Id: I4fd28990dacf16f03a4eaa6074ef59c37f1a2c14
Two new pages added: Settings page and ChangePassword page.
To test their functionality I wrote two tests:
1. test_user_settings_change
* changes the system's language
* changes the timezone
* changes the number of items per page (page size)
2. test_password_change:
changes the password, verifies it was indeed changed and
resets to default password.
To allow the above I've made few changes in other places:
* projectpage - added the go_to_settings_page method.
* helpers - added Selenium's implicit wait for self.driver
in order to use page_timeout for pages that don't load
instantly.
https://wiki.openstack.org/wiki/Horizon/Testing/UI
Partially implements blueprint: selenium-integration-testing
Change-Id: I24e01cd13d4a63ffd82505e4fd9cc95ba887e882
Constructor of Support.Select object expects webelement, just one
argument is necessary, therefore the asterisk is redundant.
It seems like this method was refactored and was originaly used with
locator.
Partially implements blueprint: selenium-integration-testing
Change-Id: Id0b1432a8a254283d8d03ec03da7cb4c3e30347b
Three small changes in pageobject.py:
1. Updating the assert message in the page verification method
(is_the_current_page) to go along with the page title partial matching
way we decided on (reminder: the _page_title field only stores the
significant part of the page's title, due to the fact that the site
branding is configurable).
2. select_dropdown and select_dropdown_by_value now receivs the
webelement itself as an attribute, as oppose to an locator, needed to
be located again (by find_element). These methods aren't yet in
use, but definitely will be ,in patches I'm currently working on.
3. fill_field_by_locator was erased since it is not needed.
fill_field_element method receives the web element itself instead
of passing a locator (which is a private field of it's relevant object)
to fill_field_by_locator, finding it and then calling fill_field_element.
This way, fill_field_element is now used directly.
https://wiki.openstack.org/wiki/Horizon/Testing/UI
Partially implements blueprint: selenium-integration-testing
Change-Id: I12ade631069244876f0b4357c21d312255629437
First pages:
* pageobject - the base page for all page objects
* loginpage - the login page object
* basepage - base class for all dashboard page objects
* adminpage
* projectpage
First test:
test_login - a basic scenario test:
* checks that the login page is available
* logs in as a regular user
* checks that the user home page loads without error
https://wiki.openstack.org/wiki/Horizon/Testing/UI
Partially implements blueprint: selenium-integration-testing
Change-Id: Icad82f5f7810c348ddc30cd767f1d3bf5ecb926e