From patchwork Tue Nov 21 13:47:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 34947 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 CBD1BC61D92 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.40769.1700574457223705338 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=MZbbZxN2; 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 2ABE69C36C5 for ; Tue, 21 Nov 2023 08:47:36 -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 Zvpcl3hqyRqt; Tue, 21 Nov 2023 08:47:35 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 95BE49C3500; Tue, 21 Nov 2023 08:47:35 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 95BE49C3500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1700574455; bh=JjqD5HKixp7hLeuqqEY/8qQk6P82Ru05ECeGDvQjuPE=; h=From:To:Date:Message-Id:MIME-Version; b=MZbbZxN2rVye8UGpV0FzrNejaAzDst2j9OubebFulhp1odGY702cekE33uNgCJGtx LPMImo5zfiz7XUJVz2fkWZXGY0IgWgw5+AA04Q8B4x/qLulLvDZxmHUb3qs6Z5h/M+ 7zD2o8HNK9eX8F7O0zGrbhMCQV36IvqzutPnzXlp5TELsN4ji2JJ5isXAWAAEXdqWh N2nD5ULQXYV2LBpx/l1iM64LcuTSKVhU2onVek9aHEMv7X6xd4JXHjdYMztIWB9CZa 7Jk/u5Xv0w1BYtb8QdRUbqKlVTyj8jEnHTOMNzd+uPlwTa+oFb5/YznJI9IdrFW1Bw +g3Xg66wMjgfw== 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 f4TPhUVNRfKj; Tue, 21 Nov 2023 08:47:35 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id B10C79C36C5; Tue, 21 Nov 2023 08:47:34 -0500 (EST) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 2/3] Toaster: Toaster: Write UI TestCase -> Visualize all projects Date: Tue, 21 Nov 2023 14:47:28 +0100 Message-Id: <20231121134729.95095-2-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/6007 Test the edit column feature in the projects table on the all projects page Signed-off-by: Alassane Yattara --- .../tests/browser/test_all_projects_page.py | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/lib/toaster/tests/browser/test_all_projects_page.py b/lib/toaster/tests/browser/test_all_projects_page.py index db25e723..2b1d8cc1 100644 --- a/lib/toaster/tests/browser/test_all_projects_page.py +++ b/lib/toaster/tests/browser/test_all_projects_page.py @@ -239,3 +239,61 @@ class TestAllProjectsPage(SeleniumTestCase): time.sleep(1) rows = self.find_all('#projectstable tbody tr') self.assertTrue(len(rows) == 1) + + def test_allProject_table_editColumn(self): + """ Test the edit column feature in the projects table on the all projects page """ + self._create_projects() + + def test_edit_column(check_box_id): + # Check that we can hide/show table column + check_box = self.find(f'#{check_box_id}') + th_class = str(check_box_id).replace('checkbox-', '') + if check_box.is_selected(): + # check if column is visible in table + self.assertTrue( + self.find( + f'#projectstable thead th.{th_class}' + ).is_displayed(), + f"The {th_class} column is checked in EditColumn dropdown, but it's not visible in table" + ) + check_box.click() + # check if column is hidden in table + self.assertFalse( + self.find( + f'#projectstable thead th.{th_class}' + ).is_displayed(), + f"The {th_class} column is unchecked in EditColumn dropdown, but it's visible in table" + ) + else: + # check if column is hidden in table + self.assertFalse( + self.find( + f'#projectstable thead th.{th_class}' + ).is_displayed(), + f"The {th_class} column is unchecked in EditColumn dropdown, but it's visible in table" + ) + check_box.click() + # check if column is visible in table + self.assertTrue( + self.find( + f'#projectstable thead th.{th_class}' + ).is_displayed(), + f"The {th_class} column is checked in EditColumn dropdown, but it's not visible in table" + ) + url = reverse('all-projects') + self.get(url) + self.wait_until_present('#projectstable tbody tr') + + # 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') + + # Check that we can hide the edit column + test_edit_column('checkbox-errors') + test_edit_column('checkbox-image_files') + test_edit_column('checkbox-last_build_outcome') + test_edit_column('checkbox-recipe_name') + test_edit_column('checkbox-warnings')