In reviews we usually check import grouping but it is boring.
By using flake8-import-order plugin, we can avoid this.
This flake8 plugin is already used in tempest.
It enforces loose checking so it sounds good to use.
Note that flake8-import-order version is pinned to avoid unexpected
breakage of pep8 job.
Change-Id: I8ccd05eb70350a2441cc2a4d1eafc09ee690b83b
* Use module-specific logger in integration helper.
Previously the root logger (returned by getLogger without parameter)
was used for module-specifc log messages.
It is better to use module-specific logger for such messages
and we can easily identify where log messages come from.
* In case of requiring access to the root logger,
get the root logger explicitly.
* Use 'LOG' for logger name. Almost all modules in horizon use
'LOG' for logger name, but some do not.
It is better to follow the convention.
* Use LOG.warning instead of LOG.warn.
LOG.warning is recommended way in Python3.
Change-Id: Ib9de7ee08a235de9820b95910d8f54724a1f2b91
The uuid format of uuidutils.generate_uuid(dashed=False) equal to
uuidutils.generate_uuid().replace("-", "").
Change-Id: Iea46b7ce146e5e7e48b80c0936d1c66d78d047dc
Updated forms.py with MetadataFormRegion.
Updated tables.py with method to bind anchor row column.
Added test for update image metadata.
Implements blueprint: horizon-integration-tests-coverage
Change-Id: Idd3651955b8f0e1a0c08dd43abd657aafa5a3bc2
Recently introduced manager handled only 'bad' failure scenarios when
Selenium became non responsive and caused again cryptic failures for
failures that were perfectly reported before exceptions_captured
introduction. Now both kind of (responsive and non responsive
Selenium) failures are addressed inside it.
Change-Id: I564b5e8b35fb2e84c27374bcac8a49cb6262b058
Closes-Bug: #1545042
Having the window maximise during a test run makes it difficult
to work with other windows, especially on a single-monitor
computer. This patch removes the maximisation call.
This patch also adds a "local" configuration mechanism to allow
developers to have local configuration of the integration test
environment without it affecting the git repository.
Change-Id: I8a7acbe40deaec5cca904526e3f3c8bc3357744c
Closes-Bug: 1540719
Admin users run tests in an admin project, regular users run them in a
demo project. That should prevent situations when tests don't have an
access to a resources created in a project different from the current
one.
Closes-Bug: #1542211
Change-Id: I497648ce5126e187744b5795bd524b7aba22c7a6
Achieve this by muffling exceptions (raised due to Selenium became not
resposive) while taking integration test failure screenshot.
Also extract the pattern of muffling and capturing exceptions common
for dump_browser_log, dump_html_page and save_screenshot in a common
@exceptions_captured context manager.
Closes-Bug: #1543541
Change-Id: I37fa18a302c553b43529df056d2beacff70f6189
Since Selenium 2.50.1 release it's no longer possible to click
elements which are outside of visible viewport. To keep both tests
working and error screenshots still visible, standard xvfb screensize
is set to 1920x1080 and page scale is set to 67%.
Also temporarily disable create_instance test since it fails on some
nodes due to missing network.
Related-Bug: #1542211
Closes-Bug: #1541876
Change-Id: Ie96606cf52860dd8bb3286971962a16cb3415daf
xvfbwrapper 0.2.8 renamed the xvfb_cmd attribute of xvfbwrapper.Xvfb
to extra_xvfb_args. This change checks if the new attribute name is
available to support new and old xvfbwrapper version.
xvfbwrapper commit changing the API:
9a8c0e80f6
Closes-Bug: #1540495
Change-Id: I45704450ff396787453937362029945b94887189
Horizon currently has two webdrivers for selenium-based
testing; this patch merges them into one so all tests
(selenium functional tests and integration tests) benefit
from improvements we make to the webdriver.
Change-Id: Iac471c2c7e40c799711746ef9e3e4ef87aecf098
This prevents screenshots in plugins integration tests being placed
into places like .tox/py27integration/horizon/openstack_dashboard...
Change-Id: Idf831a2fee4eb9b0c34fdf03c50317e253a082b9
This change increses the timeout for the communications between the
test process and the selenium web driver process.
Change-Id: I79e46713338a59d45c117dc86bf59b9992dbdd94
Fixes-Bug: 1526611
Having all messages from browser console inside a test log sometimes
may be very valuable in understanding the cause of test failure.
Change-Id: I9ef39e412e0b9f1faacf0a3e42418ca138c52d66
Related-Bug: #1505320
Having screenshot of failed test might increase speed of
understanding the failure reason.
partially-implements blueprint: selenium-integration-testing
Depends-On: I0fd89ede7a3d04ce9b4bd4c8fba0789770048d40
Change-Id: Ibc4a6235423736e5938fb348bbe83211917b08d1
Sometimes it is not possible to reproduce failure in integration test
locally. Adding html source code of page where failure happened should
increase our ability to debug properly errors on the gates. For this
purpose the addDetail method from testtools package is used.
Following changes were done:
* TestCase and AdminTestCase classes were modified in order to share
common functionality and remove code repetition.
* Testcases have been modified in order to use newly introduce class
variables(TEST_USER_NAME, TEST_PASSWORD, CONFIG).
* Methods _get_page_html_source and _dump_page_html_source have been created
in the BaseTestCase class. _get_page_html_source uses javascript innerHTML
attribute in order to make javascript modification to the page visible
in the output. (javascript modificaton would not have been visible if
webdriver's property page_source was used)
Partially implements blueprint: selenium-integration-testing
Change-Id: I064405337fb68c966da007f2a5bf91d5c0ec2b3d
Adding function gen_random_resource_name for generation random resources
that should be used in the integration tests. Mentioned method
automatically adds horizon string into the resource name in order to clearly
distinguish resource origin.
Also timestamp is added for better debugging of the tests in more
complex testcases.
uuid4 function is used to minimize resource name collisions.
Closes-Bug: #1399219
Partially implements blueprint: selenium-integration-testing
Change-Id: Id5cb26e50b7b442af69798a2928be514adf7d8fe
Verified by grep, the method wasn't used anywhere, so there is no
purpose to have it there.
Partially implements blueprint: selenium-integration-testing
Closes-Bug: #1414296
Change-Id: I2646ae988d45af81a4dd75e918806465748eeea3
There is outstanding memory leak issue with Xvfb, that should be fixed
by -noreset argument.
-ac disables X access control - which i believe is not necessary for
testing
Partially implements blueprint: selenium-integration-testing
Closes-Bug: #1412469
Change-Id: I5f603266f891728bb8e83331f5a4e57799f07f79
In TestCase and AdminTestCase
* Added condition to check login status inside teardown method.
* Added try and finally, in case logout fails.
In BaseTestCase->teardown:
* replaced driver.close() with driver.quit()
Partially implements blueprint: selenium-integration-testing
Closes-Bug: #1405553
Change-Id: Id1b520ec0a747ace89864bf7cc6b5d9b670fdc60
A lambda function is passed to selenium wait call until() but the docstrings
of that call suggest a better way of passing the lambda function.
Its redundant to return a specific driver instance when until() function
already takes care of that.
Change-Id: Ie0916587bf6a7488b3828d91ad553a3944619dfc
Partially implements blueprint: selenium-integration-testing
Closes-Bug: #1404416
Add class AdminTestCase for login as admin.
Partially implements blueprint: selenium-integration-testing
Change-Id: I514f83088931bfa2a4838ceb13d46b9973fd6778
StaleElementReferenceException occurres when accessing web element that
was reloaded but looks the same. It happens for example when trying to access
form under Project/Data processing/image registry -> register image. It
is ussually caused by javascript that is loading the page or by mistake
in script logic.
This patch wraps the WebDriver and WebElement classes and catches the
occurrence of StaleElementReferenceException and tries to find the web
element again. Till maximum limit is reached or top element is reached
as this suggest that mistake was made by programmer.
Closes-Bug: #1353342
Partially implements blueprint: selenium-integration-testing
Change-Id: I8e24e952e0fb81bed21b7139870d6d7506509c93
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
I added self.driver.maximize_window() to helpers's setUp,
making all integration tests run full screen (maximizing
the browser's window).
Closes-Bug: #1338630
Change-Id: Idd185ef3a29eb4731d35fa957bf1e7d636237dc8
- Add requirement for xfvbwrapper
- Add CLI option for running tests headless
- Update Selenium TestCase to start virtual display if the option is set
- Update documentation about running Selenium tests
Change-Id: Icb1ac3491b8eef6c168bf1421cf073da67600982
Closes-Bug: #1290329
The TestCase class will be the base for all tests, except the login
tests.
It contains two methods:
setUp - opens the login page, and performs the login to allow all test
start from the home page.
tearDown - returns the driver to the home page and logs out.
https://wiki.openstack.org/wiki/Horizon/Testing/UI
Partially implements blueprint: selenium-integration-testing
Change-Id: I748174108844c26eab0d375dafcd1f429f0e83dc
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4
at the top of source code files, except for files in
openstack/common.
Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
Initial setup for running the integration tests. A basic test is
included to ensure this works, although it will be rewritten to follow
the Page Object pattern. Thanks to Daniel Korn for the initial test.
https://wiki.openstack.org/wiki/Horizon/Testing/UI
Implements blueprint: selenium-integration-testing
Change-Id: Id5b62cdeac5295667a3922f7bed1db3c7617f841