9 Commits

Author SHA1 Message Date
Tomas Novacik
e5ab83caf3 Add _wait_till_text_present_in_element method
* add selenium configuration group
* add implicit/explicit wait and set page timeout

Partially implements blueprint: selenium-integration-testing

Change-Id: If39a5dcbac45635ad9988edfdc1830aeabc663a4
2014-12-07 15:48:31 +01:00
dkorn
bc5dbdc73c Integration tests - switch_window method
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
2014-11-27 11:41:40 +00:00
dkorn
f573ef714b Integration tests - BaseWebObject class
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
2014-11-02 12:03:18 +02:00
Radomir Dopieralski
0eca7449cc Fix Flake8 style warnings in openstack_dashboard/
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
2014-07-30 14:13:24 +02:00
Jenkins
792668d723 Merge "Settings page ChangePassword page and their tests" 2014-07-23 04:29:10 +00:00
Daniel Korn
2a27c7f4e6 Settings page ChangePassword page and their tests
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
2014-07-20 11:47:48 +03:00
Tomas Novacik
f04b82421a Fix typo in select methods definition
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
2014-07-16 11:36:19 +02:00
Daniel Korn
cae478993b Changes in assert message and select dropdown
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
2014-04-24 21:06:03 +03:00
Daniel Korn
5001bca975 Integration tests - page objects pattern
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
2014-03-25 13:42:57 +02:00