From patchwork Tue Dec 5 16:39:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35718 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D69B4C07E97 for ; Tue, 5 Dec 2023 16:40:11 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.104651.1701794403735306284 for ; Tue, 05 Dec 2023 08:40:03 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=ZkZc7iOU; spf=pass (domain: savoirfairelinux.com, ip: 208.88.110.44, mailfrom: alassane.yattara@savoirfairelinux.com) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 1CD9A9C3644 for ; Tue, 5 Dec 2023 11:40:03 -0500 (EST) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id xZFIVRPxlzpP; Tue, 5 Dec 2023 11:40:02 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id BE2BD9C3678; Tue, 5 Dec 2023 11:40:02 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com BE2BD9C3678 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701794402; bh=DgDxLlogWFIcSWBXECT+LkkNme4uZm9L25rdKe/mRpU=; h=From:To:Date:Message-Id:MIME-Version; b=ZkZc7iOUPrIH5dgoAz2ttSxVX6mVhYdK7OCollsRmeuY3K+D4P7Zm4ltOGiGKMiYM xiMzvJBi73wMFTTHWYU3qheQO2MaOK5YuUjHwADABuZF3gVQKQOE/wwTIMnzPC8zfl OwijS0R8PkypmROqzoIQIGjzk4EfAO6t2M1TtR3qFzzpqkJNWENpPnOSbGSMroHGtP O1zXrEdoL2gdXEvUE0Y/V6s3Rpbtf0S7k3r+7Pap3QXluCR91v287zwvSJaelOlKvI jc5VlNtNrDJtYrhQxNzcKBkL+bQlKlOKLNvrA8JBZNwdTm8XEBk3xRjvp5p67KG68r blKfyyDCsMoKw== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id Mun5LvvX0lpV; Tue, 5 Dec 2023 11:40:02 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 096B39C3644; Tue, 5 Dec 2023 11:40:00 -0500 (EST) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH v3 4/4] toaster/test: delay driver action until elements to appear Date: Tue, 5 Dec 2023 17:39:50 +0100 Message-Id: <20231205163950.149647-4-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231205163950.149647-1-alassane.yattara@savoirfairelinux.com> References: <20231205163950.149647-1-alassane.yattara@savoirfairelinux.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 05 Dec 2023 16:40:11 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/6055 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 --- 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