From patchwork Wed Oct 9 17:25:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 50172 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 1CA2BCEE333 for ; Wed, 9 Oct 2024 17:25:13 +0000 (UTC) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.groups.io with SMTP id smtpd.web10.22901.1728494711988954243 for ; Wed, 09 Oct 2024 10:25:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=KshEEzyG; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.48, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-430ee5c9570so64565e9.3 for ; Wed, 09 Oct 2024 10:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1728494710; x=1729099510; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=4H71FBESL0OMq3treR52HpgMiiQLpeZwmFrLZY0YOYw=; b=KshEEzyGkdKbM0M/496EkVW94MtdmXvWFbAEJWPhmMD3SQdRM+aQIRHT7p6b8/0YbN mE4pqN8YaJDye8ffB2CxUyygJWhldqOGYf1US9Y/8Pir1VdAvRXZVKPMb4xdBzXxbyxi wv+XXuY+D2S1us+5b+60RpZ7mjhErlLUJoVE4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728494710; x=1729099510; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4H71FBESL0OMq3treR52HpgMiiQLpeZwmFrLZY0YOYw=; b=eEKZgkrYH91HNq9MjUmN7fhMUx3PNiWv9GtWtUpRFZCgjO8n5vXiRH0cyriI0JQPhj Ex/30uIszncEqmOXrS293z7pqGJF8PXXUeLIrDAoICFx7QEWfKTiijZZst/8UnjwLPsK EhiPm3ECWbU+sOkDuE0wAjxiFKoH4+HnfJCoYrSB+itIPR8M1NAxuzNQGIhQNajADe5i o+/ThMOiBSWke3EtjKvgoUDkem2s1HjlOGpm0IQB7ItzUSQJAn1zLejNuTu6CQ7d909v Tqe/9zHpwtqlgocitaqJv23VhBHwIYdy6J12SIKLc1+4TZn4Ly22lybggZ0j6+pKsgCM dXmw== X-Gm-Message-State: AOJu0YwyfGnzjSstjJWJ7DDrkM1+QmYWQ2kisGfxH+5MHNzIWKj2JBkL nYsTgPUy3168IHd3N4zRwzuk4xUJ2A8RkepD1cr/KsDZd1nF8EIPd4qLFAg/pjCEO621jAKC6nI v X-Google-Smtp-Source: AGHT+IF8j6TY67u/aSyfsjPIFSFGYO0uugoZtAtxtWKlo/oZd6C7kdvzjRhoWmaFHWyAPowkVJVfjA== X-Received: by 2002:a05:600c:4f14:b0:430:9fde:3b92 with SMTP id 5b1f17b1804b1-430ccf312c9mr37928945e9.14.1728494709844; Wed, 09 Oct 2024 10:25:09 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:fb33:4e5d:4941:5018]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d3f568fd7sm1761267f8f.102.2024.10.09.10.25.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 10:25:09 -0700 (PDT) From: Richard Purdie To: bitbake-devel@lists.openembedded.org Subject: [PATCH 1/3] toaster/tests/functional: Fix later details page test issues Date: Wed, 9 Oct 2024 18:25:06 +0100 Message-ID: <20241009172508.447620-1-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 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, 09 Oct 2024 17:25:13 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/16664 Consistently use meta-poky as the test target, instead of a magic number ID which can vary. Fix incorrect comments. Also ensure the viewport is scrolled to the top when changing tabs. This breaks if other layers are selected like openembedded-core due to the number of recipes. Signed-off-by: Richard Purdie --- .../tests/functional/test_project_page.py | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/toaster/tests/functional/test_project_page.py b/lib/toaster/tests/functional/test_project_page.py index deb26812ea..6b6d45eaba 100644 --- a/lib/toaster/tests/functional/test_project_page.py +++ b/lib/toaster/tests/functional/test_project_page.py @@ -699,7 +699,7 @@ class TestProjectPage(SeleniumFunctionalTestCase): ) def test_single_layer_page(self): - """ Test layer page + """ Test layer details page using meta-poky as an example (assumes is added to start with) - Check if title is displayed - Check add/remove layer button works - Check tabs(layers, recipes, machines) are displayed @@ -708,13 +708,14 @@ class TestProjectPage(SeleniumFunctionalTestCase): - Check layer summary - Check layer description """ - url = reverse("layerdetails", args=(TestProjectPage.project_id, 7)) - self.get(url) + self._navigate_to_config_nav('layerstable', 6) + layer_link = self.driver.find_element(By.XPATH, '//tr/td[@class="layer__name"]/a[contains(text(),"meta-poky")]') + layer_link.click() self.wait_until_visible('.page-header') # check title is displayed self.assertTrue(self.find('.page-header h1').is_displayed()) - # check add layer button works + # check remove layer button works remove_layer_btn = self.find('#add-remove-layer-btn') remove_layer_btn.click() self.wait_until_visible('#change-notification', poll=2) @@ -722,7 +723,7 @@ class TestProjectPage(SeleniumFunctionalTestCase): self.assertIn( f'You have removed 1 layer from your project', str(change_notification.text) ) - # check add layer button works, 18 is the random layer id + # check add layer button works add_layer_btn = self.find('#add-remove-layer-btn') add_layer_btn.click() self.wait_until_visible('#change-notification') @@ -738,12 +739,18 @@ class TestProjectPage(SeleniumFunctionalTestCase): self.assertTrue( 'active' in str(self.find('#information').get_attribute('class')) ) - # Check second tab + # Check second tab (recipes) + # Ensure page is scrolled to the top + self.driver.find_element(By.XPATH, '//body').send_keys(Keys.CONTROL + Keys.HOME) + self.wait_until_visible('.nav-tabs') tabs[1].click() self.assertTrue( 'active' in str(self.find('#recipes').get_attribute('class')) ) - # Check third tab + # Check third tab (machines) + # Ensure page is scrolled to the top + self.driver.find_element(By.XPATH, '//body').send_keys(Keys.CONTROL + Keys.HOME) + self.wait_until_visible('.nav-tabs') tabs[2].click() self.assertTrue( 'active' in str(self.find('#machines').get_attribute('class')) From patchwork Wed Oct 9 17:25:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 50174 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 EC81FCEE330 for ; Wed, 9 Oct 2024 17:25:22 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.groups.io with SMTP id smtpd.web10.22902.1728494713369201941 for ; Wed, 09 Oct 2024 10:25:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=DwD1OZK0; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.47, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-42cae4eb026so288365e9.0 for ; Wed, 09 Oct 2024 10:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1728494711; x=1729099511; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=yaeAN1MgQnV5n5F7wKIfKjQT8vw9aVoClb7CSRdh2BQ=; b=DwD1OZK0CUzSjKgtkGaC2TDFDHm2ltf8AqvalYt+wJDKnRM01P+x7kmsbWka5AVR+B Rubu5F1ngelBW3G/ti7NVFfsADIWGHQvE8nAbVafbC9ntsGxoRFDNRIbCe66Uzpv1Se7 1RGkrSf+ChXTv4voYSPgHJ6xRrXw5lngH9F8A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728494711; x=1729099511; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yaeAN1MgQnV5n5F7wKIfKjQT8vw9aVoClb7CSRdh2BQ=; b=Og9XVAM8HmKGQG4EIGGTZHDn43ZQQYNuSAeQCG1qtE5fcaQJ9kt1zQ8YFVNKPd4u9+ gE+FfLAT3oCSWnsRXO5eZTdzfmkGBUmNeTQgVuo10TrtDYNeLowp37nKA1WEP2g7oAxW rc7h3A8VHQsp4t2Nx6ZAoCdvT3OeU8hKWCskf6NMqSXG/DegtVEKEb8eAK01916b0B2Y S1TRO+dO/YS0XKlc3ogBWx0V08F5lW1eBB+vnbuRQ0pyHZpsn2fEcAl8YUUox42XXbpD 0mQGNekh9liLyVi+N+oF+ljHJi7bmWIwUTsXIDYWp7W58Lhc2waRxqtjPy1dZ4pk572L BMmg== X-Gm-Message-State: AOJu0YzPcAcIKlaFzNO89RfssTC5CMf69rwtKchYV81crDYc8CWV6fC5 7uvFSbb8PkYyyfJqD/F6Jc4DcfoMrxyu11cZuCRsPaRig/MvmZ3Yd7Z4ChqDK09QeBlwOhl8ffF 8 X-Google-Smtp-Source: AGHT+IHCAVAwKZe4M9KK7j3otF04fLoAnib2X7KZqEpBEln7n9E+eDZMA1t/bD6UkWUDyFsaYaYOkQ== X-Received: by 2002:a05:600c:5117:b0:430:4db0:401d with SMTP id 5b1f17b1804b1-430ccf434b7mr24263585e9.18.1728494711403; Wed, 09 Oct 2024 10:25:11 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:fb33:4e5d:4941:5018]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d3f568fd7sm1761267f8f.102.2024.10.09.10.25.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 10:25:11 -0700 (PDT) From: Richard Purdie To: bitbake-devel@lists.openembedded.org Subject: [PATCH 2/3] toaster/tests/functional: Fix hardcoded database ID Date: Wed, 9 Oct 2024 18:25:07 +0100 Message-ID: <20241009172508.447620-2-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241009172508.447620-1-richard.purdie@linuxfoundation.org> References: <20241009172508.447620-1-richard.purdie@linuxfoundation.org> 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, 09 Oct 2024 17:25:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/16665 Using a hardcoded database ID for a recipe is a bad idea and causes tests to fail when we change data/versions. Remove magic numbers. Signed-off-by: Richard Purdie --- lib/toaster/tests/functional/test_project_page.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/toaster/tests/functional/test_project_page.py b/lib/toaster/tests/functional/test_project_page.py index 6b6d45eaba..8b34658418 100644 --- a/lib/toaster/tests/functional/test_project_page.py +++ b/lib/toaster/tests/functional/test_project_page.py @@ -774,7 +774,12 @@ class TestProjectPage(SeleniumFunctionalTestCase): - Check recipe: name, summary, description, Version, Section, License, Approx. packages included, Approx. size, Recipe file """ - url = reverse("recipedetails", args=(TestProjectPage.project_id, 53428)) + # Use a recipe which is likely to exist in the layer index but not enabled + # in poky out the box - xen-image-minimal from meta-virtualization + self._navigate_to_project_page() + prj = Project.objects.get(pk=TestProjectPage.project_id) + recipe_id = prj.get_all_compatible_recipes().get(name="xen-image-minimal").pk + url = reverse("recipedetails", args=(TestProjectPage.project_id, recipe_id)) self.get(url) self.wait_until_visible('.page-header') # check title is displayed From patchwork Wed Oct 9 17:25:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 50173 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 EB24CCEE336 for ; Wed, 9 Oct 2024 17:25:22 +0000 (UTC) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.groups.io with SMTP id smtpd.web10.22903.1728494713960896750 for ; Wed, 09 Oct 2024 10:25:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Mn/M6gBo; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.44, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-42cb57f8b41so308025e9.0 for ; Wed, 09 Oct 2024 10:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1728494712; x=1729099512; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=G98zfSEKSMScD3RxO2+QhPxjQkXzmDHbXA3dc163vjs=; b=Mn/M6gBoEqs4yCiCCzsndnNcINAk5DzD3xoWhwrt6UmM5CoY6LLknZsnbkysNkkqL5 vB19+OBdvlsWJc4vZs3Ofj6W1wNvzrAY3cs4iqDu5fQGVVPNC+CIsbxQE5dOb6y2KqiL TX1BCQwggMMXDTO3Aeee3G5etL8HpieGj6l+k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728494712; x=1729099512; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G98zfSEKSMScD3RxO2+QhPxjQkXzmDHbXA3dc163vjs=; b=J7CLPod3atTZ+myerZA8n9FC7Op+ecUdeUt6bAe5M8uqF5oILji840USFf0oJ1uNdm 2HDApyb6e+UDQJ8DmSoMer+ILR+8Mape6ePxs3ZrL6uEdJzOw5gyjj78HG6RvwJooxag ZnKtzfCCOBU1x+YSjxHezqhHLMH9ksGSaRZffNc0Q8EG0A/8S25ZsgoTzX5amVLqTFr5 X08qNLQfcO0zlzihRL33h1aMzG7c4TKDQDfrzL55vEAsc8LJdJVDeqy+VRjEpmiY196J 1/WJBmqIFQbSrwJKu2eJgFuN38orxUxblHx/9HQyqxsy3zKVrlH7tUnCA0FTt4BUIyYO 86lQ== X-Gm-Message-State: AOJu0Yy9w5oT2s/geuWYe1vwq31xxRHG/akQoVrY29YC0n8fSp/g+1F5 pcYRf1lct9OFzl6qPix4hF+E3dtr+NBUu6T1XZJ1bKnc8CyEqq3xLYcDivIL8QPIzUunl2XS7gt 8 X-Google-Smtp-Source: AGHT+IHrnWLV6E+iMlIO3iTyoZj98ssceoFvHUWAC6xALbSAKNpDx74fFldQllVLSz89itXNkSTp4g== X-Received: by 2002:a05:600c:354f:b0:42e:94ff:7ac with SMTP id 5b1f17b1804b1-430ccf517d8mr34116975e9.21.1728494712060; Wed, 09 Oct 2024 10:25:12 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:fb33:4e5d:4941:5018]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d3f568fd7sm1761267f8f.102.2024.10.09.10.25.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 10:25:11 -0700 (PDT) From: Richard Purdie To: bitbake-devel@lists.openembedded.org Subject: [PATCH 3/3] toaster/tests/functional: Fix test race on alert Date: Wed, 9 Oct 2024 18:25:08 +0100 Message-ID: <20241009172508.447620-3-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241009172508.447620-1-richard.purdie@linuxfoundation.org> References: <20241009172508.447620-1-richard.purdie@linuxfoundation.org> 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, 09 Oct 2024 17:25:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/16666 THe test fails on faster systems as we need to wait. Fix that and a typo. Signed-off-by: Richard Purdie --- lib/toaster/tests/functional/test_create_new_project.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/toaster/tests/functional/test_create_new_project.py b/lib/toaster/tests/functional/test_create_new_project.py index c3b5679514..f7d17847ae 100644 --- a/lib/toaster/tests/functional/test_create_new_project.py +++ b/lib/toaster/tests/functional/test_create_new_project.py @@ -172,8 +172,10 @@ class TestCreateNewProject(SeleniumFunctionalTestCase): "import-project-dir").send_keys(wrong_path) self.driver.find_element(By.ID, "create-project-button").click() + self.wait_until_visible('.alert-danger') + # check error message self.assertTrue(self.element_exists('.alert-danger'), - 'Allert message not shown') + 'Alert message not shown') self.assertTrue(wrong_path in self.find('.alert-danger').text, "Wrong path not in alert message")