From patchwork Wed Nov 29 22:53:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35381 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 5C87EC10DC3 for ; Wed, 29 Nov 2023 22:53:58 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.57400.1701298436550658134 for ; Wed, 29 Nov 2023 14:53:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=tOgfpREy; 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 E78199C34CD for ; Wed, 29 Nov 2023 17:53: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 crW_bsSLu7Qf; Wed, 29 Nov 2023 17:53:55 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 742049C34C4; Wed, 29 Nov 2023 17:53:55 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 742049C34C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701298435; bh=dvn3UAp0zH9504gmNCBCWZpEbo9JYr/dKpmCghmFYXw=; h=From:To:Date:Message-Id:MIME-Version; b=tOgfpREySVstexpcYdiVVAA/8PZNd2Id5pAXxEUFRq7uWEnAY4zcVwGXpn0Qh8v4S dZhnD8GGgWzSm8A5RoCI4UGcnZVkHl6EV8M3MGHoeF2iRWgvrS93Gm7mnz7JFMUdIA Gg8nfm9lM0hvP/OCz2OmFkbmFevhZ45zxVbWit+wajXoPbUvAYx6/5VXDZ09mutf+E DKdGqFfx/5WCHfIKjAWWlH2IMozQwKTeqt1y2/YjN6Niz1Q0uwAXKv4/RzaN3v/z/T SsCN9gQluYT7OfhDKLfWe7+OAEeJp9QudnfmWY+8/QVG0FE4wHrUCewEvggXDlHHOq NKPA0iwOsACzQ== 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 0ORKvWrS39Yj; Wed, 29 Nov 2023 17:53:55 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id E16B49C2797; Wed, 29 Nov 2023 17:53:54 -0500 (EST) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 4/9] toaster/test: Added Machine page TestCase Date: Wed, 29 Nov 2023 23:53:35 +0100 Message-Id: <20231129225340.477401-4-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129225340.477401-1-alassane.yattara@savoirfairelinux.com> References: <20231129225340.477401-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 ; Wed, 29 Nov 2023 22:53:58 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/6028 Test Machine page - Check if title "Compatible machines" is displayed - Check search input - Check "Select machine" button works - Check "Add layer" button works - Check Machine table feature(show/hide column, pagination) Signed-off-by: Alassane Yattara --- .../tests/functional/test_project_page.py | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/lib/toaster/tests/functional/test_project_page.py b/lib/toaster/tests/functional/test_project_page.py index 28f1fcb6..46a60c01 100644 --- a/lib/toaster/tests/functional/test_project_page.py +++ b/lib/toaster/tests/functional/test_project_page.py @@ -493,3 +493,82 @@ class TestProjectPage(SeleniumFunctionalTestCase): self._navigate_to_config_nav('softwarerecipestable', 4) # check show rows(pagination) self._mixin_test_table_show_rows(table_selector='softwarerecipestable') + + def test_machines_page(self): + """ Test Machine page + - Check if title "Compatible machines" is displayed + - Check search input + - Check "Select machine" button works + - Check "Add layer" button works + - Check Machine table feature(show/hide column, pagination) + """ + self._navigate_to_config_nav('machinestable', 5) + # check title "Compatible software recipes" is displayed + self.assertTrue("Compatible machines" in self.get_page_source()) + # Test search input + self._mixin_test_table_search_input( + input_selector='search-input-machinestable', + input_text='qemux86-64', + searchBtn_selector='search-submit-machinestable', + table_selector='machinestable' + ) + # check "Select machine" button works + rows = self.find_all('#machinestable tbody tr') + machine_to_select = rows[0] + select_btn = machine_to_select.find_element( + By.XPATH, + '//td[@class="add-del-layers"]' + ) + select_btn.click() + self.wait_until_visible('#config-nav') + project_machine_name = self.find('#project-machine-name') + self.assertTrue( + 'qemux86-64' in project_machine_name.text + ) + # check "Add layer" button works + self._navigate_to_config_nav('machinestable', 5) + # Search for a machine whit layer not in project + self._mixin_test_table_search_input( + input_selector='search-input-machinestable', + input_text='qemux86-64-screen', + searchBtn_selector='search-submit-machinestable', + table_selector='machinestable' + ) + rows = self.find_all('#machinestable tbody tr') + machine_to_add = rows[0] + add_btn = machine_to_add.find_element( + By.XPATH, + '//td[@class="add-del-layers"]' + ) + add_btn.click() + # check modal is displayed + self.wait_until_visible('#dependencies-modal') + list_dependencies = self.find_all('#dependencies-list li') + # click on add-layers button + add_layers_btn = self.driver.find_element( + By.XPATH, + '//form[@id="dependencies-modal-form"]//button[@class="btn btn-primary"]' + ) + add_layers_btn.click() + self.wait_until_visible('#change-notification') + change_notification = self.find('#change-notification') + self.assertTrue( + f'You have added {len(list_dependencies)+1} layers to your project: meta-tanowrt and its dependencies' in change_notification.text + ) + + # check Machine table feature(show/hide column, pagination) + self._navigate_to_config_nav('machinestable', 5) + column_list = [ + 'description', + 'layer_version__get_vcs_reference', + 'layer_version__layer__name', + 'machinefile', + ] + self._mixin_test_table_edit_column( + 'machinestable', + 'edit-columns-button', + [f'checkbox-{column}' for column in column_list] + ) + self._navigate_to_config_nav('machinestable', 5) + # check show rows(pagination) + self._mixin_test_table_show_rows(table_selector='machinestable')