toaster.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
To: toaster@lists.yoctoproject.org
Cc: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Subject: [PATCH v3 4/4] toaster/test: delay driver action until elements to appear
Date: Tue,  5 Dec 2023 17:39:50 +0100	[thread overview]
Message-ID: <20231205163950.149647-4-alassane.yattara@savoirfairelinux.com> (raw)
In-Reply-To: <20231205163950.149647-1-alassane.yattara@savoirfairelinux.com>

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 <alassane.yattara@savoirfairelinux.com>
---
 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



      parent reply	other threads:[~2023-12-05 16:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05 16:39 [PATCH v3 1/4] toaster/test: bug-fix on tests/browser/test_all_builds_page Alassane Yattara
2023-12-05 16:39 ` [PATCH v3 2/4] toaster/test: Update pytest.init Alassane Yattara
2023-12-05 16:39 ` [PATCH v3 3/4] toaster/test: from test_no_builds_message.py wait for the empty state div to appear Alassane Yattara
2023-12-05 16:39 ` Alassane Yattara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231205163950.149647-4-alassane.yattara@savoirfairelinux.com \
    --to=alassane.yattara@savoirfairelinux.com \
    --cc=toaster@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).