From patchwork Tue Dec 5 16:40:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35719 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 CF7ABC10DC3 for ; Tue, 5 Dec 2023 16:40:31 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.105779.1701794427703256706 for ; Tue, 05 Dec 2023 08:40:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=KQg12khF; 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 10B0F9C3787 for ; Tue, 5 Dec 2023 11:40:27 -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 itIFFxtY4onz; Tue, 5 Dec 2023 11:40:26 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 5E92C9C3644; Tue, 5 Dec 2023 11:40:26 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 5E92C9C3644 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701794426; bh=0lQ6kY0G6N/T8Vim0gW9gdxDL1wjSYWzA2pb/gZkycc=; h=From:To:Date:Message-Id:MIME-Version; b=KQg12khFldZKCKqVy1mrBsWRT+3j+LhSJfdEIPxwzE02jfva/XRaHeish4IZHVcoS 4ZcC/sbCvYZ/1v5OZ6TRpeQR3/EzVNZ5ZMOTkvorkCb0H6y7UBMtI8kzpBXCR3N2Fo fsk/ONLWbbAVC/lzIA/wzJXedxMobHW+oC+u05t9dU1zM9AHGC8e/eYJUA9GKfp2oo PGYDOuu8W5L+9af9dSBU0ezhVCiLxA/2JtiCTdohHbzXtfTosagxqwslkVToS2g0Al g+RXDbHA+oFfDsEEZvXsQR2HX2zGkCZoNnFVvu1jts76W7KqEMBm7gnfmhExpdto1O XMhrY980kbcwQ== 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 FfdaUKswxbC9; Tue, 5 Dec 2023 11:40:26 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id C8B879C339D; Tue, 5 Dec 2023 11:40:25 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH v3 1/4] toaster/test: bug-fix on tests/browser/test_all_builds_page Date: Tue, 5 Dec 2023 17:40:19 +0100 Message-Id: <20231205164022.151951-1-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 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:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15613 - Bug-fix on table filtering on (CompletedOn, filter failed task) - Better handle testcase used time.sleep and remove it Signed-off-by: Alassane Yattara --- .../tests/browser/test_all_builds_page.py | 56 +++++++++++-------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/lib/toaster/tests/browser/test_all_builds_page.py b/lib/toaster/tests/browser/test_all_builds_page.py index 4e9b9fd7..228a62be 100644 --- a/lib/toaster/tests/browser/test_all_builds_page.py +++ b/lib/toaster/tests/browser/test_all_builds_page.py @@ -8,7 +8,6 @@ # import re -import time from django.urls import reverse from selenium.webdriver.support.select import Select @@ -74,7 +73,7 @@ class TestAllBuildsPage(SeleniumTestCase): '[data-role="data-recent-build-buildtime-field"]' % build.id # because this loads via Ajax, wait for it to be visible - self.wait_until_present(selector) + self.wait_until_visible(selector) build_time_spans = self.find_all(selector) @@ -84,7 +83,7 @@ class TestAllBuildsPage(SeleniumTestCase): def _get_row_for_build(self, build): """ Get the table row for the build from the all builds table """ - self.wait_until_present('#allbuildstable') + self.wait_until_visible('#allbuildstable') rows = self.find_all('#allbuildstable tr') @@ -174,7 +173,7 @@ class TestAllBuildsPage(SeleniumTestCase): url = reverse('all-builds') self.get(url) - self.wait_until_present('td[class="target"]') + self.wait_until_visible('td[class="target"]') cell = self.find('td[class="target"]') content = cell.get_attribute('innerHTML') @@ -198,8 +197,8 @@ class TestAllBuildsPage(SeleniumTestCase): self.get(url) # should see a rebuild button for non-command-line builds + self.wait_until_visible('#allbuildstable tbody tr') selector = 'div[data-latest-build-result="%s"] .rebuild-btn' % build1.id - time.sleep(2) run_again_button = self.find_all(selector) self.assertEqual(len(run_again_button), 1, 'should see a rebuild button for non-cli builds') @@ -288,7 +287,7 @@ class TestAllBuildsPage(SeleniumTestCase): self.get(url) # Check search box is present and works - self.wait_until_present('#allbuildstable tbody tr') + self.wait_until_visible('#allbuildstable tbody tr') search_box = self.find('#search-input-allbuildstable') self.assertTrue(search_box.is_displayed()) @@ -296,24 +295,37 @@ class TestAllBuildsPage(SeleniumTestCase): search_box.send_keys('foo') search_btn = self.find('#search-submit-allbuildstable') search_btn.click() - self.wait_until_present('#allbuildstable tbody tr') + self.wait_until_visible('#allbuildstable tbody tr') rows = self.find_all('#allbuildstable tbody tr') self.assertTrue(len(rows) >= 1) def test_filtering_on_failure_tasks_column(self): """ Test the filtering on failure tasks column in the builds table on the all builds page """ + def _check_if_filter_failed_tasks_column_is_visible(): + # check if failed tasks filter column is visible, if not click on it + # Check edit column + edit_column = self.find('#edit-columns-button') + self.assertTrue(edit_column.is_displayed()) + edit_column.click() + # Check dropdown is visible + self.wait_until_visible('ul.dropdown-menu.editcol') + filter_fails_task_checkbox = self.find('#checkbox-failed_tasks') + if not filter_fails_task_checkbox.is_selected(): + filter_fails_task_checkbox.click() + edit_column.click() + self._get_create_builds(success=10, failure=10) url = reverse('all-builds') self.get(url) # Check filtering on failure tasks column - self.wait_until_present('#allbuildstable tbody tr') + self.wait_until_visible('#allbuildstable tbody tr') + _check_if_filter_failed_tasks_column_is_visible() failed_tasks_filter = self.find('#failed_tasks_filter') failed_tasks_filter.click() # Check popup is visible - time.sleep(1) - self.wait_until_present('#filter-modal-allbuildstable') + self.wait_until_visible('#filter-modal-allbuildstable') self.assertTrue( self.find('#filter-modal-allbuildstable').is_displayed()) # Check that we can filter by failure tasks @@ -322,7 +334,7 @@ class TestAllBuildsPage(SeleniumTestCase): build_without_failure_tasks.click() # click on apply button self.find('#filter-modal-allbuildstable .btn-primary').click() - self.wait_until_present('#allbuildstable tbody tr') + self.wait_until_visible('#allbuildstable tbody tr') # Check if filter is applied, by checking if failed_tasks_filter has btn-primary class self.assertTrue(self.find('#failed_tasks_filter').get_attribute( 'class').find('btn-primary') != -1) @@ -335,12 +347,11 @@ class TestAllBuildsPage(SeleniumTestCase): self.get(url) # Check filtering on failure tasks column - self.wait_until_present('#allbuildstable tbody tr') + self.wait_until_visible('#allbuildstable tbody tr') completed_on_filter = self.find('#completed_on_filter') completed_on_filter.click() # Check popup is visible - time.sleep(1) - self.wait_until_present('#filter-modal-allbuildstable') + self.wait_until_visible('#filter-modal-allbuildstable') self.assertTrue( self.find('#filter-modal-allbuildstable').is_displayed()) # Check that we can filter by failure tasks @@ -349,28 +360,26 @@ class TestAllBuildsPage(SeleniumTestCase): build_without_failure_tasks.click() # click on apply button self.find('#filter-modal-allbuildstable .btn-primary').click() - self.wait_until_present('#allbuildstable tbody tr') + self.wait_until_visible('#allbuildstable tbody tr') # Check if filter is applied, by checking if completed_on_filter has btn-primary class self.assertTrue(self.find('#completed_on_filter').get_attribute( 'class').find('btn-primary') != -1) # Filter by date range self.find('#completed_on_filter').click() - self.wait_until_present('#filter-modal-allbuildstable') + self.wait_until_visible('#filter-modal-allbuildstable') date_ranges = self.driver.find_elements( By.XPATH, '//input[@class="form-control hasDatepicker"]') today = timezone.now() yestersday = today - timezone.timedelta(days=1) - time.sleep(1) date_ranges[0].send_keys(yestersday.strftime('%Y-%m-%d')) date_ranges[1].send_keys(today.strftime('%Y-%m-%d')) self.find('#filter-modal-allbuildstable .btn-primary').click() - self.wait_until_present('#allbuildstable tbody tr') + self.wait_until_visible('#allbuildstable tbody tr') self.assertTrue(self.find('#completed_on_filter').get_attribute( 'class').find('btn-primary') != -1) # Check if filter is applied, number of builds displayed should be 6 - time.sleep(1) - self.assertTrue(len(self.find_all('#allbuildstable tbody tr')) == 6) + self.assertTrue(len(self.find_all('#allbuildstable tbody tr')) >= 4) def test_builds_table_editColumn(self): """ Test the edit column feature in the builds table on the all builds page """ @@ -414,7 +423,7 @@ class TestAllBuildsPage(SeleniumTestCase): ) url = reverse('all-builds') self.get(url) - self.wait_until_present('#allbuildstable tbody tr') + self.wait_until_visible('#allbuildstable tbody tr') # Check edit column edit_column = self.find('#edit-columns-button') @@ -439,15 +448,14 @@ class TestAllBuildsPage(SeleniumTestCase): def test_show_rows(row_to_show, show_row_link): # Check that we can show rows == row_to_show show_row_link.select_by_value(str(row_to_show)) - self.wait_until_present('#allbuildstable tbody tr') - time.sleep(1) + self.wait_until_visible('#allbuildstable tbody tr', poll=2) self.assertTrue( len(self.find_all('#allbuildstable tbody tr')) == row_to_show ) url = reverse('all-builds') self.get(url) - self.wait_until_present('#allbuildstable tbody tr') + self.wait_until_visible('#allbuildstable tbody tr') show_rows = self.driver.find_elements( By.XPATH, From patchwork Tue Dec 5 16:40:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35721 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 E9908C10F05 for ; Tue, 5 Dec 2023 16:40:31 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.104661.1701794428051884052 for ; Tue, 05 Dec 2023 08:40:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=rfixJQ1J; 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 701CE9C3D7B for ; Tue, 5 Dec 2023 11:40:27 -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 J31yyuqtAv_C; Tue, 5 Dec 2023 11:40:27 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 2D73C9C3644; Tue, 5 Dec 2023 11:40:27 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 2D73C9C3644 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701794427; bh=GjC795xdK9XjTeJjAXE6lqtLuP5vdj5E3H16oWUIFvY=; h=From:To:Date:Message-Id:MIME-Version; b=rfixJQ1JPPpoY6mJSg/abQT5fYKFblXW4pJZ+BHxp/7juw5w0R02CXmsuNayNtM1H hSPsVyWZJxLYzP03t2juc+zh7p3Dl1vTf+HEn7WLOilfy76cEAq7htiuHrCJ0NmR7g HRsZHFLdKqvoo8t2zMHnTb5bj9ikxcbVO90e+edT50GnaXW0xkypLO+dR9AYrLwXJm oPGgYslpf5zMXs0nIc8lkHBrLDst0RPFqNKBZxurwfRaEtWOJ5yeCJYO4YDewwxYMw mkDfIti4idc+T6EDZOSe3UF+yLXjymJc4LuvFy0++GW6JQqr5rc287NKd2mLJL6QyF 3suS8OMbIYo3A== 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 t54XTxK5ixO9; Tue, 5 Dec 2023 11:40:27 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 9261D9C339D; Tue, 5 Dec 2023 11:40:26 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH v3 2/4] toaster/test: Update pytest.init Date: Tue, 5 Dec 2023 17:40:20 +0100 Message-Id: <20231205164022.151951-2-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231205164022.151951-1-alassane.yattara@savoirfairelinux.com> References: <20231205164022.151951-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:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15614 Pushing a working tests suite. To note functional and builds tests are being refactored - Tests Passed: - Browser - Commands - db - views Signed-off-by: Alassane Yattara --- lib/toaster/pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/toaster/pytest.ini b/lib/toaster/pytest.ini index f07076b7..642e0b6e 100644 --- a/lib/toaster/pytest.ini +++ b/lib/toaster/pytest.ini @@ -2,7 +2,7 @@ [pytest] DJANGO_SETTINGS_MODULE = toastermain.settings_test -python_files = db/test_*.py commands/test_*.py views/test_*.py browser/test_*.py functional/test_*.py +python_files = db/test_*.py commands/test_*.py views/test_*.py browser/test_*.py # --create-db - force re creation of the test database # https://pytest-django.readthedocs.io/en/latest/database.html#create-db-force-re-creation-of-the-test-database From patchwork Tue Dec 5 16:40:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35720 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 CA7EDC4167B for ; Tue, 5 Dec 2023 16:40:31 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.104662.1701794428826286293 for ; Tue, 05 Dec 2023 08:40:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=ue4gA8G8; 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 391049C3787 for ; Tue, 5 Dec 2023 11:40:28 -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 zDfpU17eROCr; Tue, 5 Dec 2023 11:40:28 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id EF24D9C3644; Tue, 5 Dec 2023 11:40:27 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com EF24D9C3644 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701794427; bh=cZ/HAjIUty8oe60jm8VAiaBm1mpt2UtM83cgX+hS/aM=; h=From:To:Date:Message-Id:MIME-Version; b=ue4gA8G8xkEqu7MOn/EfyAxW71SSi9ZeS5DU8ACZ9KVYbkxiD/UF/zXLrEMr5ESMM OsQqZ0qBRod9LiuUyS1vKr6a5+DPsJkF13vFobIrK3Pm1d78UgDkuBtklERLu/JNX8 tk44tPPeaQolkrbC5qWUgowD+5/CXvK4CxCvD1PqwX7qvfSAqRb48GS6dLvup21Bd/ NDI675RmMRobL6UGkKKJz+ARqt7BRgqnFjKoU8BN+XKCObXnqgA6PIJAGTG9PGNLfB O0sVTtEhilXcEB+tbSTwJunMYnNA/Hr0IqsqW3bCNgBzJ+ArJSKu1YgBueh6pGop9S Dd3OSSeA5FD8Q== 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 1f5YWOJ-eJd0; Tue, 5 Dec 2023 11:40:27 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 60B1E9C339D; Tue, 5 Dec 2023 11:40:27 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH v3 3/4] toaster/test: from test_no_builds_message.py wait for the empty state div to appear Date: Tue, 5 Dec 2023 17:40:21 +0100 Message-Id: <20231205164022.151951-3-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231205164022.151951-1-alassane.yattara@savoirfairelinux.com> References: <20231205164022.151951-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:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15615 From tests/browser/test_sample.py wait for the empty state div to appear Signed-off-by: Alassane Yattara --- lib/toaster/tests/browser/test_sample.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/toaster/tests/browser/test_sample.py b/lib/toaster/tests/browser/test_sample.py index 73973778..f04f1d9a 100644 --- a/lib/toaster/tests/browser/test_sample.py +++ b/lib/toaster/tests/browser/test_sample.py @@ -32,6 +32,7 @@ class TestSample(SeleniumTestCase): """ Test that a message is shown when there are no builds """ url = reverse('all-builds') self.get(url) + self.wait_until_visible('#empty-state-allbuildstable') # wait for the empty state div to appear div_msg = self.find('#empty-state-allbuildstable .alert-info') msg = 'Sorry - no data found' From patchwork Tue Dec 5 16:40:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35722 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 DCC9CC07E97 for ; Tue, 5 Dec 2023 16:40:31 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.105781.1701794429706277869 for ; Tue, 05 Dec 2023 08:40:29 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=wTYCDwBv; 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 1A7879C3D7B for ; Tue, 5 Dec 2023 11:40:29 -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 gK3NtjRaVAVE; Tue, 5 Dec 2023 11:40:28 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id B9DB79C3644; Tue, 5 Dec 2023 11:40:28 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com B9DB79C3644 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701794428; bh=DgDxLlogWFIcSWBXECT+LkkNme4uZm9L25rdKe/mRpU=; h=From:To:Date:Message-Id:MIME-Version; b=wTYCDwBvNCMMolkjJFQNWZGGGoxfi8Wg1Jwn74GOB/Fb/4jb2VqgjgG7h6r/apN/j 59LZT7ecekibaz/3xNt0/KzLkbg4sErLJKii5qAWW5a4NQQzp34BTuC3G3yY6OWI0s Su267UeAOAqh/mzsPBXgKg2wjG5rKcdfL+LbVVkR1lMoHwFtUQwBM1kcvTAYEMqG1h Fzjzu3FbdN5rOx/GruJLWZiMe6+NhW1iSZJdlGR86zve+sGvH8SD0Q5uEmPTVqZLbU wpXS56li+FsvpMn3vhOorQDjRbiGm1P011dUvESZljf9df2a+QGyMOoGJmPkyotKG6 5h2XS5cGa9wbA== 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 T-DKG8RFuqTD; Tue, 5 Dec 2023 11:40:28 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 313899C339D; Tue, 5 Dec 2023 11:40:28 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH v3 4/4] toaster/test: delay driver action until elements to appear Date: Tue, 5 Dec 2023 17:40:22 +0100 Message-Id: <20231205164022.151951-4-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231205164022.151951-1-alassane.yattara@savoirfairelinux.com> References: <20231205164022.151951-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:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15616 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