Commit Graph

428 Commits

Author SHA1 Message Date
Zuul 7896fd8c77 Merge "Increase the default explicit_wait and page_timeout values" 2023-09-01 20:17:10 +00:00
Radomir Dopieralski e001a590db Increase the default explicit_wait and page_timeout values
It seems that our testing environment is becoming slower and slower
every day, and we are now getting test errors because a page didn't
load in time, or a modal didn't load. Increasing the timeouts should
help with that.

Change-Id: Ib2fc75ae87cdcbfc2da77bead75c71aba387ad3a
2023-08-14 11:36:58 +02:00
Radomir Dopieralski 36536272ff Add pytest-based selenium tests
This is a patch to start work on re-writing the integration tests
using pytest syntax and several improvements, as proposed on the
upstream meeting, and summarized at https://etherpad.opendev.org/p/horizon-pytest

The new tests are to eventually replace the existing integration
tests. At the moment they don't run automatically, you have to explicitly run them using tox or pytest. When the new tests are complete, we will switch to them on the gate.



Change-Id: Iea38e4f9771ff3cae7ae8675863e9c488f3f6d8a
2023-08-08 11:45:20 +00:00
Jan Jasek e6f398715e Increase explicit wait to avoid timeout error during loading spinner
Change-Id: Ib7158d4c3859576016605fa4e688dbb166156078
2023-07-11 15:37:37 +02:00
Radomir Dopieralski 480aba9422 Bump XStatic-JQuery to make it work with jquery-migrate
The jquery-migrate 3 requires newer jquery than we have.
Also added all the other fixes for integration tests to see
if that resolves our problems.

This needs to be merge first so that patch which update the
upper bump of XStatic-JQuery in openstack/requiremensts [1]
can be merged.

Note: This patch also make horizon-integration job to non-voting
so that we can merge this patch and once openstack/requirements
[1] patch is merged, we will make horizon-integartion job voting
again

[1] https://review.opendev.org/c/openstack/requirements/+/887933

Co-Author-By: manchandavishal <manchandavishal143@gmail.com>

Change-Id: I9b8a5e8abe734e7fd99aa0066ede0377e34fbf44
2023-07-10 18:15:18 +05:30
Jan Jasek 2964a50fd4 Stability improvement of Instance tests
Change-Id: Ia3a0d433002a1703c400c33b5901c3bca08d91bd
2023-04-25 12:58:23 +00:00
Ashish Gupta ed947b453f Unskipping test_floatingip_associate_disassociate test case
Change-Id: I31d73269364fc3a4fa26bf8759852f84ca9b25e0
2023-04-04 02:50:33 +05:30
Jan Jasek c88583e33a Change of the procedure how the popup messages are checked
Check and close all the popup messages in one step
and return all the levels of present messages.
There is no longer necessary to use a separate step for checking
presence/absence of Success message, Error message, etc.

Change-Id: I15a0dbe99282f00c5970d9d7d5c9b480989e9e14
2023-03-17 13:09:10 +01:00
Radomir Dopieralski 6d7ecc1441 Attach video even if the exception happens in cleanup
The way we were handling attaching video in integration tests, it would
not attach it if the error happened in a cleanup, not in the main body
of the test. This should fix that.

Change-Id: I356e6849892ed87b2827740e265fcf15fc076cb5
2022-11-14 17:03:32 +01:00
Jan Jasek b14958df8b Fix instance error with attribute cells.
Selenium read data faster than the data are loaded.
Added wait until element is visible.

Change-Id: I2975ea5836a898d113a2baaab6a8f9bf8af8d742
2022-11-03 11:29:12 +01:00
Jan Jasek 01c4ab920d Fix delete image tests.
Add wait until checkbox is in active state.

Fix edit_image_description_and_name test.
Add wait until the name text box is filled by default name (is not empty).
In the other case selenium write new name into text box faster than default
name is written there so default name then rewrite the new name.

Change-Id: I56803e19dd80180cc432ca872a28a7ee7f41290d
2022-10-17 17:13:04 +02:00
Tatiana Ovchinnikova 4743c6c748 Integration test navigation machinery for Angular pages
There's an implementation of navigation modules for pages written
in Angular.
Legacy tests for images page are rewritten to work with the new
navigation.

Change-Id: Ib8a40f0adb0a46c9d646c6796a4242988eefa6e3
2022-09-26 14:19:50 -05:00
Zuul 753a19cdfb Merge "Use SetUp and cleanup for the network pagination tests" 2022-09-16 20:28:31 +00:00
Zuul 857d17467a Merge "Add setup and teardown to the instances pagination tests" 2022-08-17 18:16:28 +00:00
Radomir Dopieralski 421df2451c Add setup and teardown to the instances pagination tests
Also delete any leftover instances before starting the tests

Change-Id: I5a7e4e97e8b9ebd62a9dafb6c82edbff69cf23ba
2022-06-29 10:06:36 +02:00
Radomir Dopieralski 81edf08676 Add setup and teardown to the volumes pagination tests
For now just delete the old volumes at the start

Change-Id: I013da554f58e1638178d3655459c9742fd7f85ba
2022-06-29 09:12:36 +02:00
Radomir Dopieralski 4b2df0a684 Use SetUp and cleanup for the network pagination tests
Also fix the case where the last page is not full.

Change-Id: Ia3cbb9a3683c335c301a9ffd8d3d04f222960fee
2022-06-24 13:48:17 +02:00
Radomir Dopieralski 2e6eca2947 Speed up integration tests
We have a place in the form-handling code where we look for the
blue form submit button, and if it's not found, we look for the
red form submit button. It looks correct at first glance, however
it takes 10 seconds to throw NoSuchElementException, because there
is a delay that makes sure that the page loads fully before raising
that exception. Replacing this with a selector that finds both the
blue and the red buttons in one query speeds the whole integration
tests suite by half an hour, because there is no more waiting on
every delete confirmation dialog.

Change-Id: Ie256118c0a84a8868393018b25b0aa049582a17d
2022-05-31 07:33:19 +00:00
Tatiana Ovchinnikova b31bfe3b91 Add pagination to Flavors table in Launch Instance wizard
The most elegant way to add pagination is to refactor the table using
<hz-dynamic-table> which already contains pagination instead of wiring
it to the existing table framework.
This solution adds the pagination and makes the code more readable.

Partial-Bug: #1859423

Change-Id: I18d6b4f33b274dadc90d73d8fd10efa5b09cb4d2
2022-03-21 12:42:49 -05:00
Rodrigo Barbieri 196de449b6 Implement pagination in admin/proj network tab
Added pagination support to the networks page under
Project and Admin Dashboard.

To accomplish so, the method network_list_for_tenant
in api/neutron.py that is used for listing networks under
the Project Dashboard was refactored to merge the different
requests for shared, non-shared and external networks while
tracking the pagination for each of those requests, so for
instance when all the shared networks are listed and paginated
then the non-shared networks are queried and so on.

For the Admin dashboard all network types are retrieved under
a single request so it is a simpler pagination logic.

Partial-Bug: #1746184
Change-Id: I96a2d6cabed47c89bdc02ec922d7f9451e5ec025
2022-02-16 18:15:48 -03:00
Zuul 6a84dd2b9a Merge "Fix the instances pagination integration tests" 2021-12-03 07:30:59 +00:00
Manpreet Kaur 3230e1fb15 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
2021-08-27 09:07:18 +05:30
Radomir Dopieralski e53c4d8ca0 Fix the instances pagination integration tests
Looks like the popup that comes up after creating instances is no
longer a SUCCESS, but instead it's INFO.

This patch fixes integration tests which were using the incorrect
message class and revisits all other tests skipped with the same
bug number reason.

Change-Id: I0e2976b56513df3cb45ea00e0f9f05603a8743a8
Closes-bug: #1774697
2021-07-28 21:00:05 +00:00
Akihiro Motoki 866a170379 integration tests: Relax router interface status check
Previously the router interface test in the integration tests
checked the status of an added router interface, but the initial
status varies depending on a network backend used in neutron.
In case of neutron L3 agent, a new router interface has "Down" status,
but in case of OVN a new router interface has "Active" status.
This caused the integration test failure after DevStack switched
the default network backend from ML2/OVS to ML2/OVN.

The initial status of a new router interface depends on a network
backend and the neutron API does not define the initial status,
so it is too strict for the horizon integration tests to check
the status. This commit drops the status check.
It is sufficient to check the existence of a new router interface.

Change-Id: Idfd4a9206e85558ba17e476a47b38ee9c1f566fa
Closes-Bug: #1930405
2021-06-04 16:18:56 +09:00
Pedro Kostelec ae7896cea5 Consisent abbreviation of size units
Most units (KB, MB, GB, TB, PB) are shown in an abbreviated format.
The exception were bytes, which where shown as "Bytes". This commit
resolves this inconsistency by showing "B" for byte units.

Change-Id: Ied94c777a70bf8955f5a328ffcb63d98a7a2befd
Closes-Bug: 1411595
Signed-off-by: Iago Estrela <hiagoestrelas@gmail.com>
2021-05-04 11:50:17 -03:00
Zuul 5c11c369e9 Merge "Save instace_id inside Associate Floating IP workflow" 2021-03-23 13:06:08 +00:00
Zuul 9ee7099927 Merge "Don't fail integration tests if browser log couldn't be retrieved" 2021-03-22 10:32:39 +00:00
Radomir Dopieralski 3d82d57353 Save instace_id inside Associate Floating IP workflow
Also, rename instance_id field to proper port_id.

Before this change, when instance_id was passed from the Instances
page in the URL, the information would be lost on form submission,
and if the form contained an error, the it would be redisplayed with
the port drop-down containing all ports from all instances. This also
made submitting this form slow, as the drop-down would be populated
with all ports on form validation.

It also creates a bug, where if there are more instances than Nova's
pagination allows, the ports from newer instances would no longer
appear in the drop-down, and the form would fail to validate, even
though the choice of port on initial form was correct.

Closes-bug: #1920010
Change-Id: I3ab26c19dc9ea1ed23fcff790d0db919039099eb
2021-03-18 12:39:23 +01:00
manchandavishal a42235f6f7 Update cirros image to cirros-0.5.2-x86_64
Due to this change I12e0bdb3699e5343592ab834468ba6b2fcdcaaf4
our integration job is failing. This patch update cirror image
version to fix our CI.

Change-Id: I991fb9750ab9e35b67b06154764487375dd11d73
2021-03-16 17:11:06 +05:30
Zuul c056b95755 Merge "import "collections.abc" explicitly" 2021-03-05 09:30:12 +00:00
manchandavishal 6efaee23d5 import "collections.abc" explicitly
Collections Abstract Base Classes have been moved to the
collections.abc module, which was part of the collections
module before[1] [2]. Usage from the collections module
directly is deprecated and will be removed from 3.10.
This commit updates to import abc module explicitly
wherever required as the same will no longer be visible/directly
used from the collections module.

[1] https://docs.python.org/3/library/collections.abc.html
[2] http://paste.openstack.org/show/802512/

Change-Id: I173f4d647474c21c5d062280bd5703edffb4978e
2021-03-04 18:47:37 +00:00
YuehuiLei 87f498bee5 Drop the usage of unicode prefix from unicode strings
All strings are considered as unicode strings in python 3,
so we no longer need "u" prefix (u'...').

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I796d2fcdca066475bbf29d25cbf2aa67b2b2178b
2021-02-12 13:05:27 -06:00
Radomir Dopieralski b07ed28a9b Don't fail integration tests if browser log couldn't be retrieved
Firefox will throw an "HTTP method not allowed" error randomly when
trying to retrieve the browser log. This change will prevent the
selenium test from failing when that happens, and instead logs
the exact exception that happened as the content of that log.

Change-Id: I3384c3cfdf87f475bf62b2df6b895569723eb187
2021-02-03 21:00:48 +01:00
Zuul 502ac4bfaa Merge "[Cleanup] Remove unused attributes" 2020-12-03 18:19:20 +00:00
Zuul cc127d9a10 Merge "Add integration-test for Volume Group Type" 2020-12-01 20:06:32 +00:00
manchandavishal ee667919c3 [Cleanup] Remove unused attributes
Consistency Groups and Consistency Group Snapshots support
already dropped in the horizon during train release. So this patch
removes these parameters from integration_tests/pages/navigation.py
file.

Change-Id: Ia80271f70a2f7a3228d26d5892ea14971bb4d1f2
2020-12-01 07:27:46 +00:00
manchandavishal 85d75107cf Add integration-test for Volume Group Type
This patch adds integration-tests for volume group-type.

Change-Id: I032bfb10ce6cccfed63b963437392576c9fbb488
Closes-Bug: #1892679
2020-11-26 11:05:31 +00:00
manchandavishal 989eeb41db [cleanup] Remove test-data for heat
This patch removes test-data to run integration test for heat
but heat is no longer a part of the horizon as it has a separate
plugin heat-dashboard. So this patch removes heat test-data.

Change-Id: Id2427c26dd8708b06b941fdd4e3cba0b2dd98808
2020-10-29 07:51:55 +00:00
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
Oleksii Petrenko 97797197af Add allow_delete_snapshot_before_volume config option
Adds allow_delete_snapshot_before_volume config option, that controls
whether to test only situation where first test deletes volume and
then snapshot or also second situation, where first test deletes
snapshot and then volume. Second situation is impossible with Ceph [1].

[1] https://docs.openstack.org/cinder/ussuri/drivers.html#rbddriver

Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Change-Id: Ib422331892f077d78e3f2efbdd88abafc4c52b9a
2020-09-17 16:57:26 +03:00
Ivan Kolodyazhny dc21158e31 Improve integration tests logging
* Add fetch-video-output role based on fetch-tox-output
* Fix test log collection to work with Python3
* Fix page HTML source log

Change-Id: I2e865cc5544d6e77bc3af5e413cbaedceb6df1c1
2020-09-04 12:46:17 +03:00
Oleksii Petrenko 85503a7c51 Fix instance integration tests
Fixes image and flavor selecting when creating instances.
Before this patch, selenium selected wrong column to compare
image names. This is reproduced when table consists of two or
more images, and the first image in table is not the one, that
we are looking for.


Change-Id: Iaedcdaaabb63c5f60d057fbd7927556a6038b89c
2020-07-21 10:41:39 +00:00
manchandavishal e7c17fd9e0 Update cirros image to cirros-0.5.1-x86_64
Due to this change I6ccd646f1c22a99bed0bebf6e363d2190241b667
our integration job is failing. This patch update cirror image
version to fix our CI.

Change-Id: Ie56fada7c58b73d55efb8b140fea4d6cca79ba31
2020-05-28 08:26:10 +00:00
Pallav Gupta 039b208f7f remove hardcoded test_reports dir
The aim of this PS is to remove hardcoded test_reports dir path
so test run can get screenshot dir from the specified configuration.

Change-Id: I454ccdccbed93b831c41199481caf8b5eb302337
2020-05-20 16:41:08 -05:00
Pallav Gupta ad41fe5106 Fix instances integration tests
The aim of this PS is to fix existing skipped instances
integration tests listed below:
- TestAdminInstances.test_create_delete_instance
- TestInstances.test_create_delete_instance

This PS also resolves Partial-Bug: #1774697

Change-Id: I9c2385274a2725409f61137ae201d868d24a56b4
2020-05-20 00:20:54 -05:00
Doug Schveninger c52686a06f Using pytest skip to make all of the skip reason equal
since other test are using pytest.mark.skip
see [1] for a list of test that use that approach
for bug 1774697

This allow skip summary report to group like skip
reason to work.

[1] https://github.com/openstack/horizon/search?q=1774697&unscoped_q=1774697

Change-Id: I6a4cd0e472225baca70bd00a1df89060209b04e5
2020-05-07 22:08:41 -05:00
Akihiro Motoki 0c96dcf293 Handle case without pytest for plugin tests
Switching the test runner to pytest in horizon assumes pytest is always
installed, but horizon test helpers are used in horizon plugin tests and
pytest is not used in horizon plugin tests. As a result, all horizon plugin
tests are now broken.

This commit considers a case where pytest does not exist.
A wrapper decorator for pytest.mark.xxxx is introduced and
it acts as a null decorator if pytest is not installed.

Change-Id: I80736b108f5ae9a36c0e756bf386468879be3293
Closes-Bug: #1873532
2020-04-18 08:44:45 +09:00
Zuul 9cbd32f2b8 Merge "Fix video recording for integration tests" 2020-04-16 11:34:14 +00:00
Ivan Kolodyazhny 8f887350e0 Fix video recording for integration tests
libav-tools package doesn't exist anymore so we need to use ffmpeg now
to capture the screen.

Change-Id: I58384f42ded3ed864de0dc2a9a56d2d9943168b9
2020-04-09 09:20:04 +00:00
Oleksii Petrenko d6fe0170ee Change horizon test runner to pytest
Changes test invocation from `manage.py test` to `pytest`. Adds addtitional
test requirements like pytest, pytest-django, pytest-html. Adds
`pytest.mark` alongside django's test `tag`. Adds posibility to export test
results into xml and html formats.

Depends-On: https://review.opendev.org/#/c/712315/
Related-Bug: #1866666
Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Change-Id: Idb6e63cd23ca2ba8ca56f36eb8b63069bd211944
2020-04-03 13:47:18 +03:00