Commit Graph

13 Commits

Author SHA1 Message Date
Akihiro Motoki e5d09edc20 Use python3-style super()
In python3, super() does not always require a class and self reference.
In other words, super() is enough for most cases.
This is much simpler and it is time to switch it to the newer style.

pylint provides a check for this.
Let's enable 'super-with-arguments' check.

NOTE: _prepare_mappings() method of FormRegion in
openstack_dashboard/test/integration_tests/regions/forms.py is refactored.
super() (without explicit class and self referece) does not work when
a subclass method calls a same method in a parent class multiple times.
It looks better to prepare a separate method to provide a common logic.

Change-Id: Id9512a14be9f20dbd5ebd63d446570c7b7c825ff
2020-10-15 14:37:20 +09:00
panneer.smn 15574cad5c Integration test fixes
* fixed 37 tests in total
* restructured and renamed test modules as per horizon
* fixed page navigation & updated method calls
* fixed css selector and xpaths as per horizon
* Removed decorators.skip for working tests
* included decorators.skip for non - working tests
* updated description for tests as per horizon navigation
* removed *update flavor info* and *update flavor access* test, as feature unavailable on horizon
* updated table column name references in page modules
* updated bind table action names as per horizon
* included help page navigation checkpoint
* fixed rc file download drop down selection
* updated page titles in test modules
* included calls as required for spinner disappearance
* updated form fields as per test needs
* updated default ipv4 and subnet for router interfaces
* included string conversion as required for comparisons
* updated cirros image name in horizon.conf

Change-Id: I9fdc810b37443b616bbb82956d1c90a0fa5ebd6b
2018-06-21 10:59:31 +03:00
Vlad Okhrimenko f623281b29 Provide integration test for managing a project's members
A new MembershipMenuRegion was implemented specifically for the task
of dealing with Users being assigned to a Projects. It may be re-used
in other tests as well, which deal with the same membership concept
(e.g., Flavor Access control).

The checker method .is_the_current_page() is changed to act either as
a boolean method, or as an internal assert method.

Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Implements blueprint: horizon-integration-tests-coverage
Change-Id: Ie661a1522951e1e86c461c6ec284fcf4a3e6d6fb
2016-04-20 07:48:27 +00:00
MikhialLaptev 84032cbede Added tests for check RC files from API Access page
test_download_rc_v2_file()
test_download_rc_v3_file()

Tests check that RC files are downloaded successfully and
some attributes of file's contents are correct.

Implements blueprint: horizon-integration-tests-coverage
Change-Id: Icef46863a6fb95600f7c98d5926cfb5b0dfa3d92
2016-04-15 16:10:05 +00:00
Timur Sufiev c573b5b316 Introduce field mappings for FormRegion descendants in i9n tests
This change is similar to the change that introduced decorators for
binding table-level and row-level actions to real table buttons - this
time for forms. Its aim is to provide means to reference a form field
in test using a name different from the one that exists in real
html.

Now it is possible to provide a dictionary for simple FormRegion,
where key is the name to be used in test and the value is used for
binding this name to a real html field widget. Also it is feasible to
provide values other than strings in that dictionary - in this case
they are mean to be a Python class. This Python class will be
initialized as any BaseRegion is usually initialized and then the
value's key will be used for referencing this object. This is useful
when dealing with non-standard widgets in forms (like Membership
widget in Create/Edit Project form or Networks widget in Launch
Instance form).

The old syntax for fields names in tests (the tuple of strings) is
still compatible with new FormRegion-s. It is treated as we had simply
used the same name both for referencing field and for binding it to a
real widget.

Changing TabbedForm region's tabs to be referenced by name instead of
index is out of the scope of this change, but should be done in future.
If not done, we're going to encounter problems with different tabs being
shown or not shown based on RBAC/ enabled settings/ etc.

Implements blueprint: integration-tests-improvements-part1
Change-Id: If3658119176d03dcd0742101ae2922f8e61ba757
2016-01-23 06:47:35 +00:00
Timur Sufiev 726ea9992f Reduce number of calls to Selenium for form fields
Dynamic form fields storage was significantly simplified, removing
most of its 'black magic' part, which included storing properties as
methods and binding new property methods to an existing class instance
at runtime. Now for every form only the fields at current tab (all
fields in case of single-tab form) are being mapped to page regions.

Before the refactoring each form field initialization initiated M
calls to Selenium, where M is the number of possible field widgets/
page region classes. This lead to total number of calls growing as
O(N*M), where N is the number of fields in form. Now the number of
calls grows as O(M+N), thanks to the refactoring of FieldFactory
class.

Implements blueprint: integration-tests-improvements-part1
Change-Id: I3d60041ed8d89b39e3895a90b73d2dec0ff640c5
2016-01-23 06:46:55 +00:00
Timur Sufiev f983cd704e Always wait for spinner to disappear after form submit
Previously every call to .submit() had to be accompanied by
.wait_till_popups_disappear() method. Now tests implicitly wait for
spinner to disappear when invoking .submit() method of a base form
test wrapper.

Implements blueprint: integration-tests-improvements-part1
Change-Id: I986431267eea2321b00a827fe12b511e80b365c6
2016-01-22 12:40:54 +03:00
Timur Sufiev 600986c204 Rework table actions in integration tests
Attach test methods to real table actions (both table-level and
row-level) using @bind_table_action and @bind_row_action
decorators. Using this approach we can also return the next Page
Object from an action method which is most often some form showing
right after the button is pressed.

Thanks to this refactoring integration_tests.regions.tables was HUGELY
simplified and the overall structure of tables is now much clearer.

Implements blueprint: integration-tests-improvements-part1

Change-Id: If7372d4a6acd9450c93ee7cd5dd8eac56060a803
2016-01-22 09:32:13 +00:00
Timur Sufiev 16f925855e In integration tests reference table columns by name
This should protect tests from failing due to columns reordering. To
make name referencing possible, we need to add another 'data-selenium'
attribute to every th.normal-column.

Implements blueprint: integration-tests-improvements-part1

Change-Id: Id788fc288d052c91fc84e94c91ce2a368e8a810a
2016-01-18 21:51:37 +03:00
Timur Sufiev cc1213aa47 Simplify tables page regions
Remove two redundancies: _get_rows() calls in BasicTableRegion
descendants and table_locator property (because it's derivative of
table name which is always specified).

Implements blueprint: integration-tests-improvements-part1

Change-Id: Ic8e4d44beb1ae5f99c096fc796420f2f8306feb0
2016-01-15 16:36:45 +00:00
Timur Sufiev d25d4d2b0d Do not match table actions by ordering in integration tests
Instead of this match them by action <a> tag's id, which is composed:
* from table name, fixed part and action name for table-level actions and
* from row id, fixed part and action name for row-level actions.

Doing so may make action names in page objects less readable as they
have to be the same as real object name (which are rather terse).

Implements blueprint: integration-tests-hardening
Change-Id: I3f92ef4cfd098d080199350cbf5e6061aa050907
2015-10-17 07:43:16 +00:00
Timur Sufiev 56b2fd8914 Wait until the success message popup disappears before proceeding
It seems that integration test runner became faster (forgive me
Jenkins, I was unfair to you, initially thinking that the error was
caused by your slowdown!). In times before October 7, 2015 the
auto-fading success message faded away before next actions were taken
by the test. After this date, tests started to manage (in some cases)
to click the 'Delete Xs' button that was right under the success
message before the message was gone. This effectively dismissed the
message and stole the click from button. The situation was worsened by
the fact that at the time the failure screenshot was made, a message
was already gone, leaving no evidence. Once this case was uncovered,
the solution was easy: to wait until the message disappears (combining
waiting for spinner and the message into a single function), then take
further actions.

Change-Id: I4f5743abbb3cc00852df4647fee0c68b70131833
Partial-Bug: #1505320
2015-10-14 15:04:11 -07:00
Vlad Okhrimenko 3c5be5106b Add integration tests for Identity->Projects page
The projects page is based on tnovacik's regions patches.
Add tests for create, delete project.

Partially implements blueprint: selenium-integration-testing

Change-Id: I89ecc3960ec27259eb2e4666119e6a6f682e1511
2015-07-01 17:36:37 +03:00