Update  tests/browser/(test_landing_page.py and test_layerdetails_page.py)
to delay driver actions until for elements to appear

Signed-off-by: Alassane Yattara <[email protected]>
---
 lib/toaster/tests/browser/test_landing_page.py      | 1 +
 lib/toaster/tests/browser/test_layerdetails_page.py | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/toaster/tests/browser/test_landing_page.py 
b/lib/toaster/tests/browser/test_landing_page.py
index 7ec52a4b..ca0b2e63 100644
--- a/lib/toaster/tests/browser/test_landing_page.py
+++ b/lib/toaster/tests/browser/test_landing_page.py
@@ -206,6 +206,7 @@ class TestLandingPage(SeleniumTestCase):
 
         self.get(reverse('landing'))
 
+        self.wait_until_visible("#latest-builds")
         elements = self.find_all('#allbuildstable')
         self.assertEqual(len(elements), 1, 'should redirect to builds')
         content = self.get_page_source()
diff --git a/lib/toaster/tests/browser/test_layerdetails_page.py 
b/lib/toaster/tests/browser/test_layerdetails_page.py
index cb7b915b..27cda0f2 100644
--- a/lib/toaster/tests/browser/test_layerdetails_page.py
+++ b/lib/toaster/tests/browser/test_layerdetails_page.py
@@ -68,6 +68,7 @@ class TestLayerDetailsPage(SeleniumTestCase):
         check that the new values exist"""
 
         self.get(self.url)
+        self.wait_until_visible("#add-remove-layer-btn")
 
         self.click("#add-remove-layer-btn")
         self.click("#edit-layer-source")
@@ -105,7 +106,9 @@ class TestLayerDetailsPage(SeleniumTestCase):
         for save_btn in self.find_all(".change-btn"):
             save_btn.click()
 
-        self.click("#save-changes-for-switch")
+        self.wait_until_visible("#save-changes-for-switch")
+        btn_save_chg_for_switch = self.find("#save-changes-for-switch")
+        btn_save_chg_for_switch.click()
         self.wait_until_visible("#edit-layer-source")
 
         # Refresh the page to see if the new values are returned
@@ -134,7 +137,9 @@ class TestLayerDetailsPage(SeleniumTestCase):
         new_dir = "/home/test/my-meta-dir"
         dir_input.send_keys(new_dir)
 
-        self.click("#save-changes-for-switch")
+        self.wait_until_visible("#save-changes-for-switch")
+        btn_save_chg_for_switch = self.find("#save-changes-for-switch")
+        btn_save_chg_for_switch.click()
         self.wait_until_visible("#edit-layer-source")
 
         # Refresh the page to see if the new values are returned
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6055): https://lists.yoctoproject.org/g/toaster/message/6055
Mute This Topic: https://lists.yoctoproject.org/mt/102995307/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/toaster/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to