Commit Graph

24 Commits

Author SHA1 Message Date
Richard Purdie
1f2b8a27ea bitbake: toaster/tests/functional/project_page: Use wait_until_element_clickable before click calls
Switch the clickable() calls to use the new element_clickable() function
which accepts a finder labmda function. This means if the element doesn't
yet exist, the code can rebuild the query and try again once a small
amount of time has elapsed.

There were a ton of timing related races around these element interactions
and this seemed to be the most robust way to address the issues.

The change also makes some of the elements slightly more specific so
the code can work effectively.

(Bitbake rev: 38643aadbb5a960004b886cf7709beaf2fc96652)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Richard Purdie
210417d0f4 bitbake: toaster/tests/functiona/project_page: Improve waits and drop polling
These changes:

* Drop the poll parameters
* Add waits where needed or make them more specific
* Add calls to close notification boxes since they can obscure
  other page elements
* In one case wait for a "Loading" message to be replaced

(Bitbake rev: 2bde969486a4761fa0e6f9590c9fa08d385666b1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Richard Purdie
fa56ea47b1 bitbake: toaster/tests/functiona/project_page: Drop pointless test covered elsewhere
The project creation test is well covered in another module so just
drop this one as there isn't any extra value added here.

(Bitbake rev: d26414f191c73fb5330d10d97e240150a3fa1ee8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Richard Purdie
566c6dca28 bitbake: toaster/tests/functiona/project_page: Switch to using library create_project function
Switch this test module to use the common project creation code which contains
race fixes. That code requires the database access wrapper be dropped and
we no longer have ordering constraints.

There are two tests that do require database access. Move these to a separate class
and allow database access there. Use ordering constraints to allow them to run
after the main code. They depend on the project creation from the other class which
isn't ideal but good enough for now.

(Bitbake rev: e441bfe98ac41d48692ffbaeec90a9c780337fa4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Richard Purdie
70672522bb bitbake: toaster/tests: Replace assertTrue for more specific asserts
assetTrue is a poor choice for "x in y" since assertIn gives much more
useful output upon failure.

Change such inserts to assertIn or assertEqual to make errors easier
to debug.

(Bitbake rev: dde78e0ff8af872fdc5cdf5354174fc713141102)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-14 21:44:38 +01:00
Richard Purdie
7622becfef bitbake: toaster/tests/functional: Fix hardcoded database ID
Using a hardcoded database ID for a recipe is a bad idea and causes tests
to fail when we change data/versions.

Remove magic numbers.

(Bitbake rev: 6e3a958666ae4821cfa1d43c064a2294e6881638)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-09 18:25:34 +01:00
Richard Purdie
d5c5076889 bitbake: toaster/tests/functional: Fix later details page test issues
Consistently use meta-poky as the test target, instead of a magic number
ID which can vary.

Fix incorrect comments.

Also ensure the viewport is scrolled to the top when changing tabs.
This breaks if other layers are selected like openembedded-core due
to the number of recipes.

(Bitbake rev: 0bcb7b4a8d8e89647aa6179cc61e5eb55d433585)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-09 18:25:34 +01:00
Richard Purdie
48b72c2f51 bitbake: toaster/tests: Improve a test to give better debug output
"False is not True" is not a helpful error messgae. "XXX not in YYY" is
much more helpful. Tweak the test to give more meaninful failure messages
using assertIn rather than assertTrue.

(Bitbake rev: 6292b5a81ce1f3cf35980d0f669a1b52f3c56695)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-09 13:04:30 +01:00
Tim Orling
ddc86a93da bitbake: test_project_page: fix failing test_single_layer_page
The test_single_layer_page test case consistently fails. It is not obvious why
but if we change the argument in the following from 8 to 7 it passes.

  url = reverse("layerdetails", args=(TestProjectPage.project_id, 8))

E       selenium.common.exceptions.TimeoutException: Message: An element matching "#change-notification" should be visible
=========================== short test summary info ============================
FAILED ../bitbake/lib/toaster/tests/functional/test_project_page.py::TestProjectPage::test_single_layer_page

(Bitbake rev: c7e12145d8ea641925e3c06ba4f11c2dae66288a)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-12 21:15:50 +01:00
Alassane Yattara
36dc42bde7 bitbake: toaster/tests: Bug-fix ToasterTable show_rows testcases
Test if some rows are visible in table instead of compare row to row_to_show,
because sometime full avaiblable content did not display

Failed: https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/147/steps/12/logs/stdio

(Bitbake rev: 5b0a48265aafa62259c575707c3afa6dd56f8008)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-10 13:55:33 +00:00
Alassane Yattara
350300f836 bitbake: toaster/tests: Skip to show more then 100 item in ToasterTable
(Bitbake rev: 860c931381e0694a854fd90775fb18dadb7d76c6)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-01 23:13:50 +00:00
Alassane Yattara
81a0110ca5 bitbake: toaster/tests: Bug-Fix testcase functional/test_project_page_tab_config.py
All issues and failures stemmed from a specific test case:
test_project_config_tab_right_section in the file
bitbake/lib/toaster/tests/functional/test_project_page_tab_config.py.

This test was designed to verify whether the "Most built recipes"
section on the project page correctly displays the latest and oldest
recipes built by the user, irrespective of the build outcome (failed,
        cancelled, succeeded, or errored).

The errors and failures arose because the build process did not
terminate as expected, particularly when attempting to build recipe
images such as "core-image-minimal" or "bash." It was discovered that
building a real recipe/image was unnecessary for the test's purpose.
Instead, building a fake recipe like "foo" provided a reliable way to
ensure the build would fail or be interrupted.

(Bitbake rev: 5162db5305826235c09d9fcd38b5fb48ded31622)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15 14:37:28 +00:00
Alassane Yattara
23d3e2c718 bitbake: toaster/tests: Bug fixes, functional tests dependent on each other
refactor test_create_project and test_project_page to remove their dependencies

(Bitbake rev: 54f7c0bb6ff435c4936c3422532aa071bd5b66e8)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08 17:17:42 +00:00
Alassane Yattara
5b18ff6d6b bitbake: toaster/tests: Test single recipe page
Test recipe page
    - Check if title is displayed
    - Check add recipe layer displayed
    - Check left section is displayed
        - Check recipe: name, summary, description, Version, Section,
        License, Approx. packages included, Approx. size, Recipe file

(Bitbake rev: 4f16f6666ef7ccda0e7194f2107fcbbc8f915be4)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-02 18:04:23 +00:00
Alassane Yattara
eb2af42e0a bitbake: toaster/tests: Test single layer page
Test layer page
    - Check if title is displayed
    - Check add/remove layer button works
    - Check tabs(layers, recipes, machines) are displayed
    - Check left section is displayed
        - Check layer name
        - Check layer summary
        - Check layer description

(Bitbake rev: 740b37cc077803f134391c99fc4cae45550020f3)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-02 18:04:23 +00:00
Alassane Yattara
200541ec56 bitbake: toaster/tests: Bug-fix on tests/functional/test_project_page
- Generate a random name for create project while test
- Set timeout on method _wait_until_build
- update test_machines_page, test_softwareRecipe_page and
  test_single_layer_page to  fix exception "element not interactable"

(Bitbake rev: 51c051da61a0396bdaa965065796476de7340727)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-02 18:04:23 +00:00
Alassane Yattara
5cd899da39 bitbake: toaster/tests: Added distro page TestCase
Test distros page
    - Check if title "Compatible distros" is displayed
    - Check search input
    - Check "Add layer" button works
    - Check distro table feature(show/hide column, pagination)

(Bitbake rev: 8b56af0837e9f09f13d6892c1aa1d82ecd5ef87d)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-02 18:04:23 +00:00
Alassane Yattara
00fb8ffca3 bitbake: toaster/tests: Added Layers page TestCase
Test layers page
    - Check if title "Compatible layerss" is displayed
    - Check search input
    - Check "Add layer" button works
    - Check "Remove layer" button works
    - Check layers table feature(show/hide column, pagination)

(Bitbake rev: a7bdda5b31f95e39c70eefb8ddf0ec690b3786ef)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-02 18:04:23 +00:00
Alassane Yattara
9de0b70cc3 bitbake: toaster/tests: Added Machine page TestCase
Test Machine page
    - Check if title "Compatible machines" is displayed
    - Check search input
    - Check "Select machine" button works
    - Check "Add layer" button works
    - Check Machine table feature(show/hide column, pagination)

(Bitbake rev: 98b78d49e2169d57324e4e471d7ad353963c273a)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-02 18:04:23 +00:00
Alassane Yattara
9f78fee273 bitbake: toaster/tests: Test software recipe page
Test software recipe page
    - Check title "Compatible software recipes" is displayed
    - Check search input
    - Check "build recipe" button works
    - Check software recipe table feature(show/hide column, pagination)

(Bitbake rev: b9c8c77d73d19bd4ddf9b6e90b0aa71f92d36993)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-02 18:04:23 +00:00
Alassane Yattara
2ee91ebd9c bitbake: toaster/tests: Override table edit columns TestCase from image recipe page
Better handle TestCase of table  edit column feature

(Bitbake rev: 6adc708a1520f8c947f9c40fdc88ebe2b51ecc97)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-02 18:04:23 +00:00
Alassane Yattara
fd740a6b6d bitbake: toaster/tests: Add UI TestCase - Test project page has right tabs displayed
Test project tabs:
  - "configuration" tab
  - "Builds" tab
  - "Import layers" tab
  - "New custom image" tab
  Check search box used to build recipes

(Bitbake rev: 13a55ebe630ad20e8ab4cdcb3dc6dcbf4fa7243a)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-23 12:06:06 +00:00
Alassane Yattara
f002040d77 bitbake: toaster/tests: Add UI TestCase - Test edit project name on project page
Test edit project name:
  - Click on "Edit" icon button
  - Change project name
  - Click on "Save" button
  - Check project name is changed

(Bitbake rev: 0bd0bbf8df2a1043d5c768a70e4c4fabd5195227)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-23 12:06:06 +00:00
Alassane Yattara
4ff7c528dd bitbake: toaster/tests: Add UI TestCase - Check project header contains right items
Check page header in project page:
  - AT LEFT -> Logo of Yocto project, displayed, clickable
  - "Toaster"+" Information icon", displayed, clickable
  - "Server Icon" + "All builds", displayed, clickable
  - "Directory Icon" + "All projects", displayed, clickable
  - "Book Icon" + "Documentation", displayed, clickable
  - AT RIGHT -> button "New project", displayed, clickable

(Bitbake rev: 5b2b8fe16e2adb45ca88165162c65c0f7f9a0755)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-23 12:06:06 +00:00