($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Tim Orling <ticotimo@gmail.com>
To: david.reyna@windriver.com
Cc: "marlon.rodriguez-garcia@savoirfairelinux.com"
	<marlon.rodriguez-garcia@savoirfairelinux.com>,
	 "toaster@lists.yoctoproject.org"
	<toaster@lists.yoctoproject.org>
Subject: Re: [Toaster] [PATCH 3/3] toaster: fixed functional test
Date: Fri, 13 Oct 2023 13:53:50 -0700	[thread overview]
Message-ID: <CANx9H-B86Gc9rkYKDMrXymkAOJT24QbX2uCNP4ZoLsLUnTRM9g@mail.gmail.com> (raw)
In-Reply-To: <BY5PR11MB4167C7193F70603DA65D6825EAD2A@BY5PR11MB4167.namprd11.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 10655 bytes --]

On Fri, Oct 13, 2023 at 12:02 AM Reyna, David via lists.yoctoproject.org
<david.reyna=windriver.com@lists.yoctoproject.org> wrote:

> This patch seems fine to me, it includes the explanation.
>
> Agreed. I don't know how to actually run these tests to verify, but my
concerns about the git log have been addressed.
I guess my concern is we might be merging these in a state that is not
fully functional in 4.3. But we have shipped releases with broken Toaster
before ;)


> David
>
> -----Original Message-----
> From: toaster@lists.yoctoproject.org <toaster@lists.yoctoproject.org> On
> Behalf Of Marlon Rodriguez Garcia via lists.yoctoproject.org
> Sent: Thursday, October 12, 2023 10:40 AM
> To: toaster@lists.yoctoproject.org
> Cc: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com>
> Subject: [Toaster] [PATCH 3/3] toaster: fixed functional test
>
> Updated functional test file to fix url access and added waiting time
> after click operations
> to allow following elements to be available for tests, this will needed to
> be revisited
> when autobuilder is ready
>
> Signed-off-by: Marlon Rodriguez Garcia <
> marlon.rodriguez-garcia@savoirfairelinux.com>
> ---
>  .../tests/functional/test_functional_basic.py | 33 +++++++++++++------
>  1 file changed, 23 insertions(+), 10 deletions(-)
>
> diff --git a/lib/toaster/tests/functional/test_functional_basic.py
> b/lib/toaster/tests/functional/test_functional_basic.py
> index 067ad99a..b0def544 100644
> --- a/lib/toaster/tests/functional/test_functional_basic.py
> +++ b/lib/toaster/tests/functional/test_functional_basic.py
> @@ -7,7 +7,8 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  #
>
> -import re
> +import re, time
> +from django.urls import reverse
>  from tests.functional.functional_helpers import SeleniumFunctionalTestCase
>  from orm.models import Project
>  from selenium.webdriver.common.by import By
> @@ -17,11 +18,11 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase):
>  #   testcase (1514)
>      def test_create_slenium_project(self):
>          project_name = 'selenium-project'
> -        self.get('')
> -        self.driver.find_element(By.LINK_TEXT, "To start building, create
> your first Toaster project").click()
> +        self.get(reverse('newproject'))
>          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()
> +        time.sleep(2)
>          element = self.wait_until_visible('#project-created-notification')
>
>  self.assertTrue(self.element_exists('#project-created-notification'),'Project
> creation notification not shown')
>          self.assertTrue(project_name in element.text,
> @@ -31,15 +32,18 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase):
>
>   #  testcase (1515)
>      def test_verify_left_bar_menu(self):
> -        self.get('')
> +        self.get(reverse('all-projects'))
>          self.wait_until_visible('#projectstable')
>          self.find_element_by_link_text_in_table('projectstable',
> 'selenium-project').click()
> +        time.sleep(2)
>          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()
> +        time.sleep(2)
>
>          try:
>              self.driver.find_element(By.XPATH,
> "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'customimages/"'+"]").click()
> +            time.sleep(2)
>              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')
> @@ -78,14 +82,16 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase):
>      def test_review_configuration_information(self):
>          self.get('')
>          self.driver.find_element(By.XPATH,
> "//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
> +        time.sleep(2)
>          self.wait_until_visible('#projectstable')
>          self.find_element_by_link_text_in_table('projectstable',
> 'selenium-project').click()
>          project_URL=self.get_URL()
> -
> +        time.sleep(2)
>          try:
>
> self.assertTrue(self.element_exists('#machine-section'),'Machine section
> for the project configuration page does not exist')
>
> self.assertTrue(re.search("qemux86",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()
> +           time.sleep(2)
>             self.wait_until_visible('#select-machine-form')
>             self.wait_until_visible('#cancel-machine-change')
>             self.driver.find_element(By.XPATH,
> "//form[@id='select-machine-form']/a[@id='cancel-machine-change']").click()
> @@ -123,13 +129,16 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase):
>      def test_verify_machine_information(self):
>          self.get('')
>          self.driver.find_element(By.XPATH,
> "//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
> +        time.sleep(2)
>          self.wait_until_visible('#projectstable')
>          self.find_element_by_link_text_in_table('projectstable',
> 'selenium-project').click()
> +        time.sleep(2)
>
>          try:
>
>  self.assertTrue(self.element_exists('#machine-section'),'Machine section
> for the project configuration page does not exist')
>
>  self.assertTrue(re.search("qemux86",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()
> +            time.sleep(2)
>              self.wait_until_visible('#select-machine-form')
>              self.wait_until_visible('#cancel-machine-change')
>              self.driver.find_element(By.ID,
> "cancel-machine-change").click()
> @@ -140,14 +149,15 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase):
>      def test_verify_most_built_recipes_information(self):
>          self.get('')
>          self.driver.find_element(By.XPATH,
> "//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
> -
> +        time.sleep(2)
>          self.wait_until_visible('#projectstable')
>          self.find_element_by_link_text_in_table('projectstable',
> 'selenium-project').click()
>          project_URL=self.get_URL()
> -
> +        time.sleep(2)
>          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()
> +            time.sleep(2)
>              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')
> @@ -156,8 +166,10 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase):
>      def test_verify_project_release_information(self):
>          self.get('')
>          self.driver.find_element(By.XPATH,
> "//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
> +        time.sleep(2)
>          self.wait_until_visible('#projectstable')
>          self.find_element_by_link_text_in_table('projectstable',
> 'selenium-project').click()
> +        time.sleep(2)
>
>          try:
>              self.assertTrue(re.search("Yocto Project
> master",self.driver.find_element(By.ID, "project-release-title").text),'The
> project release is not defined')
> @@ -171,12 +183,12 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase):
>          self.wait_until_visible('#projectstable')
>          self.find_element_by_link_text_in_table('projectstable',
> 'selenium-project').click()
>          project_URL=self.get_URL()
> -
> +        time.sleep(2)
>          try:
>             self.driver.find_element(By.XPATH,
> "//div[@id='layer-container']")
>             self.assertTrue(re.search("3",self.driver.find_element(By.ID,
> "project-layers-count").text),'There should be 3 layers listed in the layer
> count')
>             layer_list = self.driver.find_element(By.ID,
> "layers-in-project-list")
> -           layers = layer_list.find_element(By.TAG_NAME, "li")
> +           layers = layer_list.find_elements(By.TAG_NAME, "li")
>
>             for layer in layers:
>                 if re.match ("openembedded-core",layer.text):
> @@ -199,10 +211,11 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase):
>      def test_verify_project_detail_links(self):
>          self.get('')
>          self.driver.find_element(By.XPATH,
> "//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
> +        time.sleep(2)
>          self.wait_until_visible('#projectstable')
>          self.find_element_by_link_text_in_table('projectstable',
> 'selenium-project').click()
>          project_URL=self.get_URL()
> -
> +        time.sleep(2)
>          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.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')
>
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#5860):
> https://lists.yoctoproject.org/g/toaster/message/5860
> Mute This Topic: https://lists.yoctoproject.org/mt/101923471/924729
> Group Owner: toaster+owner@lists.yoctoproject.org
> Unsubscribe:
> https://lists.yoctoproject.org/g/toaster/leave/8097283/924729/214578518/xyzzy
> [ticotimo@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 14323 bytes --]

      reply	other threads:[~2023-10-13 20:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12 17:40 [PATCH 3/3] toaster: fixed functional test Marlon Rodriguez Garcia
2023-10-13  7:02 ` [Toaster] " Reyna, David
2023-10-13 20:53   ` Tim Orling [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANx9H-B86Gc9rkYKDMrXymkAOJT24QbX2uCNP4ZoLsLUnTRM9g@mail.gmail.com \
    --to=ticotimo@gmail.com \
    --cc=david.reyna@windriver.com \
    --cc=marlon.rodriguez-garcia@savoirfairelinux.com \
    --cc=toaster@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).