diff mbox series

[5/5] toaster/tests/layerdetails: Update tests to use labels and scrolling function

Message ID 20260901225555.2254932-5-richard.purdie@linuxfoundation.org
State New
Headers show
Series [1/5] toaster: Rename wait_until_element_clickable -> wait_under_finder_clickable | expand

Commit Message

Richard Purdie Sept. 1, 2026, 10:55 p.m. UTC
wait_until_element_clickable attempts to scroll the viewport if needed
which improves the test robustness from timing issues.

Also switch to dedicated element labels added in a previous patch to
remove ambiguity from the test over the different textareas so we don't
randonly iterate them (which caused some test issues).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../tests/browser/test_layerdetails_page.py       | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/lib/toaster/tests/browser/test_layerdetails_page.py b/lib/toaster/tests/browser/test_layerdetails_page.py
index 0b45ca6e0f1..476a8fa522c 100644
--- a/lib/toaster/tests/browser/test_layerdetails_page.py
+++ b/lib/toaster/tests/browser/test_layerdetails_page.py
@@ -78,17 +78,20 @@  class TestLayerDetailsPage(SeleniumTestCase):
         self.wait_until_visible("#layer-git-repo-url")
 
         # Open every edit box
-        for btn in self.find_all("dd .glyphicon-edit"):
-            btn.click()
+        self.wait_until_element_clickable(self.find("#edit-layer-description"))
+        self.click("#edit-layer-description")
+        self.wait_until_element_clickable(self.find("#edit-layer-summary"))
+        self.click("#edit-layer-summary")
 
         # Wait for the inputs to become visible after animation
-        self.wait_until_visible("#layer-git input[type=text]")
-        self.wait_until_visible("dd textarea")
+        self.wait_until_visible("#layer-git-repo-url")
         self.wait_until_visible("dd .change-btn")
+        self.wait_until_element_clickable(self.find("#layer-description"))
+        self.wait_until_element_clickable(self.find("#layer-summary"))
 
         # Edit each value
         for inputs in self.find_all("#layer-git input[type=text]") + \
-                self.find_all("dd textarea"):
+                [self.find("#layer-summary"), self.find("#layer-description")]:
             # ignore the tt inputs (twitter typeahead input)
             if "tt-" in inputs.get_attribute("class"):
                 continue
@@ -100,7 +103,7 @@  class TestLayerDetailsPage(SeleniumTestCase):
                             (self.initial_values, value))
 
             # Make sure the input visible beofre sending keys
-            self.wait_until_element_visible(inputs)
+            self.wait_until_element_clickable(inputs)
             inputs.send_keys("-edited")
 
         # Save the new values