From patchwork Mon Dec 18 21:37:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 36587 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 54D7BC46CA2 for ; Mon, 18 Dec 2023 21:39:43 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.3022.1702935580690891232 for ; Mon, 18 Dec 2023 13:39:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=h8Vimblm; 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 67CD69C33AF for ; Mon, 18 Dec 2023 16:39:39 -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 wGyCODTxSpOP; Mon, 18 Dec 2023 16:39:38 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 677309C354C; Mon, 18 Dec 2023 16:39:38 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 677309C354C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1702935578; bh=AopWfjuf8sYkTQnoMB94O2L59Tmn0BqezqPO76GJecA=; h=From:To:Date:Message-Id:MIME-Version; b=h8VimblmJlswIw8PAscGU8FX1JcE9WU0KUoAlmvhoPyb3hDvIgucUrzY+gH5HlGI+ HHYidtv1b0bSMhIOfLAmwUvXsD7MkVzH/njUqx3kVnYBwucwVQZilXGnD5DSk0vb9+ hmdSYJA07VVreUBJXzVK5pSgdPqMj32kZhrZeZKeXVQZm7fEhTpGBtxUXjHkUNG509 ZJ8tvSXrjsUo8MjUx4AXitWUQP6tTmAuuiL+IjWPZZ4ziuv5OUxRYBl4WSxaRRmuZY j0NUhRNnn52tlmsVlLBblh28CbGl/SmZnGxzUaMZdT5v36dWOTDxS1Ni70R6oV8NTN JXlKvvrGwdJTw== 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 GjkGHX4SjLip; Mon, 18 Dec 2023 16:39:38 -0500 (EST) Received: from jedi.. (unknown [105.66.132.133]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id D9AA89C33AF; Mon, 18 Dec 2023 16:38:35 -0500 (EST) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH] toaster/test: Bug-fix test_functional_basic, delay driver actions Date: Mon, 18 Dec 2023 22:37:51 +0100 Message-Id: <20231218213751.612402-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 ; Mon, 18 Dec 2023 21:39:43 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/6118 The errors causing faileds on functional_basic are dû to the delay between actions, increase between driver actions. Signed-off-by: Alassane Yattara --- .../tests/functional/test_functional_basic.py | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/lib/toaster/tests/functional/test_functional_basic.py b/lib/toaster/tests/functional/test_functional_basic.py index e48f13b0..47f7452e 100644 --- a/lib/toaster/tests/functional/test_functional_basic.py +++ b/lib/toaster/tests/functional/test_functional_basic.py @@ -7,7 +7,7 @@ # SPDX-License-Identifier: GPL-2.0-only # -import re, time +import re from django.urls import reverse import pytest from tests.functional.functional_helpers import SeleniumFunctionalTestCase @@ -26,7 +26,7 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase): self.driver.find_element(By.ID, "new-project-name").send_keys(project_name) self.driver.find_element(By.ID, 'projectversion').click() self.driver.find_element(By.ID, "create-project-button").click() - element = self.wait_until_visible('#project-created-notification') + element = self.wait_until_visible('#project-created-notification', poll=10) self.assertTrue(self.element_exists('#project-created-notification'),'Project creation notification not shown') self.assertTrue(project_name in element.text, "New project name not in new project notification") @@ -36,52 +36,52 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase): # testcase (1515) def test_verify_left_bar_menu(self): self.get(reverse('all-projects')) - self.wait_until_visible('#projectstable') + self.wait_until_visible('#projectstable', poll=10) self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) self.assertTrue(self.element_exists('#config-nav'),'Configuration Tab does not exist') project_URL=self.get_URL() self.driver.find_element(By.XPATH, '//a[@href="'+project_URL+'"]').click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) try: self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'customimages/"'+"]").click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) self.assertTrue(re.search("Custom images",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'Custom images information is not loading properly') except: self.fail(msg='No Custom images tab available') try: self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'images/"'+"]").click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) self.assertTrue(re.search("Compatible image recipes",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Compatible image recipes information is not loading properly') except: self.fail(msg='No Compatible image tab available') try: self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'softwarerecipes/"'+"]").click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) self.assertTrue(re.search("Compatible software recipes",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Compatible software recipe information is not loading properly') except: self.fail(msg='No Compatible software recipe tab available') try: self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'machines/"'+"]").click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) self.assertTrue(re.search("Compatible machines",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Compatible machine information is not loading properly') except: self.fail(msg='No Compatible machines tab available') try: self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'layers/"'+"]").click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) self.assertTrue(re.search("Compatible layers",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Compatible layer information is not loading properly') except: self.fail(msg='No Compatible layers tab available') try: self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'configuration"'+"]").click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) self.assertTrue(re.search("Bitbake variables",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Bitbake variables information is not loading properly') except: self.fail(msg='No Bitbake variables tab available') @@ -89,18 +89,18 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase): # testcase (1516) def test_review_configuration_information(self): self.get('') - self.wait_until_visible('#global-nav') + self.wait_until_visible('#global-nav', poll=10) self.driver.find_element(By.XPATH, "//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click() - self.wait_until_visible('#projectstable') + self.wait_until_visible('#projectstable', poll=10) self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() project_URL=self.get_URL() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) try: self.assertTrue(self.element_exists('#machine-section'),'Machine section for the project configuration page does not exist') self.assertTrue(re.search("qemux86-64",self.driver.find_element(By.XPATH, "//span[@id='project-machine-name']").text),'The machine type is not assigned') self.driver.find_element(By.XPATH, "//span[@id='change-machine-toggle']").click() - self.wait_until_visible('#select-machine-form') - self.wait_until_visible('#cancel-machine-change') + self.wait_until_visible('#select-machine-form', poll=10) + self.wait_until_visible('#cancel-machine-change', poll=10) self.driver.find_element(By.XPATH, "//form[@id='select-machine-form']/a[@id='cancel-machine-change']").click() except: self.fail(msg='The machine information is wrong in the configuration page') @@ -135,18 +135,18 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase): # testcase (1517) def test_verify_machine_information(self): self.get('') - self.wait_until_visible('#global-nav') + self.wait_until_visible('#global-nav', poll=10) self.driver.find_element(By.XPATH, "//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click() - self.wait_until_visible('#projectstable') + self.wait_until_visible('#projectstable', poll=10) self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) try: self.assertTrue(self.element_exists('#machine-section'),'Machine section for the project configuration page does not exist') self.assertTrue(re.search("qemux86-64",self.driver.find_element(By.ID, "project-machine-name").text),'The machine type is not assigned') self.driver.find_element(By.ID, "change-machine-toggle").click() - self.wait_until_visible('#select-machine-form') - self.wait_until_visible('#cancel-machine-change') + self.wait_until_visible('#select-machine-form', poll=10) + self.wait_until_visible('#cancel-machine-change', poll=10) self.driver.find_element(By.ID, "cancel-machine-change").click() except: self.fail(msg='The machine information is wrong in the configuration page') @@ -154,16 +154,16 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase): # testcase (1518) def test_verify_most_built_recipes_information(self): self.get('') - self.wait_until_visible('#global-nav') + self.wait_until_visible('#global-nav', poll=10) self.driver.find_element(By.XPATH, "//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click() - self.wait_until_visible('#projectstable') + self.wait_until_visible('#projectstable', poll=10) self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) project_URL=self.get_URL() try: self.assertTrue(re.search("You haven't built any recipes yet",self.driver.find_element(By.ID, "no-most-built").text),'Default message of no builds is not present') self.driver.find_element(By.XPATH, "//div[@id='no-most-built']/p/a[@href="+'"'+project_URL+'images/"'+"]").click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) self.assertTrue(re.search("Compatible image recipes",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Choose a recipe to build link is not working properly') except: self.fail(msg='No Most built information in project detail page') @@ -171,11 +171,11 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase): # testcase (1519) def test_verify_project_release_information(self): self.get('') - self.wait_until_visible('#global-nav') + self.wait_until_visible('#global-nav', poll=10) self.driver.find_element(By.XPATH, "//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click() - self.wait_until_visible('#projectstable') + self.wait_until_visible('#projectstable', poll=10) self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) try: self.assertTrue(re.search("Yocto Project master",self.driver.find_element(By.ID, "project-release-title").text),'The project release is not defined') @@ -185,11 +185,11 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase): # testcase (1520) def test_verify_layer_information(self): self.get('') - self.wait_until_visible('#global-nav') + self.wait_until_visible('#global-nav', poll=10) self.driver.find_element(By.XPATH, "//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click() - self.wait_until_visible('#projectstable') + self.wait_until_visible('#projectstable', poll=10) self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) project_URL=self.get_URL() try: self.driver.find_element(By.XPATH, "//div[@id='layer-container']") @@ -217,19 +217,19 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase): # testcase (1521) def test_verify_project_detail_links(self): self.get('') - self.wait_until_visible('#global-nav') + self.wait_until_visible('#global-nav', poll=10) self.driver.find_element(By.XPATH, "//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click() - self.wait_until_visible('#projectstable') + self.wait_until_visible('#projectstable', poll=10) self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) project_URL=self.get_URL() self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li[@id='topbar-configuration-tab']/a[@href="+'"'+project_URL+'"'+"]").click() - self.wait_until_visible('#config-nav') + self.wait_until_visible('#config-nav', poll=10) self.assertTrue(re.search("Configuration",self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li[@id='topbar-configuration-tab']/a[@href="+'"'+project_URL+'"'+"]").text), 'Configuration tab in project topbar is misspelled') try: self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'builds/"'+"]").click() - self.wait_until_visible('#project-topbar') + self.wait_until_visible('#project-topbar', poll=10) self.assertTrue(re.search("Builds",self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'builds/"'+"]").text), 'Builds tab in project topbar is misspelled') self.driver.find_element(By.XPATH, "//div[@id='empty-state-projectbuildstable']") except: @@ -237,7 +237,7 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase): try: self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'importlayer"'+"]").click() - self.wait_until_visible('#project-topbar') + self.wait_until_visible('#project-topbar', poll=10) self.assertTrue(re.search("Import layer",self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'importlayer"'+"]").text), 'Import layer tab in project topbar is misspelled') self.driver.find_element(By.XPATH, "//fieldset[@id='repo-select']") self.driver.find_element(By.XPATH, "//fieldset[@id='git-repo']") @@ -246,7 +246,7 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase): try: self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'newcustomimage/"'+"]").click() - self.wait_until_visible('#project-topbar') + self.wait_until_visible('#project-topbar', poll=10) self.assertTrue(re.search("New custom image",self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'newcustomimage/"'+"]").text), 'New custom image tab in project topbar is misspelled') self.assertTrue(re.search("Select the image recipe you want to customise",self.driver.find_element(By.XPATH, "//div[@class='col-md-12']/h2").text),'The new custom image tab is not loading correctly') except: