From patchwork Tue Nov 21 13:47:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 34949 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 D5FB6C61D94 for ; Tue, 21 Nov 2023 13:47:39 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.40771.1700574457904273720 for ; Tue, 21 Nov 2023 05:47:38 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=H/DrTjpc; 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 419949C36BF for ; Tue, 21 Nov 2023 08:47:37 -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 8OOaV3q8CLOO; Tue, 21 Nov 2023 08:47:36 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id CAB769C3500; Tue, 21 Nov 2023 08:47:36 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com CAB769C3500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1700574456; bh=gMAwcRDu6dn+fvWsoJukwtIYa0PqX6nF7Ewp49cvZWY=; h=From:To:Date:Message-Id:MIME-Version; b=H/DrTjpcYTmmCsYtxK3h5mZzD/ZPg/bdpujwSoMjEZzjKBJ51tTo2g1/AYBgJoz3a sXhFt1+lTzbdR08vlNVye9QOJQnOvAr+4FU8LCWWlqceF47bGMxe/3Sj0Yuneyj1P+ GLiI/UnIxslFobNF3sfhZ8hzRxQoGWLwngLG4n0fZ4TRDEmbe5sstSQVH42bjPC6D5 wuVthjkLvhgWza285qyM7vx/gDRK4gx0Wmn2RZ7LckdxEijOzWTkiIRrgQAUizj/kI RL+K9+YVURGVEGsS92Ya8YFPdxmLeuzu5isrOdASVdCquQv4t/qL0k4BWkKpY3rhd4 JEYyQpXNd9whg== 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 6UIjxrsVyzqq; Tue, 21 Nov 2023 08:47:36 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id E8CCB9C36BF; Tue, 21 Nov 2023 08:47:35 -0500 (EST) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 3/3] Toaster: Toaster: Write UI TestCase -> Visualize all projects Date: Tue, 21 Nov 2023 14:47:29 +0100 Message-Id: <20231121134729.95095-3-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231121134729.95095-1-alassane.yattara@savoirfairelinux.com> References: <20231121134729.95095-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, 21 Nov 2023 13:47:39 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/6006 Test the show rows feature in the projects table on the all projects page Signed-off-by: Alassane Yattara --- .../tests/browser/test_all_projects_page.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/lib/toaster/tests/browser/test_all_projects_page.py b/lib/toaster/tests/browser/test_all_projects_page.py index 2b1d8cc1..a880dbcc 100644 --- a/lib/toaster/tests/browser/test_all_projects_page.py +++ b/lib/toaster/tests/browser/test_all_projects_page.py @@ -297,3 +297,37 @@ class TestAllProjectsPage(SeleniumTestCase): test_edit_column('checkbox-last_build_outcome') test_edit_column('checkbox-recipe_name') test_edit_column('checkbox-warnings') + + def test_allProject_table_show_rows(self): + """ Test the show rows feature in the projects table on the all projects page """ + self._create_projects(nb_project=200) + + 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('#projectstable tbody tr') + sleep_time = 1 + if row_to_show == 150: + # wait more time for 150 rows + sleep_time = 2 + time.sleep(sleep_time) + self.assertTrue( + len(self.find_all('#projectstable tbody tr')) == row_to_show + ) + + url = reverse('all-projects') + self.get(url) + self.wait_until_present('#projectstable tbody tr') + + show_rows = self.driver.find_elements( + By.XPATH, + '//select[@class="form-control pagesize-projectstable"]' + ) + # Check show rows + for show_row_link in show_rows: + show_row_link = Select(show_row_link) + test_show_rows(10, show_row_link) + test_show_rows(25, show_row_link) + test_show_rows(50, show_row_link) + test_show_rows(100, show_row_link) + test_show_rows(150, show_row_link)