From patchwork Wed Nov 29 22:54:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35387 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 6C944C4167B for ; Wed, 29 Nov 2023 22:54:28 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.57411.1701298461492440158 for ; Wed, 29 Nov 2023 14:54:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=Ywg72fSQ; 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 C170F9C3636 for ; Wed, 29 Nov 2023 17:54:20 -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 CbYI9lQN2oMy; Wed, 29 Nov 2023 17:54:20 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 5E4399C341E; Wed, 29 Nov 2023 17:54:20 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 5E4399C341E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701298460; bh=b+X1Nxo9h2mxAwycXWsbLpYJ/UbzQ3mGaMOTvM09yYk=; h=From:To:Date:Message-Id:MIME-Version; b=Ywg72fSQJGoq/vHeeMe6GlZXrB2fvK5xvNZYH/4w/rC1kr1whnSXhMBKFiDDx+X2w SaBodxg/qVlvAzgBIcm9y9hpoyMv+w+s65EEd7mCHrlufzGtPtY2E8OojlO0sb9XsA ofYChA4jlm7nPG5pjA8Sy+xT/aa4KPw5z7oELSTFaewlBDNxWUtl0/JgYT1HWXOLem TCNhOOpYKPr0lh4Pv3K4dJQevN2irYGRtc2VvXrNbAOxmcmo0qFTho0HJpGI0irbaO lj3Rd92ryoKe8B0HmwCvJP4ao7/CrJUZg73AqOD2zBHYO1Fux2V6XlxPpZoHWPm2Av vt9Pw7U42pC8w== 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 myHQ34Nl9EnC; Wed, 29 Nov 2023 17:54:20 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id A8F079C279F; Wed, 29 Nov 2023 17:54:19 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 1/9] toaster/tests: Update methods wait_until_~ to skip using time.sleep Date: Wed, 29 Nov 2023 23:54:08 +0100 Message-Id: <20231129225416.479526-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 ; Wed, 29 Nov 2023 22:54:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15580 Update Class Wait from selenium_helpers_base, to override wait_until_visible and wait_until_present with poll argument to better handle delay between driver actions Signed-off-by: Alassane Yattara --- lib/toaster/tests/browser/selenium_helpers_base.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/toaster/tests/browser/selenium_helpers_base.py b/lib/toaster/tests/browser/selenium_helpers_base.py index e0ac4376..d9ea7fd1 100644 --- a/lib/toaster/tests/browser/selenium_helpers_base.py +++ b/lib/toaster/tests/browser/selenium_helpers_base.py @@ -71,7 +71,9 @@ class Wait(WebDriverWait): _TIMEOUT = 10 _POLL_FREQUENCY = 0.5 - def __init__(self, driver): + def __init__(self, driver, timeout=_TIMEOUT, poll=_POLL_FREQUENCY): + self._TIMEOUT = timeout + self._POLL_FREQUENCY = poll super(Wait, self).__init__(driver, self._TIMEOUT, self._POLL_FREQUENCY) def until(self, method, message=''): @@ -175,18 +177,19 @@ class SeleniumTestCaseBase(unittest.TestCase): """ Return the element which currently has focus on the page """ return self.driver.switch_to.active_element - def wait_until_present(self, selector): + def wait_until_present(self, selector, poll=0.5): """ Wait until element matching CSS selector is on the page """ is_present = lambda driver: self.find(selector) msg = 'An element matching "%s" should be on the page' % selector - element = Wait(self.driver).until(is_present, msg) + element = Wait(self.driver, poll=poll).until(is_present, msg) return element - def wait_until_visible(self, selector): + def wait_until_visible(self, selector, poll=1): """ Wait until element matching CSS selector is visible on the page """ is_visible = lambda driver: self.find(selector).is_displayed() msg = 'An element matching "%s" should be visible' % selector - Wait(self.driver).until(is_visible, msg) + Wait(self.driver, poll=poll).until(is_visible, msg) + time.sleep(poll) # wait for visibility to settle return self.find(selector) def wait_until_focused(self, selector): From patchwork Wed Nov 29 22:54:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35391 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 9D403C46CA3 for ; Wed, 29 Nov 2023 22:54:28 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.57333.1701298462641327759 for ; Wed, 29 Nov 2023 14:54:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=SXdkelqY; 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 B21079C3636 for ; Wed, 29 Nov 2023 17:54:21 -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 7eZgxhS2w0Fw; Wed, 29 Nov 2023 17:54:21 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 0BB489C341E; Wed, 29 Nov 2023 17:54:21 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 0BB489C341E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701298461; bh=Rk8R1jfsrUChGeKCrKr2VlgUcgp3bK1yIrRvD/OUsvU=; h=From:To:Date:Message-Id:MIME-Version; b=SXdkelqYmOUDsun621YNkizyq/+q0G2HK2hAUVMGBfqmDZOEEK4yj2vjIEoWt/pe6 8iCxJ3M6CRfOqlCM74XjWTq+CxoND7OPXy6mYRjBWTwr0QhyAPwbxLPrGz0WS8w/Le TUyXGwYHm8ATB6s/RinKbVR6DokjdpZ+y1kqKusvzpxWpJQT0GCgDx+TBBVlv9tPg3 GaeBUw75OybJWFTnJQm96vnqOoF2IYoN0b7UosladhEymuzyGk+g5lgjSaDRxwhrnK l/D4MMnYfb5fs0zqcSsdSqh0cJSyKbTU5wH4Fl1I0AIbVEfF3dgBjqO5fyAhDdiuz0 82N8VaGuZz3Rw== 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 aV1QkeoMT6f2; Wed, 29 Nov 2023 17:54:20 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 71C5E9C279F; Wed, 29 Nov 2023 17:54:20 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 2/9] toaster/test: Override table edit columns TestCase from image recipe page Date: Wed, 29 Nov 2023 23:54:09 +0100 Message-Id: <20231129225416.479526-2-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129225416.479526-1-alassane.yattara@savoirfairelinux.com> References: <20231129225416.479526-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:54:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15581 Better handle TestCase of table edit column feature Signed-off-by: Alassane Yattara --- .../tests/functional/test_project_page.py | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/lib/toaster/tests/functional/test_project_page.py b/lib/toaster/tests/functional/test_project_page.py index 3edf967a..f1eb9cfa 100644 --- a/lib/toaster/tests/functional/test_project_page.py +++ b/lib/toaster/tests/functional/test_project_page.py @@ -8,8 +8,10 @@ import pytest from django.urls import reverse +from django.utils import timezone from selenium.webdriver.support.select import Select from tests.functional.functional_helpers import SeleniumFunctionalTestCase +from orm.models import Build, Project, Target from selenium.webdriver.common.by import By @@ -55,6 +57,134 @@ class TestProjectPage(SeleniumFunctionalTestCase): self.driver.find_element(By.ID, "create-project-button").click() + def _get_create_builds(self, **kwargs): + """ Create a build and return the build object """ + # parameters for builds to associate with the projects + now = timezone.now() + release = '3' + project_name = 'projectmaster' + self._create_test_new_project( + project_name+"2", + release, + False, + ) + + self.project1_build_success = { + 'project': Project.objects.get(id=1), + 'started_on': now, + 'completed_on': now, + 'outcome': Build.SUCCEEDED + } + + self.project1_build_failure = { + 'project': Project.objects.get(id=1), + 'started_on': now, + 'completed_on': now, + 'outcome': Build.FAILED + } + build1 = Build.objects.create(**self.project1_build_success) + build2 = Build.objects.create(**self.project1_build_failure) + + # add some targets to these builds so they have recipe links + # (and so we can find the row in the ToasterTable corresponding to + # a particular build) + Target.objects.create(build=build1, target='foo') + Target.objects.create(build=build2, target='bar') + + if kwargs: + # Create kwargs.get('success') builds with success status with target + # and kwargs.get('failure') builds with failure status with target + for i in range(kwargs.get('success', 0)): + now = timezone.now() + self.project1_build_success['started_on'] = now + self.project1_build_success[ + 'completed_on'] = now - timezone.timedelta(days=i) + build = Build.objects.create(**self.project1_build_success) + Target.objects.create(build=build, + target=f'{i}_success_recipe', + task=f'{i}_success_task') + + for i in range(kwargs.get('failure', 0)): + now = timezone.now() + self.project1_build_failure['started_on'] = now + self.project1_build_failure[ + 'completed_on'] = now - timezone.timedelta(days=i) + build = Build.objects.create(**self.project1_build_failure) + Target.objects.create(build=build, + target=f'{i}_fail_recipe', + task=f'{i}_fail_task') + return build1, build2 + + def _mixin_test_table_edit_column( + self, + table_id, + edit_btn_id, + list_check_box_id: list + ): + # Check edit column + edit_column = self.find(f'#{edit_btn_id}') + self.assertTrue(edit_column.is_displayed()) + edit_column.click() + # Check dropdown is visible + self.wait_until_visible('ul.dropdown-menu.editcol') + for check_box_id in list_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'#{table_id} 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'#{table_id} 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'#{table_id} 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'#{table_id} thead th.{th_class}' + ).is_displayed(), + f"The {th_class} column is checked in EditColumn dropdown, but it's not visible in table" + ) + + def test_image_recipe_editColumn(self): + """ Test the edit column feature in image recipe table on project page """ + self._get_create_builds(success=10, failure=10) + + url = reverse('projectimagerecipes', args=(1,)) + self.get(url) + self.wait_until_present('#imagerecipestable tbody tr') + + column_list = [ + 'get_description_or_summary', 'layer_version__get_vcs_reference', + 'layer_version__layer__name', 'license', 'recipe-file', 'section', + 'version' + ] + + # Check that we can hide the edit column + self._mixin_test_table_edit_column( + 'imagerecipestable', + 'edit-columns-button', + [f'checkbox-{column}' for column in column_list] + ) + def test_page_header_on_project_page(self): """ Check page header in project page: - AT LEFT -> Logo of Yocto project, displayed, clickable From patchwork Wed Nov 29 22:54:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35392 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 9CF93C10DCE for ; Wed, 29 Nov 2023 22:54:28 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.57334.1701298463050144844 for ; Wed, 29 Nov 2023 14:54:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=JU3/BZ2u; 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 6B76F9C3679 for ; Wed, 29 Nov 2023 17:54:22 -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 q1knb2_ki-QO; Wed, 29 Nov 2023 17:54:21 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id BBA8A9C341E; Wed, 29 Nov 2023 17:54:21 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com BBA8A9C341E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701298461; bh=Gu7LSjTMRIutt2pVoYpNGcgYEgMPM5NyOuXX8kEY7oA=; h=From:To:Date:Message-Id:MIME-Version; b=JU3/BZ2uZb3VUW+vv/3WgOXuiRZD34XZC/JJqyHEekzCSwWJbZpqCSSW6HPkyJav6 drkmOfZOuoQqFpY6wQXOsFrSlaAEg5ZW6XhKHKmQ5rS+KaQAsBAViQvHzWg0J/Bp1u lucoddLIpkC1FE8ToT5dOuG/Zpl6NO08D8vs2kUhDSZQN7pVcl+7e/ogTwBMKbuFX6 mwkXjzOpnSq4yIVRf5ZD/VodMhJmBfumoVVj1nFCyjm+C8S06y7kRJM0eA+poV4fjl 39iG6OuvkeMChRPrQP45PmN1E3hC9VPKA9rVR03d52568lZXB9kB7Wp5GmfEqN6UxE 2gIsxQfRC69Nw== 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 VFfVALhe5pDF; Wed, 29 Nov 2023 17:54:21 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 367149C279F; Wed, 29 Nov 2023 17:54:21 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 3/9] toaster/test: Test software recipe page Date: Wed, 29 Nov 2023 23:54:10 +0100 Message-Id: <20231129225416.479526-3-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129225416.479526-1-alassane.yattara@savoirfairelinux.com> References: <20231129225416.479526-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:54:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15582 Test software recipe page - Check title "Compatible software recipes" is displayed - Check search input - Check "build recipe" button works - Check software recipe table feature(show/hide column, pagination) Signed-off-by: Alassane Yattara --- .../tests/functional/test_project_page.py | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/lib/toaster/tests/functional/test_project_page.py b/lib/toaster/tests/functional/test_project_page.py index f1eb9cfa..28f1fcb6 100644 --- a/lib/toaster/tests/functional/test_project_page.py +++ b/lib/toaster/tests/functional/test_project_page.py @@ -7,9 +7,11 @@ # import pytest +from time import sleep from django.urls import reverse from django.utils import timezone from selenium.webdriver.support.select import Select +from selenium.common.exceptions import NoSuchElementException from tests.functional.functional_helpers import SeleniumFunctionalTestCase from orm.models import Build, Project, Target from selenium.webdriver.common.by import By @@ -164,6 +166,70 @@ class TestProjectPage(SeleniumFunctionalTestCase): f"The {th_class} column is checked in EditColumn dropdown, but it's not visible in table" ) + def _get_config_nav_item(self, index): + config_nav = self.find('#config-nav') + return config_nav.find_elements(By.TAG_NAME, 'li')[index] + + def _navigate_to_config_nav(self, nav_id, nav_index): + # navigate to the project page + url = reverse("project", args=(1,)) + self.get(url) + self.wait_until_visible('#config-nav') + # click on "Software recipe" tab + soft_recipe = self._get_config_nav_item(nav_index) + soft_recipe.click() + self.wait_until_visible(f'#{nav_id}') + + def _mixin_test_table_show_rows(self, table_selector, **kwargs): + """ Test the show rows feature in the builds table on the all builds page """ + 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_visible(f'#{table_selector} tbody tr', poll=2) + self.assertTrue( + len(self.find_all(f'#{table_selector} tbody tr')) == row_to_show + ) + self.wait_until_present(f'#{table_selector} tbody tr') + show_rows = self.driver.find_elements( + By.XPATH, + f'//select[@class="form-control pagesize-{table_selector}"]' + ) + rows_to_show = [10, 25, 50, 100, 150] + to_skip = kwargs.get('to_skip', []) + # Check show rows + for show_row_link in show_rows: + show_row_link = Select(show_row_link) + for row_to_show in rows_to_show: + if row_to_show not in to_skip: + test_show_rows(row_to_show, show_row_link) + + def _wait_until_build(self, state): + while True: + try: + last_build_state = self.driver.find_element( + By.XPATH, + '//*[@id="latest-builds"]/div[1]//div[@class="build-state"]', + ) + build_state = last_build_state.get_attribute( + 'data-build-state') + state_text = state.lower().split() + if any(x in str(build_state).lower() for x in state_text): + break + except NoSuchElementException: + continue + sleep(1) + + def _mixin_test_table_search_input(self, **kwargs): + input_selector, input_text, searchBtn_selector, table_selector, *_ = kwargs.values() + # Test search input + self.wait_until_visible(f'#{input_selector}') + recipe_input = self.find(f'#{input_selector}') + recipe_input.send_keys(input_text) + self.find(f'#{searchBtn_selector}').click() + self.wait_until_visible(f'#{table_selector} tbody tr') + rows = self.find_all(f'#{table_selector} tbody tr') + self.assertTrue(len(rows) > 0) + def test_image_recipe_editColumn(self): """ Test the edit column feature in image recipe table on project page """ self._get_create_builds(success=10, failure=10) @@ -375,3 +441,55 @@ class TestProjectPage(SeleniumFunctionalTestCase): self.assertTrue( 'core-image-minimal' in str(last_build.text) ) + + def test_softwareRecipe_page(self): + """ Test software recipe page + - Check title "Compatible software recipes" is displayed + - Check search input + - Check "build recipe" button works + - Check software recipe table feature(show/hide column, pagination) + """ + self._navigate_to_config_nav('softwarerecipestable', 4) + # check title "Compatible software recipes" is displayed + self.assertTrue("Compatible software recipes" in self.get_page_source()) + # Test search input + self._mixin_test_table_search_input( + input_selector='search-input-softwarerecipestable', + input_text='busybox', + searchBtn_selector='search-submit-softwarerecipestable', + table_selector='softwarerecipestable' + ) + # check "build recipe" button works + rows = self.find_all('#softwarerecipestable tbody tr') + image_to_build = rows[0] + build_btn = image_to_build.find_element( + By.XPATH, + '//td[@class="add-del-layers"]' + ) + build_btn.click() + self._wait_until_build('parsing starting cloning') + lastest_builds = self.driver.find_elements( + By.XPATH, + '//div[@id="latest-builds"]/div' + ) + self.assertTrue(len(lastest_builds) > 0) + + # check software recipe table feature(show/hide column, pagination) + self._navigate_to_config_nav('softwarerecipestable', 4) + column_list = [ + 'get_description_or_summary', + 'layer_version__get_vcs_reference', + 'layer_version__layer__name', + 'license', + 'recipe-file', + 'section', + 'version', + ] + self._mixin_test_table_edit_column( + 'softwarerecipestable', + 'edit-columns-button', + [f'checkbox-{column}' for column in column_list] + ) + self._navigate_to_config_nav('softwarerecipestable', 4) + # check show rows(pagination) + self._mixin_test_table_show_rows(table_selector='softwarerecipestable') From patchwork Wed Nov 29 22:54:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35393 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 A9C8DC10F04 for ; Wed, 29 Nov 2023 22:54:28 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.57413.1701298463876518886 for ; Wed, 29 Nov 2023 14:54:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=EqlTfH7O; 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 4209B9C3636 for ; Wed, 29 Nov 2023 17:54:23 -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 L06U3lPaN_kd; Wed, 29 Nov 2023 17:54:22 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 88A719C341E; Wed, 29 Nov 2023 17:54:22 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 88A719C341E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701298462; bh=dvn3UAp0zH9504gmNCBCWZpEbo9JYr/dKpmCghmFYXw=; h=From:To:Date:Message-Id:MIME-Version; b=EqlTfH7O1VLNKrAs9D8jRyEhmBR5MawyJ1kHtRJUag/4vSsSLkjyoKEgxbRD626So LhPOhQU3h27SNnf31hNcBfREmzpPTKxeXJTGyG0svFGAAMRsXodq+w00qKSQDbMKUQ JqSe58Eslm5bHErQuDkHUoGFP3JNL7M4uc+Iasn8oqbuzSFnhm86AlnGw+IE6sMQIa 2zXqbm5Qdxr4JbzQ4YWkaZyubxa3vLflo5KuzQsLO0CSMi/4eH6BE463aqSWUAP3vX zSlOuYkzQxv9K4yfXs3mjxhxfPfBnNdnyUdKcmJSNjrhpJx1p2herbgTyX6+4gE15h zBCzz+CaPaiEg== 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 EcHFGJ4niFfD; Wed, 29 Nov 2023 17:54:22 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id EF4219C279F; Wed, 29 Nov 2023 17:54:21 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 4/9] toaster/test: Added Machine page TestCase Date: Wed, 29 Nov 2023 23:54:11 +0100 Message-Id: <20231129225416.479526-4-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129225416.479526-1-alassane.yattara@savoirfairelinux.com> References: <20231129225416.479526-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:54:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15583 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') From patchwork Wed Nov 29 22:54:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35394 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 A9DD5C46CA7 for ; Wed, 29 Nov 2023 22:54:28 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.57414.1701298464446691616 for ; Wed, 29 Nov 2023 14:54:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=bP6qjqnd; 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 CC4D09C3E05 for ; Wed, 29 Nov 2023 17:54:23 -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 V5X9Gny8ovpW; Wed, 29 Nov 2023 17:54:23 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 4E07C9C341E; Wed, 29 Nov 2023 17:54:23 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 4E07C9C341E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701298463; bh=DJjjmynIxSsqTWnVYlm6f+bQMdmPUpF+Kg4n0PZa8XI=; h=From:To:Date:Message-Id:MIME-Version; b=bP6qjqnd6jOFts54zS205N2hPIDrUozaqPaZHOeQKTdeI6NZfwFbY1ddRLhD6NI2x kinoi7hXzL/PYKFVAoe/bOK36G5uJ+2U1vWuHFJCe/VoVzCp9ZOZsxz1dRbCDCcC+n frUM67vyPKOXqQ+K3VIolyEH9ZvzasdHUZqgveqTyOJbU1WOTNRYWAhgvmlDhW3r02 8jIRV96jUY8Eid0qCwUNW9EJw0F+HvCeIofoeUJka5FjEI3SvhCadZ8/vTFAai44Qk w7IYEuc4FlmwKz2W95EI7JMlrovByXVAGfa6RSjdxO3Mw6SL2Rc4OUdFxgO2XBKU16 odqLAoOypzTow== 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 LMNfMVzvAB4f; Wed, 29 Nov 2023 17:54:23 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id B37539C3D7A; Wed, 29 Nov 2023 17:54:22 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 5/9] toaster/test: Added Layers page TestCase Date: Wed, 29 Nov 2023 23:54:12 +0100 Message-Id: <20231129225416.479526-5-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129225416.479526-1-alassane.yattara@savoirfairelinux.com> References: <20231129225416.479526-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:54:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15584 Test layers page - Check if title "Compatible layerss" is displayed - Check search input - Check "Add layer" button works - Check "Remove layer" button works - Check layers table feature(show/hide column, pagination) Signed-off-by: Alassane Yattara --- .../tests/functional/test_project_page.py | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/lib/toaster/tests/functional/test_project_page.py b/lib/toaster/tests/functional/test_project_page.py index 46a60c01..47dec1d9 100644 --- a/lib/toaster/tests/functional/test_project_page.py +++ b/lib/toaster/tests/functional/test_project_page.py @@ -572,3 +572,75 @@ class TestProjectPage(SeleniumFunctionalTestCase): self._navigate_to_config_nav('machinestable', 5) # check show rows(pagination) self._mixin_test_table_show_rows(table_selector='machinestable') + + def test_layers_page(self): + """ Test layers page + - Check if title "Compatible layerss" is displayed + - Check search input + - Check "Add layer" button works + - Check "Remove layer" button works + - Check layers table feature(show/hide column, pagination) + """ + self._navigate_to_config_nav('layerstable', 6) + # check title "Compatible layers" is displayed + self.assertTrue("Compatible layers" in self.get_page_source()) + # Test search input + input_text='meta-tanowrt' + self._mixin_test_table_search_input( + input_selector='search-input-layerstable', + input_text=input_text, + searchBtn_selector='search-submit-layerstable', + table_selector='layerstable' + ) + # check "Add layer" button works + rows = self.find_all('#layerstable tbody tr') + layer_to_add = rows[0] + add_btn = layer_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: {input_text} and its dependencies' in change_notification.text + ) + # check "Remove layer" button works + rows = self.find_all('#layerstable tbody tr') + layer_to_remove = rows[0] + remove_btn = layer_to_remove.find_element( + By.XPATH, + '//td[@class="add-del-layers"]' + ) + remove_btn.click() + self.wait_until_visible('#change-notification', poll=2) + change_notification = self.find('#change-notification') + self.assertTrue( + f'You have removed 1 layer from your project: {input_text}' in change_notification.text + ) + # check layers table feature(show/hide column, pagination) + self._navigate_to_config_nav('layerstable', 6) + column_list = [ + 'dependencies', + 'revision', + 'layer__vcs_url', + 'git_subdir', + 'layer__summary', + ] + self._mixin_test_table_edit_column( + 'layerstable', + 'edit-columns-button', + [f'checkbox-{column}' for column in column_list] + ) + self._navigate_to_config_nav('layerstable', 6) + # check show rows(pagination) + self._mixin_test_table_show_rows(table_selector='layerstable') From patchwork Wed Nov 29 22:54:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35386 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 777EAC10DC2 for ; Wed, 29 Nov 2023 22:54:28 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.57336.1701298465149356549 for ; Wed, 29 Nov 2023 14:54:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=lfgNhy32; 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 853F79C3DF2 for ; Wed, 29 Nov 2023 17:54:24 -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 t5AgbRQ4lB5W; Wed, 29 Nov 2023 17:54:24 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 17AD09C3D7A; Wed, 29 Nov 2023 17:54:24 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 17AD09C3D7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701298464; bh=UBHIQSeMCXE/g1/tLElVuwbXk2tZJpfRPygFGoBUXqA=; h=From:To:Date:Message-Id:MIME-Version; b=lfgNhy32qmx0PBhVWyh3Jqu83xy3D9YfpJwCODVFRqXlLKArVBCfwCtWN1wgyuwyl JefXwNjqavHC/0+GgOWsZgWO4QUFQhQuZmIdWaST8c72fO62naAOnRoa3BAPKEExw3 znJubwJbKoXO+RrSvpaEEwR6ZHHDtZyJfqIQmvhfg96Uwe9Xh/Tyh+0hoWkTQZQ/Bx Y50IEMN2PGKn8l9KL1jJ3j7Gc5wnfQWnez/due5SEwmk3+4FC4dvqqPonjY/tjw+SP lca8moNArmgWM9TwHJmE4mqAdHfRXArYPaOvQLNQ6p8yJr7SIO29HE8WVkqfmSsIiO kiJBFIF1fC6wA== 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 iywIfOGB8rFm; Wed, 29 Nov 2023 17:54:24 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 78CFB9C3679; Wed, 29 Nov 2023 17:54:23 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 6/9] toaster/test: Added distro page TestCase Date: Wed, 29 Nov 2023 23:54:13 +0100 Message-Id: <20231129225416.479526-6-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129225416.479526-1-alassane.yattara@savoirfairelinux.com> References: <20231129225416.479526-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:54:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15585 Test distros page - Check if title "Compatible distros" is displayed - Check search input - Check "Add layer" button works - Check distro table feature(show/hide column, pagination) Signed-off-by: Alassane Yattara --- .../tests/functional/test_project_page.py | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/lib/toaster/tests/functional/test_project_page.py b/lib/toaster/tests/functional/test_project_page.py index 47dec1d9..dd33e802 100644 --- a/lib/toaster/tests/functional/test_project_page.py +++ b/lib/toaster/tests/functional/test_project_page.py @@ -644,3 +644,54 @@ class TestProjectPage(SeleniumFunctionalTestCase): self._navigate_to_config_nav('layerstable', 6) # check show rows(pagination) self._mixin_test_table_show_rows(table_selector='layerstable') + + def test_distro_page(self): + """ Test distros page + - Check if title "Compatible distros" is displayed + - Check search input + - Check "Add layer" button works + - Check distro table feature(show/hide column, pagination) + """ + self._navigate_to_config_nav('distrostable', 7) + # check title "Compatible distros" is displayed + self.assertTrue("Compatible Distros" in self.get_page_source()) + # Test search input + input_text='poky-altcfg' + self._mixin_test_table_search_input( + input_selector='search-input-distrostable', + input_text=input_text, + searchBtn_selector='search-submit-distrostable', + table_selector='distrostable' + ) + # check "Add distro" button works + rows = self.find_all('#distrostable tbody tr') + distro_to_add = rows[0] + add_btn = distro_to_add.find_element( + By.XPATH, + '//td[@class="add-del-layers"]' + ) + add_btn.click() + self.wait_until_visible('#change-notification', poll=2) + change_notification = self.find('#change-notification') + self.assertTrue( + f'You have changed the distro to: {input_text}' in change_notification.text + ) + # check distro table feature(show/hide column, pagination) + self._navigate_to_config_nav('distrostable', 7) + column_list = [ + 'description', + 'templatefile', + 'layer_version__get_vcs_reference', + 'layer_version__layer__name', + ] + self._mixin_test_table_edit_column( + 'distrostable', + 'edit-columns-button', + [f'checkbox-{column}' for column in column_list] + ) + self._navigate_to_config_nav('distrostable', 7) + # check show rows(pagination) + self._mixin_test_table_show_rows( + table_selector='distrostable', + to_skip=[150] + ) From patchwork Wed Nov 29 22:54:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35390 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 7E3ACC10DC1 for ; Wed, 29 Nov 2023 22:54:28 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.57338.1701298466244705462 for ; Wed, 29 Nov 2023 14:54:26 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=cxPMZxdT; 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 9C6CF9C3E14 for ; Wed, 29 Nov 2023 17:54:25 -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 7Q7-wvcD0s06; Wed, 29 Nov 2023 17:54:24 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id D5E349C3E05; Wed, 29 Nov 2023 17:54:24 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com D5E349C3E05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701298464; bh=zT4lYxeiyQEUxoz7l3mIDhzcMMpqS0no0csLVWkMKzo=; h=From:To:Date:Message-Id:MIME-Version; b=cxPMZxdTaPaiBljJNV0f+Eyk+SSRhmoJYCh6IoanLNMf3AtlCs6q2MhTBiJEuc3PL rjfKx0dkHbY8iQbPjREtIpU6uFV0yOQKco1Rt1WYGYkXc73kZMcTP/2wfiNds3mfdF ThMCrH5SsLpQVhodQdXVLsqqJl3VgKjjT01UH8KvSMwmuVVwkbeYInFd8evs+hXjgj /fdrTBolqc9gPBAvhmq8pwRxmrLX3bMyC435v3bVYTHw5WVdEE+NXp4SCXNtEJJ23O VHH9PAfCqUwJrBdBMutqXKrTKJB0l9cR9zWKZaRmNvCOcwIdLtZ4hgitNbDeY5C4Uv nB13s71pMccow== 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 zVY_yM4nNCHc; Wed, 29 Nov 2023 17:54:24 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 3E1E39C3636; Wed, 29 Nov 2023 17:54:24 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 7/9] toaster/test: Bug-fix on tests/functional/test_project_page Date: Wed, 29 Nov 2023 23:54:14 +0100 Message-Id: <20231129225416.479526-7-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129225416.479526-1-alassane.yattara@savoirfairelinux.com> References: <20231129225416.479526-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:54:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15586 - Generate a random name for create project while test - Set timeout on method _wait_until_build - update test_machines_page, test_softwareRecipe_page and test_single_layer_page to fix exception "element not interactable" Signed-off-by: Alassane Yattara --- .../tests/functional/test_project_page.py | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/toaster/tests/functional/test_project_page.py b/lib/toaster/tests/functional/test_project_page.py index dd33e802..70829509 100644 --- a/lib/toaster/tests/functional/test_project_page.py +++ b/lib/toaster/tests/functional/test_project_page.py @@ -6,12 +6,15 @@ # SPDX-License-Identifier: GPL-2.0-only # +import random +import string import pytest from time import sleep from django.urls import reverse from django.utils import timezone +from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.select import Select -from selenium.common.exceptions import NoSuchElementException +from selenium.common.exceptions import NoSuchElementException, TimeoutException from tests.functional.functional_helpers import SeleniumFunctionalTestCase from orm.models import Build, Project, Target from selenium.webdriver.common.by import By @@ -23,13 +26,18 @@ class TestProjectPage(SeleniumFunctionalTestCase): def setUp(self): super().setUp() release = '3' - project_name = 'projectmaster' + project_name = 'project_' + self.generate_random_string() self._create_test_new_project( project_name, release, False, ) + def generate_random_string(self, length=10): + characters = string.ascii_letters + string.digits # alphabetic and numerical characters + random_string = ''.join(random.choice(characters) for _ in range(length)) + return random_string + def _create_test_new_project( self, project_name, @@ -204,7 +212,13 @@ class TestProjectPage(SeleniumFunctionalTestCase): test_show_rows(row_to_show, show_row_link) def _wait_until_build(self, state): + timeout = 10 + start_time = 0 while True: + if start_time > timeout: + raise TimeoutException( + f'Build did not reach {state} state within {timeout} seconds' + ) try: last_build_state = self.driver.find_element( By.XPATH, @@ -217,7 +231,8 @@ class TestProjectPage(SeleniumFunctionalTestCase): break except NoSuchElementException: continue - sleep(1) + start_time += 1 + sleep(1) # take a breath and try again def _mixin_test_table_search_input(self, **kwargs): input_selector, input_text, searchBtn_selector, table_selector, *_ = kwargs.values() @@ -380,11 +395,9 @@ class TestProjectPage(SeleniumFunctionalTestCase): self.wait_until_visible('#topbar-configuration-tab') config_tab = self.find('#topbar-configuration-tab') self.assertTrue(config_tab.get_attribute('class') == 'active') - self.assertTrue('Configuration' in config_tab.text) - config_tab_link = config_tab.find_element(By.TAG_NAME, 'a') + self.assertTrue('Configuration' in str(config_tab.text)) self.assertTrue( - f"/toastergui/project/1" in str(config_tab_link.get_attribute( - 'href')) + f"/toastergui/project/1" in str(self.driver.current_url) ) def get_tabs(): @@ -464,10 +477,10 @@ class TestProjectPage(SeleniumFunctionalTestCase): image_to_build = rows[0] build_btn = image_to_build.find_element( By.XPATH, - '//td[@class="add-del-layers"]' + '//td[@class="add-del-layers"]//a[1]' ) build_btn.click() - self._wait_until_build('parsing starting cloning') + self._wait_until_build('parsing starting cloning queued') lastest_builds = self.driver.find_elements( By.XPATH, '//div[@id="latest-builds"]/div' @@ -517,9 +530,9 @@ class TestProjectPage(SeleniumFunctionalTestCase): machine_to_select = rows[0] select_btn = machine_to_select.find_element( By.XPATH, - '//td[@class="add-del-layers"]' + '//td[@class="add-del-layers"]//a[1]' ) - select_btn.click() + select_btn.send_keys(Keys.RETURN) self.wait_until_visible('#config-nav') project_machine_name = self.find('#project-machine-name') self.assertTrue( @@ -530,32 +543,19 @@ class TestProjectPage(SeleniumFunctionalTestCase): # 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', + input_text='qemux86-64-tpm2', 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 = 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 + f'You have added 1 layer to your project' in str(change_notification.text) ) - # check Machine table feature(show/hide column, pagination) self._navigate_to_config_nav('machinestable', 5) column_list = [ @@ -601,7 +601,7 @@ class TestProjectPage(SeleniumFunctionalTestCase): ) add_btn.click() # check modal is displayed - self.wait_until_visible('#dependencies-modal') + self.wait_until_visible('#dependencies-modal', poll=2) list_dependencies = self.find_all('#dependencies-list li') # click on add-layers button add_layers_btn = self.driver.find_element( @@ -612,7 +612,7 @@ class TestProjectPage(SeleniumFunctionalTestCase): 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: {input_text} and its dependencies' in change_notification.text + f'You have added {len(list_dependencies)+1} layers to your project: {input_text} and its dependencies' in str(change_notification.text) ) # check "Remove layer" button works rows = self.find_all('#layerstable tbody tr') @@ -625,7 +625,7 @@ class TestProjectPage(SeleniumFunctionalTestCase): self.wait_until_visible('#change-notification', poll=2) change_notification = self.find('#change-notification') self.assertTrue( - f'You have removed 1 layer from your project: {input_text}' in change_notification.text + f'You have removed 1 layer from your project: {input_text}' in str(change_notification.text) ) # check layers table feature(show/hide column, pagination) self._navigate_to_config_nav('layerstable', 6) @@ -668,13 +668,13 @@ class TestProjectPage(SeleniumFunctionalTestCase): distro_to_add = rows[0] add_btn = distro_to_add.find_element( By.XPATH, - '//td[@class="add-del-layers"]' + '//td[@class="add-del-layers"]//a[1]' ) add_btn.click() self.wait_until_visible('#change-notification', poll=2) change_notification = self.find('#change-notification') self.assertTrue( - f'You have changed the distro to: {input_text}' in change_notification.text + f'You have changed the distro to: {input_text}' in str(change_notification.text) ) # check distro table feature(show/hide column, pagination) self._navigate_to_config_nav('distrostable', 7) From patchwork Wed Nov 29 22:54:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35389 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 82EF9C46CA0 for ; Wed, 29 Nov 2023 22:54:28 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.57339.1701298467176113134 for ; Wed, 29 Nov 2023 14:54:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=S8af2QFV; 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 8656E9C3E05 for ; Wed, 29 Nov 2023 17:54:26 -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 WR-XCF4C6zFy; Wed, 29 Nov 2023 17:54:26 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 066509C3679; Wed, 29 Nov 2023 17:54:26 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 066509C3679 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701298466; bh=azODbgQMA7T+CLSjhOhu5ZDmq3KKgjjsOx4WWniW9GI=; h=From:To:Date:Message-Id:MIME-Version; b=S8af2QFVeAnvLbeHSfCjhr9JE5RryGeCyIPY0YJnqlB3xz9iaqrjO08nBsegN4rHa rE8iHA+MGxQoLgqVIj1Q4FVnhKCh43QszsOCXPljKQv2w4KlnA9B4Qt5iK+1gg6lCc sLr2L7vrOoWdn9caVLVm1SvIuPMiDHweWsOcInsxVjLXfpNDlQxNH1QABo62NocwMn T/zdS1harKYkOVZIrPqpANvkH8OEmEU4qOadMVSdnrcF3+MtPUOdFqh7EN0SLIuWIb bteSQx4SJJZ/safySzdxaMeBSgE0nw0nIaKevq2o22bm3E2xCKEllrd53FOKz/Zs0r UN+dtJS5teXKA== 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 SKywybqWQfpo; Wed, 29 Nov 2023 17:54:25 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 236049C3636; Wed, 29 Nov 2023 17:54:25 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 8/9] toaster/test: Test single layer page Date: Wed, 29 Nov 2023 23:54:15 +0100 Message-Id: <20231129225416.479526-8-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129225416.479526-1-alassane.yattara@savoirfairelinux.com> References: <20231129225416.479526-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:54:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15587 Test layer page - Check if title is displayed - Check add/remove layer button works - Check tabs(layers, recipes, machines) are displayed - Check left section is displayed - Check layer name - Check layer summary - Check layer description Signed-off-by: Alassane Yattara --- .../tests/functional/test_project_page.py | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/lib/toaster/tests/functional/test_project_page.py b/lib/toaster/tests/functional/test_project_page.py index 70829509..771a8484 100644 --- a/lib/toaster/tests/functional/test_project_page.py +++ b/lib/toaster/tests/functional/test_project_page.py @@ -695,3 +695,64 @@ class TestProjectPage(SeleniumFunctionalTestCase): table_selector='distrostable', to_skip=[150] ) + + def test_single_layer_page(self): + """ Test layer page + - Check if title is displayed + - Check add/remove layer button works + - Check tabs(layers, recipes, machines) are displayed + - Check left section is displayed + - Check layer name + - Check layer summary + - Check layer description + """ + url = reverse("layerdetails", args=(1, 8)) + self.get(url) + self.wait_until_visible('.page-header') + # check title is displayed + self.assertTrue(self.find('.page-header h1').is_displayed()) + + # check add layer button works + remove_layer_btn = self.find('#add-remove-layer-btn') + remove_layer_btn.click() + self.wait_until_visible('#change-notification', poll=2) + change_notification = self.find('#change-notification') + self.assertTrue( + f'You have removed 1 layer from your project' in str(change_notification.text) + ) + # check add layer button works, 18 is the random layer id + add_layer_btn = self.find('#add-remove-layer-btn') + add_layer_btn.click() + self.wait_until_visible('#change-notification') + change_notification = self.find('#change-notification') + self.assertTrue( + f'You have added 1 layer to your project' in str(change_notification.text) + ) + # check tabs(layers, recipes, machines) are displayed + tabs = self.find_all('.nav-tabs li') + self.assertEqual(len(tabs), 3) + # Check first tab + tabs[0].click() + self.assertTrue( + 'active' in str(self.find('#information').get_attribute('class')) + ) + # Check second tab + tabs[1].click() + self.assertTrue( + 'active' in str(self.find('#recipes').get_attribute('class')) + ) + # Check third tab + tabs[2].click() + self.assertTrue( + 'active' in str(self.find('#machines').get_attribute('class')) + ) + # Check left section is displayed + section = self.find('.well') + # Check layer name + self.assertTrue( + section.find_element(By.XPATH, '//h2[1]').is_displayed() + ) + # Check layer summary + self.assertTrue("Summary" in section.text) + # Check layer description + self.assertTrue("Description" in section.text) From patchwork Wed Nov 29 22:54:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 35388 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 8FED4C10DC3 for ; Wed, 29 Nov 2023 22:54:28 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.57340.1701298468005815594 for ; Wed, 29 Nov 2023 14:54:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=MFww/2kP; 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 5F9A09C3E61 for ; Wed, 29 Nov 2023 17:54: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 aoxi85GIkm8w; Wed, 29 Nov 2023 17:54:27 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id DEFF39C341E; Wed, 29 Nov 2023 17:54:26 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com DEFF39C341E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701298466; bh=+FWHRGyIGd5wGD4I1oE4xlErYk2U+QkS1w8AFgI2OPQ=; h=From:To:Date:Message-Id:MIME-Version; b=MFww/2kPQjlrVhvJuY4ExFa8eZ621jeu+/rfxwMsa/VZcsYMO+UjoHRDL1uihR+w2 x9TlmxTw15LzmPRQzVP583uEh6H5PenvaWGhPrW68i7FiUaCYq690DU0BLiZqhXjU4 Ikv64qvM9pnCLxr3pu1+t88qhjRFDYbzQD1w+2xAguPKoG2Jg2SceTRzJMXIrZGTie jI0KXciXVwHfiBp/xz2dRHl2rmz4ULvOulRBl6IlCzI3S1pbVRznYJKNYz/5pcz4mN ph+pVqZQ96vN31lDcHdFgg/ZYJZRyJybuU0+v1ihiWH16J6Yn94cTf13kEQIsMpXTu l3cUn8VddoSEA== 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 kgui4KqTQmbi; Wed, 29 Nov 2023 17:54:26 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 426DF9C3636; Wed, 29 Nov 2023 17:54:26 -0500 (EST) From: Alassane Yattara To: bitbake-devel@lists.openembedded.org Cc: Alassane Yattara Subject: [PATCH 9/9] toaster/test: Test single recipe page Date: Wed, 29 Nov 2023 23:54:16 +0100 Message-Id: <20231129225416.479526-9-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129225416.479526-1-alassane.yattara@savoirfairelinux.com> References: <20231129225416.479526-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:54:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15588 Test recipe page - Check if title is displayed - Check add recipe layer displayed - Check left section is displayed - Check recipe: name, summary, description, Version, Section, License, Approx. packages included, Approx. size, Recipe file Signed-off-by: Alassane Yattara --- .../tests/functional/test_project_page.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/toaster/tests/functional/test_project_page.py b/lib/toaster/tests/functional/test_project_page.py index 771a8484..03f64f8f 100644 --- a/lib/toaster/tests/functional/test_project_page.py +++ b/lib/toaster/tests/functional/test_project_page.py @@ -756,3 +756,35 @@ class TestProjectPage(SeleniumFunctionalTestCase): self.assertTrue("Summary" in section.text) # Check layer description self.assertTrue("Description" in section.text) + + def test_single_recipe_page(self): + """ Test recipe page + - Check if title is displayed + - Check add recipe layer displayed + - Check left section is displayed + - Check recipe: name, summary, description, Version, Section, + License, Approx. packages included, Approx. size, Recipe file + """ + url = reverse("recipedetails", args=(1, 53428)) + self.get(url) + self.wait_until_visible('.page-header') + # check title is displayed + self.assertTrue(self.find('.page-header h1').is_displayed()) + # check add recipe layer displayed + add_recipe_layer_btn = self.find('#add-layer-btn') + self.assertTrue(add_recipe_layer_btn.is_displayed()) + # check left section is displayed + section = self.find('.well') + # Check recipe name + self.assertTrue( + section.find_element(By.XPATH, '//h2[1]').is_displayed() + ) + # Check recipe sections details info are displayed + self.assertTrue("Summary" in section.text) + self.assertTrue("Description" in section.text) + self.assertTrue("Version" in section.text) + self.assertTrue("Section" in section.text) + self.assertTrue("License" in section.text) + self.assertTrue("Approx. packages included" in section.text) + self.assertTrue("Approx. package size" in section.text) + self.assertTrue("Recipe file" in section.text)