summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
Commit message (Collapse)AuthorAgeFilesLines
* 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/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/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/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/functional/helpers: Drop unneeded poll values and sleepRichard Purdie2024-10-241-1/+0
| | | | | | | | | | 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: 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: 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/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: Setup delay after driver action self.get(url)Alassane Yattara2024-01-101-0/+7
| | | | | | | | | 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: bug-fix An element matching "#projectstable" should ↵Alassane Yattara2024-01-011-0/+2
| | | | | | | | | be visible (Bitbake rev: 1edb97f741a48481b1b9f26c5cb31acd9059f07f) 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 intercepted in ↵Alassane Yattara2023-12-151-0/+14
| | | | | | | | | | | browser/test_layerdetails_page.py selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted (Bitbake rev: d1936616cafc1aced69c7b5758e44638eb62b5ac) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests: fix chrome argument syntax and wait for driver exitAlexander Lussier-Cullen2023-12-151-1/+3
| | | | | | | | | | | | | The chrome driver sometimes fails with a page crash for a full suite of tests, pointing to a failure in the setup of the driver due to resource limitations. To mitigate these crashes, add a wait between driver driven tests to ensure resources are freed. (Bitbake rev: 8f998e27aae694c16f788aac12558621089d0839) Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests: Exit tests on chromedriver creation failureAlexander Lussier-Cullen2023-12-151-6/+8
| | | | | | | | | | | When failing to create the web driver session for selenium tests, a cascade of erroring tests will follow. To avoid processing these unnecessarily, exit the tests completely in this case. (Bitbake rev: 9327196102dd2671fcdb3200d9490e683f81d3a1) Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Add verbose printout for missing chrome(driver) dependenciesAlexander Lussier-Cullen2023-12-121-2/+21
| | | | | | | | | | | If the chrome driver binary is missing dependencies, it was near impossible to work out which ones from just the logs. Add code to help debug things if this happens by including the ldd output. (Bitbake rev: 0ffe5fccbb7db5aca5c409fe00be2be69a6e37d9) Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/tests: Update methods wait_until_~ to skip using time.sleepAlassane Yattara2023-12-021-5/+8
| | | | | | | | | | | Update Class Wait from selenium_helpers_base, to override wait_until_visible and wait_until_present with poll argument to better handle delay between driver actions (Bitbake rev: 486817ac6ad28580d81dcf6e3789678d9259bb54) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Revert "toaster: Bug-fix webdriver No parameter named options"Richard Purdie2023-11-091-1/+1
| | | | | | | | | This reverts commit 99305c25fafa61064a1bb0849616e4627e3453d7. After discussion we found various versions of selenium don't work with this change. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Bug-fix webdriver No parameter named optionsAlassane Yattara2023-11-091-1/+1
| | | | | | | | | Change options to chrome_options (Bitbake rev: 99305c25fafa61064a1bb0849616e4627e3453d7) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: add tox.ini file to execute test suiteMarlon Rodriguez Garcia2023-10-301-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Updated tox file to fix enviroments variables. to run tox use the following command: tox -e env_name -c /path/to/file/tox.ini See tox cli https://tox.wiki/en/latest/cli_interface.html The variable env_name is linked to the python versions (py38, py39, py310). If env_name option is not set, the test suite will run for all indicated versions. It was also modified the webdriver options for chrome to run selenium test in console because of the error detected in the previous test run selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally. (session not created: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (Bitbake rev: 11dfd7c05642269b7a8bff2918667348d041ec79) Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com> Changes in v2 - Updated variable path BUILDDIR and EVENTREPLAY_DIR to use enviroment value - Updated toaster-requirements.txt file path - Removed flake8 - Added webdriver options to chrome Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: update selenium version and code syntaxMarlon Rodriguez Garcia2023-10-061-5/+4
| | | | | | | | | Updated selenium version to latest 4.13.0, changed selenum specific version syntax elements to accomplish test success (Bitbake rev: 868c88a249ef4b9fe5a891e76e25e054e4fcd994) Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib: remove unused importsFrazer Clews2020-01-191-1/+0
| | | | | | | | | | removed unused imports which made the code harder to read, and slightly but less efficient (Bitbake rev: 4367692a932ac135c5aa4f9f2a4e4f0150f76697) Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: toaster:tests: python -> python3Robert Yang2019-06-281-1/+1
| | | | | | (Bitbake rev: 683c24788d96176699a585055eb62d8a71830a12) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Strip old editor directives from file headersRichard Purdie2019-05-041-2/+0
| | | | | | | | | | There are much better ways to handle this and most editors shouldn't need this in modern times, drop the noise from the files. Its not consitently applied anyway. (Bitbake rev: 5e43070e3087d09aea2f459b033d035c5ef747d0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Drop duplicate license boilerplace textRichard Purdie2019-05-041-13/+0
| | | | | | | | | | With the introduction of SPDX-License-Identifier headers, we don't need a ton of header boilerplate in every file. Simplify the files and rely on the top level for the full licence text. (Bitbake rev: 695d84397b68cc003186e22f395caa378b06bc75) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Add initial pass of SPDX license headers to source codeRichard Purdie2019-05-041-0/+2
| | | | | | | | | | | | | | | | | This adds the SPDX-License-Identifier license headers to the majority of our source files to make it clearer exactly which license files are under. The bulk of the files are under GPL v2.0 with one found to be under V2.0 or later, some under MIT and some have dual license. There are some files which are potentially harder to classify where we've imported upstream code and those can be handled specifically in later commits. The COPYING file is replaced with LICENSE.X files which contain the full license texts. (Bitbake rev: ff237c33337f4da2ca06c3a2c49699bc26608a6b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: browser tests - add Selenium Docker container as driverbrian avery2016-12-071-2/+11
| | | | | | | | | | | | Adds the ability to specify a Selenium Docker container server as a driver. This allows for repeatable tests independent of host. Currently we assume you are using the Firefox container. Instructions are located in the README in tests/browser. (Bitbake rev: 7df842f8f8b2ae640109ed06729ab59c9469fc64) Signed-off-by: brian avery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/toaster: Fix missing new files from previous commitsRichard Purdie2016-08-011-0/+218
(Bitbake rev: f77e6f21a2cc57a3fcb5970437e55cfae39849a3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>