From patchwork Tue Nov 21 13:50:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 34955 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 14D60C61D96 for ; Tue, 21 Nov 2023 13:51:00 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.40860.1700574656520859900 for ; Tue, 21 Nov 2023 05:50:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=Emv6/yb6; 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 D52029C3500 for ; Tue, 21 Nov 2023 08:50:55 -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 Cd3oDTiMC8CQ; Tue, 21 Nov 2023 08:50:55 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 446F79C36B5; Tue, 21 Nov 2023 08:50:55 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 446F79C36B5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1700574655; bh=A8MHLGVnvqtQ9Zx2XwD5LNYAiQhk68G8NOHXHI5pMDI=; h=From:To:Date:Message-Id:MIME-Version; b=Emv6/yb6qJ5r7wPN20aWfHI0nlgCziFezWsIJIbQwjNYDV0bQS/wGDodxtrW6sp4x sDoPx7i6cK9BCfukOSoTblYkxi3SnPyPaQ797gwuI/4rxDwoPHueBqXs8iyoanVvmd etXn/TSPoYhdaVRJcl+OWscUdw2FViJl7Edvi5+FTUL5DtSxtWbKtFj/P1piT7Y2Je 7vudTSdZB5XfY0tO2+hgAys269BBUWC3F470vkZfT4frlNEJXCBwqehQ3UYTjgjq7I DihQppJZSfJrlb/YnmQm678N/QcP9964kPFoJ8Rv5fj8NCcO2UBWUDCpUnHBvAfa3+ j7/8vC5oS2fpg== 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 GzN9E76vIHOC; Tue, 21 Nov 2023 08:50:55 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 630CA9C366C; Tue, 21 Nov 2023 08:50:54 -0500 (EST) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 7/7] Toaster: Write UI TestCase -> Test the show rows feature in image recipe Date: Tue, 21 Nov 2023 14:50:43 +0100 Message-Id: <20231121135043.105385-7-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231121135043.105385-1-alassane.yattara@savoirfairelinux.com> References: <20231121135043.105385-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:51:00 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/6018 Test the show rows feature in image recipe table on project page Signed-off-by: Alassane Yattara --- .../test_project_page_tab_config.py | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/lib/toaster/tests/functional/test_project_page_tab_config.py b/lib/toaster/tests/functional/test_project_page_tab_config.py index 2dfc120d..23012d78 100644 --- a/lib/toaster/tests/functional/test_project_page_tab_config.py +++ b/lib/toaster/tests/functional/test_project_page_tab_config.py @@ -347,7 +347,10 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase): By.XPATH, '//*[@id="project-page"]/div[1]/div[3]') recipe_list = most_built_recipes.find_element(By.ID, 'freq-build-list') recipe_list_items = recipe_list.find_elements(By.TAG_NAME, 'li') - self.assertTrue(len(recipe_list_items) > 0) + self.assertTrue( + len(recipe_list_items) > 0, + msg="No recipes found in the most built recipes list", + ) checkbox = recipe_list_items[0].find_element(By.TAG_NAME, 'input') checkbox.click() build_btn = self.find('#freq-build-btn') @@ -465,6 +468,7 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase): recipe_input = self.find('#search-input-imagerecipestable') recipe_input.send_keys('core-image-minimal') self.find('#search-submit-imagerecipestable').click() + self.wait_until_visible('#imagerecipestable tbody tr') rows = self.find_all('#imagerecipestable tbody tr') self.assertTrue(len(rows) > 0) @@ -542,3 +546,33 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase): test_edit_column('checkbox-recipe-file') test_edit_column('checkbox-section') test_edit_column('checkbox-version') + + def test_image_recipe_show_rows(self): + """ Test the show rows feature in image recipe table on project page """ + self._get_create_builds(success=100, failure=100) + + 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('#imagerecipestable tbody tr') + sleep(1) + self.assertTrue( + len(self.find_all('#imagerecipestable tbody tr')) == row_to_show + ) + + url = reverse('projectimagerecipes', args=(2,)) + self.get(url) + self.wait_until_present('#imagerecipestable tbody tr') + + show_rows = self.driver.find_elements( + By.XPATH, + '//select[@class="form-control pagesize-imagerecipestable"]' + ) + # 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)