diff options
Diffstat (limited to 'bitbake/lib/toaster/tests/browser/test_toastertable_ui.py')
-rw-r--r-- | bitbake/lib/toaster/tests/browser/test_toastertable_ui.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_toastertable_ui.py b/bitbake/lib/toaster/tests/browser/test_toastertable_ui.py index e82d5ec654..691aca1ef0 100644 --- a/bitbake/lib/toaster/tests/browser/test_toastertable_ui.py +++ b/bitbake/lib/toaster/tests/browser/test_toastertable_ui.py @@ -8,11 +8,13 @@ # from datetime import datetime +import os from django.urls import reverse from django.utils import timezone from tests.browser.selenium_helpers import SeleniumTestCase from orm.models import BitbakeVersion, Release, Project, Build +from selenium.webdriver.common.by import By class TestToasterTableUI(SeleniumTestCase): """ @@ -33,7 +35,7 @@ class TestToasterTableUI(SeleniumTestCase): table: WebElement for a ToasterTable """ selector = 'thead a.sorted' - heading = table.find_element_by_css_selector(selector) + heading = table.find_element(By.CSS_SELECTOR, selector) return heading.get_attribute('innerHTML').strip() def _get_datetime_from_cell(self, row, selector): @@ -45,7 +47,7 @@ class TestToasterTableUI(SeleniumTestCase): selector: CSS selector to use to find the cell containing the date time string """ - cell = row.find_element_by_css_selector(selector) + cell = row.find_element(By.CSS_SELECTOR, selector) cell_text = cell.get_attribute('innerHTML').strip() return datetime.strptime(cell_text, '%d/%m/%y %H:%M') @@ -58,7 +60,8 @@ class TestToasterTableUI(SeleniumTestCase): later = now + timezone.timedelta(hours=1) even_later = later + timezone.timedelta(hours=1) - bbv = BitbakeVersion.objects.create(name='test bbv', giturl='/tmp/', + builldir = os.environ.get('BUILDDIR', './') + bbv = BitbakeVersion.objects.create(name='test bbv', giturl=f'{builldir}/', branch='master', dirpath='') release = Release.objects.create(name='test release', branch_name='master', @@ -105,7 +108,7 @@ class TestToasterTableUI(SeleniumTestCase): self.click('#checkbox-started_on') # sort by started_on column - links = table.find_elements_by_css_selector('th.started_on a') + links = table.find_elements(By.CSS_SELECTOR, 'th.started_on a') for link in links: if link.get_attribute('innerHTML').strip() == 'Started on': link.click() |