diff options
| author | Tim Orling <ticotimo@gmail.com> | 2023-11-11 11:17:55 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-14 23:39:53 +0000 |
| commit | 285a6ba4ee8ee76e4b5a41473d280d2dec990631 (patch) | |
| tree | f4115cb8dcf4768e576f5155bb301ba7fbd9be3a /bitbake | |
| parent | f868384ec6fc6a2d3c2f9eedf7d9ef36061060b0 (diff) | |
| download | poky-285a6ba4ee8ee76e4b5a41473d280d2dec990631.tar.gz | |
bitbake: toaster: fix obsolete use of find_element_by_link_text
The find_element_by_* commands were deprecated in 4.1.4 and have been
removed in 4.3.0:
https://github.com/SeleniumHQ/selenium/blob/selenium-4.3.0/py/CHANGES#L2
as they relied on the use of APIs only intended for internal use.
The recommended method is to use find_elements(By.*) instead.
https://www.selenium.dev/documentation/webdriver/elements/finders/#find-elements-from-element
Also fix some trailing whitespace errors.
(Bitbake rev: 745b555cce58414029b531d19c0dbb6768f036e3)
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
| -rw-r--r-- | bitbake/lib/toaster/tests/browser/test_landing_page.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_landing_page.py b/bitbake/lib/toaster/tests/browser/test_landing_page.py index e010c59c92..7ec52a4b40 100644 --- a/bitbake/lib/toaster/tests/browser/test_landing_page.py +++ b/bitbake/lib/toaster/tests/browser/test_landing_page.py | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | from django.urls import reverse | 10 | from django.urls import reverse |
| 11 | from django.utils import timezone | 11 | from django.utils import timezone |
| 12 | from tests.browser.selenium_helpers import SeleniumTestCase | 12 | from tests.browser.selenium_helpers import SeleniumTestCase |
| 13 | from selenium.webdriver.common.by import By | ||
| 13 | 14 | ||
| 14 | from orm.models import Layer, Layer_Version, Project, Build | 15 | from orm.models import Layer, Layer_Version, Project, Build |
| 15 | 16 | ||
| @@ -52,11 +53,11 @@ class TestLandingPage(SeleniumTestCase): | |||
| 52 | 53 | ||
| 53 | # check that the documentation link is visible | 54 | # check that the documentation link is visible |
| 54 | self.assertTrue(documentation_link.is_displayed()) | 55 | self.assertTrue(documentation_link.is_displayed()) |
| 55 | 56 | ||
| 56 | # check browser open new tab toaster manual when clicking on the documentation link | 57 | # check browser open new tab toaster manual when clicking on the documentation link |
| 57 | self.assertEqual(documentation_link.get_attribute('target') , '_blank') | 58 | self.assertEqual(documentation_link.get_attribute('target') , '_blank') |
| 58 | self.assertEqual( | 59 | self.assertEqual( |
| 59 | documentation_link.get_attribute('href'), | 60 | documentation_link.get_attribute('href'), |
| 60 | 'http://docs.yoctoproject.org/toaster-manual/index.html#toaster-user-manual') | 61 | 'http://docs.yoctoproject.org/toaster-manual/index.html#toaster-user-manual') |
| 61 | self.assertTrue("Documentation" in documentation_link.text) | 62 | self.assertTrue("Documentation" in documentation_link.text) |
| 62 | 63 | ||
| @@ -66,7 +67,7 @@ class TestLandingPage(SeleniumTestCase): | |||
| 66 | jumbotron = self.find('.jumbotron') | 67 | jumbotron = self.find('.jumbotron') |
| 67 | 68 | ||
| 68 | # check OpenEmbedded | 69 | # check OpenEmbedded |
| 69 | openembedded = jumbotron.find_element_by_link_text('OpenEmbedded') | 70 | openembedded = jumbotron.find_element(By.LINK_TEXT, 'OpenEmbedded') |
| 70 | self.assertTrue(openembedded.is_displayed()) | 71 | self.assertTrue(openembedded.is_displayed()) |
| 71 | openembedded.click() | 72 | openembedded.click() |
| 72 | self.assertTrue("openembedded.org" in self.driver.current_url) | 73 | self.assertTrue("openembedded.org" in self.driver.current_url) |
| @@ -77,7 +78,7 @@ class TestLandingPage(SeleniumTestCase): | |||
| 77 | jumbotron = self.find('.jumbotron') | 78 | jumbotron = self.find('.jumbotron') |
| 78 | 79 | ||
| 79 | # check BitBake | 80 | # check BitBake |
| 80 | bitbake = jumbotron.find_element_by_link_text('BitBake') | 81 | bitbake = jumbotron.find_element(By.LINK_TEXT, 'BitBake') |
| 81 | self.assertTrue(bitbake.is_displayed()) | 82 | self.assertTrue(bitbake.is_displayed()) |
| 82 | bitbake.click() | 83 | bitbake.click() |
| 83 | self.assertTrue("docs.yoctoproject.org/bitbake.html" in self.driver.current_url) | 84 | self.assertTrue("docs.yoctoproject.org/bitbake.html" in self.driver.current_url) |
| @@ -88,7 +89,7 @@ class TestLandingPage(SeleniumTestCase): | |||
| 88 | jumbotron = self.find('.jumbotron') | 89 | jumbotron = self.find('.jumbotron') |
| 89 | 90 | ||
| 90 | # check Yocto Project | 91 | # check Yocto Project |
| 91 | yoctoproject = jumbotron.find_element_by_link_text('Yocto Project') | 92 | yoctoproject = jumbotron.find_element(By.LINK_TEXT, 'Yocto Project') |
| 92 | self.assertTrue(yoctoproject.is_displayed()) | 93 | self.assertTrue(yoctoproject.is_displayed()) |
| 93 | yoctoproject.click() | 94 | yoctoproject.click() |
| 94 | self.assertTrue("yoctoproject.org" in self.driver.current_url) | 95 | self.assertTrue("yoctoproject.org" in self.driver.current_url) |
| @@ -101,7 +102,7 @@ class TestLandingPage(SeleniumTestCase): | |||
| 101 | jumbotron = self.find('.jumbotron') | 102 | jumbotron = self.find('.jumbotron') |
| 102 | 103 | ||
| 103 | # check Big magenta button | 104 | # check Big magenta button |
| 104 | big_magenta_button = jumbotron.find_element_by_link_text( | 105 | big_magenta_button = jumbotron.find_element(By.LINK_TEXT, |
| 105 | 'Toaster is ready to capture your command line builds' | 106 | 'Toaster is ready to capture your command line builds' |
| 106 | ) | 107 | ) |
| 107 | self.assertTrue(big_magenta_button.is_displayed()) | 108 | self.assertTrue(big_magenta_button.is_displayed()) |
| @@ -118,7 +119,7 @@ class TestLandingPage(SeleniumTestCase): | |||
| 118 | jumbotron = self.find('.jumbotron') | 119 | jumbotron = self.find('.jumbotron') |
| 119 | 120 | ||
| 120 | # check Big Blue button | 121 | # check Big Blue button |
| 121 | big_blue_button = jumbotron.find_element_by_link_text( | 122 | big_blue_button = jumbotron.find_element(By.LINK_TEXT, |
| 122 | 'Create your first Toaster project to run manage builds' | 123 | 'Create your first Toaster project to run manage builds' |
| 123 | ) | 124 | ) |
| 124 | self.assertTrue(big_blue_button.is_displayed()) | 125 | self.assertTrue(big_blue_button.is_displayed()) |
| @@ -131,7 +132,7 @@ class TestLandingPage(SeleniumTestCase): | |||
| 131 | jumbotron = self.find('.jumbotron') | 132 | jumbotron = self.find('.jumbotron') |
| 132 | 133 | ||
| 133 | # check Read the Toaster manual | 134 | # check Read the Toaster manual |
| 134 | toaster_manual = jumbotron.find_element_by_link_text('Read the Toaster manual') | 135 | toaster_manual = jumbotron.find_element(By.LINK_TEXT, 'Read the Toaster manual') |
| 135 | self.assertTrue(toaster_manual.is_displayed()) | 136 | self.assertTrue(toaster_manual.is_displayed()) |
| 136 | toaster_manual.click() | 137 | toaster_manual.click() |
| 137 | self.assertTrue("https://docs.yoctoproject.org/toaster-manual/index.html#toaster-user-manual" in self.driver.current_url) | 138 | self.assertTrue("https://docs.yoctoproject.org/toaster-manual/index.html#toaster-user-manual" in self.driver.current_url) |
| @@ -142,7 +143,7 @@ class TestLandingPage(SeleniumTestCase): | |||
| 142 | jumbotron = self.find('.jumbotron') | 143 | jumbotron = self.find('.jumbotron') |
| 143 | 144 | ||
| 144 | # check Contribute to Toaster | 145 | # check Contribute to Toaster |
| 145 | contribute_to_toaster = jumbotron.find_element_by_link_text('Contribute to Toaster') | 146 | contribute_to_toaster = jumbotron.find_element(By.LINK_TEXT, 'Contribute to Toaster') |
| 146 | self.assertTrue(contribute_to_toaster.is_displayed()) | 147 | self.assertTrue(contribute_to_toaster.is_displayed()) |
| 147 | contribute_to_toaster.click() | 148 | contribute_to_toaster.click() |
| 148 | self.assertTrue("wiki.yoctoproject.org/wiki/contribute_to_toaster" in str(self.driver.current_url).lower()) | 149 | self.assertTrue("wiki.yoctoproject.org/wiki/contribute_to_toaster" in str(self.driver.current_url).lower()) |
