summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/tests
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: toaster/tests: Fix automated testing failuresRichard Purdie2025-06-212-4/+6
| | | | | | | | | | The display window scrolling mechanism we were using was failing in one case and needed in another. After trying various approaches, this one with window.scrollTo seems to work and fixes the test failures. (Bitbake rev: f1175778108a559e1dd0d55cb68f42816c86f393) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/buildtest: Switch to new CDNRichard Purdie2025-05-291-1/+1
| | | | | | | | | The project is switching the way handle our CDN provision of sstate objects, update the URL accordingly. (Bitbake rev: 3372524cb961d95993b27fe4a8d794cdb7255e09) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests: Update after release numbering changesRichard Purdie2025-05-161-1/+1
| | | | | | (Bitbake rev: f06112286ad141f0d5e4ae75a29f83cdd564c2ec) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests: Fix kirkstone testRichard Purdie2025-03-051-2/+2
| | | | | | | | After the fixture changes, the tests need to be tweaked unfotunately. (Bitbake rev: 708abd1a8060684127acc7ce4142f05865005750) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/browser/layerdetails: Drop unwanted test ↵Richard Purdie2024-10-241-29/+9
| | | | | | | | | | | | skipping/exception handling We really don't want to be skipping a test like this, drop the exception handling code as in my testing we thankfully no longer seem to be seeing it. If we do again we need to fix the underlying issue. (Bitbake rev: b67547f890dc7f347ec05a97cbfb22d3703998cc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functional/utils: Handle WebDriverExceptionRichard Purdie2024-10-241-5/+7
| | | | | | | | | | | | Fix the exception handling in the cancel builds function. This involved adding WebDriverException which sometimes occurs but also correcting the other exception handlers to continue to increment the timeout to avoid test hangs. (Bitbake rev: e111a2bd4f7a8a4dc2c63e94e91ac6cacca95af8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/browser/helper: Add wait for jquery to completeRichard Purdie2024-10-241-0/+2
| | | | | | | | | | Most of the tests that click on buttons need the DOM to stablise, including any running JQuery code before the test can proceed. Add calls to do this whenever we're about to click on an element. (Bitbake rev: 0eb206b355248e2a874a62baec30025652f2a5a8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functional/project_page: Use ↵Richard Purdie2024-10-241-53/+40
| | | | | | | | | | | | | | | | | | | 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>
* bitbake: toaster/tests/functional/util: Avoid test hangsRichard Purdie2024-10-241-1/+1
| | | | | | | | | | If the element never exists, the timeout is never incremented and the test hangs indefinitely. Fix the exception handling to avoid that and allow the timeout to happen. (Bitbake rev: 9eabe923d457bbce65227da4cd71c275c32108e6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/browser: Add various fixes for test failures encounteredRichard Purdie2024-10-244-7/+13
| | | | | | | | | | | | Fixes for the browser tests which: * Add/improve waiting for specific elements * Waiting for elements to be interactable, not just visible * Hiding notification windows * Using more specific asserts to obtain improved error messages (Bitbake rev: 0c3f9bc2b9516d2af391f2e081280eb7fa62a05e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/browser/helper: Add wait_until_element_clickable funcitonRichard Purdie2024-10-241-0/+7
| | | | | | | | Add a variant of the clickable function that accepts an element parameter. (Bitbake rev: a34b2451a0e3baaf3b2fd2eb351847ff6a5ee033) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/browser/helper: Improve wait_until_clickable ↵Richard Purdie2024-10-241-11/+3
| | | | | | | | | | | | | | | exception handling Our own Wait() class allows exception handling which this form of wrapper does not. Switch the code to use our Wait() class to allow retrying upon encountering those exceptions (such as an element not being present yet). The displayed and visible test is what Selenium would be doing internally, there is no JS reprensetation of clickable directly. (Bitbake rev: 8266a01b750b3758badeee8fb3a1acfa72c17a93) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functional/utils: Drop unused code from ↵Richard Purdie2024-10-241-6/+1
| | | | | | | | | | | | | wait_until_build_cancelled The code modifying the build object requires direct database access which is potentially problematic. It was being run on a database which was being reset after changes anyway so the code effectively did nothing. Remove it as it is unneeded. (Bitbake rev: 2e3fa624eb3972aef91d877337479eeb0f3dd365) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/browser/helpers: Drop remains of polling/sleep callsRichard Purdie2024-10-241-10/+7
| | | | | | | | | | | | | | | | Drop the remaining poll parameters from the helpers code along with the remaining sleep call since the tests no longer depend on this. This has the nice benefit of significantly speeding up the toaster test runs (45 minutes down to 12 minutes overall). If a parameter is needed, it should be the timeout, not the polling frequency. (Bitbake rev: 6de912e4f278ffd694fb2258482081dc3bc61c7a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functiona/project_page_tab_config: Improve waits and ↵Richard Purdie2024-10-241-20/+32
| | | | | | | | | | | | | drop polling Drop the poll parameters and make the waits much more specific for the requirements of the tests. This includes looping waiting for a list of layer elements as that code was previously particularly fragile. (Bitbake rev: cf6b8e8aa5484110a41377ba42b3fdd9d6efd877) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functiona/project_page_tab_config: Switch to using ↵Richard Purdie2024-10-241-123/+90
| | | | | | | | | | | | | | | | | 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 is one test that does require database access. Move this 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: fa10ba2a8749415d8f06cfc15c228c6eb7df1bcf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/browser/helpers: Add not visible wait functionRichard Purdie2024-10-241-0/+7
| | | | | | | | | In some cases we want to wait until some element is not visible. Add such a function helper. (Bitbake rev: cede6519d25112037264550126b109903220b58c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functiona/project_page: Improve waits and drop pollingRichard Purdie2024-10-241-13/+40
| | | | | | | | | | | | | | 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>
* bitbake: toaster/tests/functiona/project_page: Drop pointless test covered ↵Richard Purdie2024-10-241-9/+0
| | | | | | | | | | | 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>
* bitbake: toaster/tests/functiona/project_page: Switch to using library ↵Richard Purdie2024-10-241-76/+42
| | | | | | | | | | | | | | | | | 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>
* bitbake: toaster/tests/functional/project_config: Fix the wait calls to ↵Richard Purdie2024-10-241-26/+21
| | | | | | | | | | | avoid polling Drop poll calls within the module, adding wait calls for elements of the page where testing showed it was needed. (Bitbake rev: 26746eae31f126ff87e678da66dcc976e412c89b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functional/basic: Improve the projects table ↵Richard Purdie2024-10-242-7/+14
| | | | | | | | | | | selection to a common function The project page selection code is race prone. Create a common function to resolve the race issue and use it from all the call sites rather than duplicate code. (Bitbake rev: f2bd615b97a6ff3944fa9c1d89a0ea996a12943d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functional/helpers: Drop unneeded poll values and sleepRichard Purdie2024-10-242-3/+2
| | | | | | | | | | Drop the remaining poll values and the sleep within the main wait function as the races this was working around now seem to be resolved with the preceeding patches. (Bitbake rev: 91e54cbacc57316a4f2ca766afac81e7f3a54718) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/browser: Drop unneeded poll parametersRichard Purdie2024-10-247-20/+20
| | | | | | | | | In my testing I wasn't able to see issues needing the poll parameter in the browser tests. Drop those. (Bitbake rev: 3be5e7c78129abf059476416279718156fc666b5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/browser: Increase the default wait timeoutRichard Purdie2024-10-241-1/+1
| | | | | | | | | | | | Rather than hardcoded poll and sleep values, we want an overall long timeout and to drop all the other 'sleeping' code. To facilitate this, increase the overall timeout so we can then start to remove the other values. (Bitbake rev: 69a479383f9a8cae6600ce51b12b62be3a15ea38) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/function/basic: Make element detection more specificRichard Purdie2024-10-241-23/+32
| | | | | | | | | | | | | The tests would race and potentially fail as the elements on the page being waited for were not specific enough. Add suitable elements to wait for and drop the remainder of the poll parameters since these are no longer needed since we no longer need to sleep for things to appear. (Bitbake rev: 9db2fd8534610ad8db90a7a696fa7b748b497d15) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/function/basic: Improve exception handling for error ↵Richard Purdie2024-10-241-49/+59
| | | | | | | | | | | | readability The 'fail' calls are useful for find() failures but not for wrapping existing asserts where they hide more useful error messages. Rework the code flow to give more readable error reporting. (Bitbake rev: 1a7a9af418874d3112aa6f148b30e5a4d3d176f3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/project_config: Reuse common project creation codeRichard Purdie2024-10-241-46/+4
| | | | | | | | | | 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. (Bitbake rev: 653233a1c798d71800b41d3321203a48aa0337d8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functional_basic: Reuse common project creation codeRichard Purdie2024-10-241-21/+1
| | | | | | | | | | 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. (Bitbake rev: f015d96e28d89fd0aef76ff127ebde8613125a66) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functional: Tweak the project creation function for ↵Richard Purdie2024-10-242-9/+17
| | | | | | | | | | | | | | | better reuse Tweak the function name and return the created project ID. Allow the release_name test to be skipped with a value of None. Add an extra wait call to ensure the create project button is ready before clicking it. (Bitbake rev: d20c6e3c67298c5db33b220a2e4a554e6f2c4418) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functional: Move _create_test_new_project to base ↵Richard Purdie2024-10-242-69/+72
| | | | | | | | | | | class as helper The test project creation is needed by mutliple tests. Move it to the base class as a helper function for reuse. (Bitbake rev: abe483b98b38e95b4ad42629a67fb5d243c94094) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functional: Improve project creation testsRichard Purdie2024-10-242-8/+22
| | | | | | | | | | | | | | | | | | | | | Mixing database access and access via a running server is fraught with danger and problems. The "django_db" marker means the transactions are dropped at the end of the test but the transactions made via the webapi remain so the database ends up confused at best. Drop the database accesses and use the server API. This means slightly abusing the typeahead to get lists of projects in the database. Add code to delete a project if it already exists. This allows tests to re-run against an existing database. Deletion is done using the server API but this means handling CSRF tokens. Add requests module requirement to requirements file since the project creation code now uses requests. (Bitbake rev: 738270c53a08ddc95400de70f3dd8c08b2940182) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests: Replace assertTrue for more specific assertsRichard Purdie2024-10-142-91/+91
| | | | | | | | | | | | 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>
* bitbake: tests/browser: Avoid python 3.9 syntaxRichard Purdie2024-10-141-1/+4
| | | | | | | | Python 3.9 isn't our minimum version yet, avoid using removeprefix. (Bitbake rev: 8cb9eb6a4f1be4620fcde347faa5c1fb6d77bf70) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/brwoser: Add wait for element callsRichard Purdie2024-10-141-0/+11
| | | | | | | | | On faster machines these tests are failing as the tests are running before the page has rendered. Add appripriate wait calls. (Bitbake rev: c3a425ac3ccafa7b06b319c6a525773d04a2ddac) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/selenium_helper_base: Handle WebDriverExceptionRichard Purdie2024-10-141-1/+4
| | | | | | | | | | The WebDriverException can occur if elements are not present in the DOM yet. Catch and handle this. It is our most frequently occuring failure in automated testing now. (Bitbake rev: 006173cbd32116ff1cea59b2c99eead807be39bb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functional: Fix test race on alertRichard Purdie2024-10-091-1/+3
| | | | | | | | | THe test fails on faster systems as we need to wait. Fix that and a typo. (Bitbake rev: 749b561196b0b1b388051b345fee2efb6ce68ff7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests/functional: Fix hardcoded database IDRichard Purdie2024-10-091-1/+6
| | | | | | | | | | | 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>
* bitbake: toaster/tests/functional: Fix later details page test issuesRichard Purdie2024-10-091-7/+14
| | | | | | | | | | | | | | | 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>
* bitbake: toaster/tests: Improve a test to give better debug outputRichard Purdie2024-10-091-4/+4
| | | | | | | | | | "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>
* bitbake: toaster/tests: Fix kirkstone numberingRichard Purdie2024-10-091-1/+1
| | | | | | | | | When the fixtures were updated for the styhead release, the test cases were not updated to match. Fix this. (Bitbake rev: d40bd9d35fa3850e77a1e349dab2308a54d70d60) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: test_project_page: fix failing test_single_layer_pageTim Orling2024-06-121-1/+1
| | | | | | | | | | | | | | | | 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>
* bitbake: toaster test_cerate_new_project: add scarthgapTim Orling2024-06-121-11/+11
| | | | | | | | | | | | | | | In line with changes in gen_fixtures.py: * Add projectscarthgap - Add Scarthgap to slot 1. * Move Kirkstone down to slot 4 * Drop projectdunfell - Drop EOL Dunfell from slot 5 (Bitbake rev: a4ae788f95d8e54713528374a9171c636aa747c5) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests: Bug-fix ToasterTable show_rows testcasesAlassane Yattara2024-01-104-6/+9
| | | | | | | | | | | | 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>
* bitbake: toaster/tests: Bug-fix "element not interactable" in ↵Alassane Yattara2024-01-101-1/+8
| | | | | | | | | | | TestLayerDetailsPage::test_edit_layerdetails Failed: https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/143/steps/12/logs/stdio (Bitbake rev: 187e96eb7393632f28a195f280fa133439bdc0fa) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests: bug-fix "#hint-error-project-name" should be visibleAlassane Yattara2024-01-101-1/+3
| | | | | | | | | Failed: https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/142 (Bitbake rev: 0ee5f4e06476b0ec2f5ea8c9f05d299ddda6312b) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests: Setup delay after driver action self.get(url)Alassane Yattara2024-01-104-1/+12
| | | | | | | | | Recurring test failures result from insufficient delays in driver actions. (Bitbake rev: b0de2a61d14fbf30e338751b285b3bab80192275) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests: Delay driver first action on create new project pageAlassane Yattara2024-01-072-1/+3
| | | | | | | | | Wait for element visible on create new project page (Bitbake rev: 664de3f6d3484b94f5d82ec634b512b825553aa9) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests: Bug-fix element click interceptedAlassane Yattara2024-01-071-2/+6
| | | | | | | | | Fix "element click intercepted" on TestProjectConfigTab::test_project_config_tab_right_section (Bitbake rev: c8685c762aa1fab687ff3a0943487675ef720755) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests: Bug-fix on ↵Alassane Yattara2024-01-071-1/+2
| | | | | | | | | | | | | TestProjectConfigTab::test_image_recipe_show_rows Check some rows are visible in table instead of compare table row to row_to_show, because recipe image table sometime doesn't display full avaiblable images (Bitbake rev: 1e2e5927ef7a8adfd3d0a3be1c75b4aa410d9908) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>