diff options
| author | Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com> | 2023-10-03 13:26:23 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-06 11:42:46 +0100 |
| commit | 3ac4694fc3b85cf23909d7e2fcc4ae97004ae927 (patch) | |
| tree | 02f3976723a9f4060127f2f679ff0349bd9e2eef /bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | |
| parent | 08421d8985d968b46cfc03baf610c6d7a71f2eed (diff) | |
| download | poky-3ac4694fc3b85cf23909d7e2fcc4ae97004ae927.tar.gz | |
bitbake: toaster: update selenium version and code syntax
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>
Diffstat (limited to 'bitbake/lib/toaster/tests/browser/selenium_helpers_base.py')
| -rw-r--r-- | bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py index 644d45fe58..9a4e27a3bc 100644 --- a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py +++ b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | |||
| @@ -21,6 +21,7 @@ import unittest | |||
| 21 | 21 | ||
| 22 | from selenium import webdriver | 22 | from selenium import webdriver |
| 23 | from selenium.webdriver.support.ui import WebDriverWait | 23 | from selenium.webdriver.support.ui import WebDriverWait |
| 24 | from selenium.webdriver.common.by import By | ||
| 24 | from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | 25 | from selenium.webdriver.common.desired_capabilities import DesiredCapabilities |
| 25 | from selenium.common.exceptions import NoSuchElementException, \ | 26 | from selenium.common.exceptions import NoSuchElementException, \ |
| 26 | StaleElementReferenceException, TimeoutException | 27 | StaleElementReferenceException, TimeoutException |
| @@ -32,9 +33,7 @@ def create_selenium_driver(cls,browser='chrome'): | |||
| 32 | browser = env_browser | 33 | browser = env_browser |
| 33 | 34 | ||
| 34 | if browser == 'chrome': | 35 | if browser == 'chrome': |
| 35 | return webdriver.Chrome( | 36 | return webdriver.Chrome() |
| 36 | service_args=["--verbose", "--log-path=selenium.log"] | ||
| 37 | ) | ||
| 38 | elif browser == 'firefox': | 37 | elif browser == 'firefox': |
| 39 | return webdriver.Firefox() | 38 | return webdriver.Firefox() |
| 40 | elif browser == 'marionette': | 39 | elif browser == 'marionette': |
| @@ -153,11 +152,11 @@ class SeleniumTestCaseBase(unittest.TestCase): | |||
| 153 | 152 | ||
| 154 | def find(self, selector): | 153 | def find(self, selector): |
| 155 | """ Find single element by CSS selector """ | 154 | """ Find single element by CSS selector """ |
| 156 | return self.driver.find_element_by_css_selector(selector) | 155 | return self.driver.find_element(By.CSS_SELECTOR, selector) |
| 157 | 156 | ||
| 158 | def find_all(self, selector): | 157 | def find_all(self, selector): |
| 159 | """ Find all elements matching CSS selector """ | 158 | """ Find all elements matching CSS selector """ |
| 160 | return self.driver.find_elements_by_css_selector(selector) | 159 | return self.driver.find_elements(By.CSS_SELECTOR, selector) |
| 161 | 160 | ||
| 162 | def element_exists(self, selector): | 161 | def element_exists(self, selector): |
| 163 | """ | 162 | """ |
