mirror of
https://git.yoctoproject.org/poky
synced 2026-04-20 00:32:13 +02:00
bitbake: toaster/tests/browser: Add various fixes for test failures encountered
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>
This commit is contained in:
@@ -200,6 +200,7 @@ class TestAllBuildsPage(SeleniumTestCase):
|
||||
|
||||
# should see a rebuild button for non-command-line builds
|
||||
self.wait_until_visible('#allbuildstable tbody tr')
|
||||
self.wait_until_visible('.rebuild-btn')
|
||||
selector = 'div[data-latest-build-result="%s"] .rebuild-btn' % build1.id
|
||||
run_again_button = self.find_all(selector)
|
||||
self.assertEqual(len(run_again_button), 1,
|
||||
|
||||
@@ -44,6 +44,7 @@ class TestLandingPage(SeleniumTestCase):
|
||||
# and info modal is appearing when clicking on the info sign
|
||||
info_sign.click() # click on the info sign make attribute 'aria-describedby' visible
|
||||
info_model_id = info_sign.get_attribute('aria-describedby')
|
||||
self.wait_until_visible(f'#{info_model_id}')
|
||||
info_modal = self.find(f'#{info_model_id}')
|
||||
self.assertTrue(info_modal.is_displayed())
|
||||
self.assertTrue("Toaster version information" in info_modal.text)
|
||||
|
||||
@@ -100,7 +100,7 @@ class TestLayerDetailsPage(SeleniumTestCase):
|
||||
(self.initial_values, value))
|
||||
|
||||
# Make sure the input visible beofre sending keys
|
||||
self.wait_until_visible("#layer-git input[type=text]")
|
||||
self.wait_until_clickable("#layer-git input[type=text]")
|
||||
inputs.send_keys("-edited")
|
||||
|
||||
# Save the new values
|
||||
@@ -211,6 +211,7 @@ class TestLayerDetailsPage(SeleniumTestCase):
|
||||
self.get(self.url)
|
||||
|
||||
# Add the layer
|
||||
self.wait_until_clickable("#add-remove-layer-btn")
|
||||
self.click("#add-remove-layer-btn")
|
||||
|
||||
notification = self.wait_until_visible("#change-notification-msg")
|
||||
@@ -218,12 +219,17 @@ class TestLayerDetailsPage(SeleniumTestCase):
|
||||
expected_text = "You have added 1 layer to your project: %s" % \
|
||||
self.imported_layer_version.layer.name
|
||||
|
||||
self.assertTrue(expected_text in notification.text,
|
||||
self.assertIn(expected_text, notification.text,
|
||||
"Expected notification text %s not found was "
|
||||
" \"%s\" instead" %
|
||||
(expected_text, notification.text))
|
||||
|
||||
hide_button = self.find('#hide-alert')
|
||||
hide_button.click()
|
||||
self.wait_until_not_visible('#change-notification')
|
||||
|
||||
# Remove the layer
|
||||
self.wait_until_clickable("#add-remove-layer-btn")
|
||||
self.click("#add-remove-layer-btn")
|
||||
|
||||
notification = self.wait_until_visible("#change-notification-msg")
|
||||
@@ -231,7 +237,7 @@ class TestLayerDetailsPage(SeleniumTestCase):
|
||||
expected_text = "You have removed 1 layer from your project: %s" % \
|
||||
self.imported_layer_version.layer.name
|
||||
|
||||
self.assertTrue(expected_text in notification.text,
|
||||
self.assertIn(expected_text, notification.text,
|
||||
"Expected notification text %s not found was "
|
||||
" \"%s\" instead" %
|
||||
(expected_text, notification.text))
|
||||
|
||||
@@ -89,12 +89,10 @@ class TestNewProjectPage(SeleniumTestCase):
|
||||
radio = self.driver.find_element(By.ID, 'type-new')
|
||||
radio.click()
|
||||
|
||||
self.click("#create-project-button")
|
||||
|
||||
self.wait_until_present('#hint-error-project-name')
|
||||
self.wait_until_visible('#hint-error-project-name')
|
||||
element = self.find('#hint-error-project-name')
|
||||
|
||||
self.assertTrue(("Project names must be unique" in element.text),
|
||||
self.assertIn("Project names must be unique", element.text,
|
||||
"Did not find unique project name error message")
|
||||
|
||||
# Try and click it anyway, if it submits we'll have a new project in
|
||||
|
||||
Reference in New Issue
Block a user