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 4/9] toaster/test: Added Machine page TestCase
Date: Wed, 29 Nov 2023 23:53:35 +0100	[thread overview]
Message-ID: <20231129225340.477401-4-alassane.yattara@savoirfairelinux.com> (raw)
In-Reply-To: <20231129225340.477401-1-alassane.yattara@savoirfairelinux.com>

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



  parent reply	other threads:[~2023-11-29 22:53 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 ` Alassane Yattara [this message]
2023-11-29 22:53 ` [PATCH 5/9] toaster/test: Added Layers page TestCase Alassane Yattara
2023-11-29 22:53 ` [PATCH 6/9] toaster/test: Added distro " Alassane Yattara
2023-11-30 17:28   ` [Toaster] " 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-4-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).