toaster.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
To: toaster@lists.yoctoproject.org
Cc: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Subject: [PATCH 6/9] toaster/test: Added distro page TestCase
Date: Wed, 29 Nov 2023 23:53:37 +0100	[thread overview]
Message-ID: <20231129225340.477401-6-alassane.yattara@savoirfairelinux.com> (raw)
In-Reply-To: <20231129225340.477401-1-alassane.yattara@savoirfairelinux.com>

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 <alassane.yattara@savoirfairelinux.com>
---
 .../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]
+        )
-- 
2.34.1



  parent reply	other threads:[~2023-11-29 22:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 22:53 [PATCH 1/9] toaster/tests: Update methods wait_until_~ to skip using time.sleep Alassane Yattara
2023-11-29 22:53 ` [PATCH 2/9] toaster/test: Override table edit columns TestCase from image recipe page Alassane Yattara
2023-11-29 22:53 ` [PATCH 3/9] toaster/test: Test software " Alassane Yattara
2023-11-29 22:53 ` [PATCH 4/9] toaster/test: Added Machine page TestCase Alassane Yattara
2023-11-29 22:53 ` [PATCH 5/9] toaster/test: Added Layers " Alassane Yattara
2023-11-29 22:53 ` Alassane Yattara [this message]
2023-11-30 17:28   ` [Toaster] [PATCH 6/9] toaster/test: Added distro " Richard Purdie
2023-11-30 18:29     ` Alassane Yattara
2023-11-30 22:24       ` Richard Purdie
2023-11-30 22:43         ` Alassane Yattara
2023-11-29 22:53 ` [PATCH 7/9] toaster/test: Bug-fix on tests/functional/test_project_page Alassane Yattara
2023-11-29 22:53 ` [PATCH 8/9] toaster/test: Test single layer page Alassane Yattara
2023-11-29 22:53 ` [PATCH 9/9] toaster/test: Test single recipe page Alassane Yattara

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=20231129225340.477401-6-alassane.yattara@savoirfairelinux.com \
    --to=alassane.yattara@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 NNTP newsgroup(s).