From: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
To: toaster@lists.yoctoproject.org
Cc: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Subject: [PATCH 7/7] Toaster: Write UI TestCase -> Test the show rows feature in image recipe
Date: Tue, 21 Nov 2023 14:50:43 +0100 [thread overview]
Message-ID: <20231121135043.105385-7-alassane.yattara@savoirfairelinux.com> (raw)
In-Reply-To: <20231121135043.105385-1-alassane.yattara@savoirfairelinux.com>
Test the show rows feature in image recipe table on project page
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
---
.../test_project_page_tab_config.py | 36 ++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/lib/toaster/tests/functional/test_project_page_tab_config.py b/lib/toaster/tests/functional/test_project_page_tab_config.py
index 2dfc120d..23012d78 100644
--- a/lib/toaster/tests/functional/test_project_page_tab_config.py
+++ b/lib/toaster/tests/functional/test_project_page_tab_config.py
@@ -347,7 +347,10 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase):
By.XPATH, '//*[@id="project-page"]/div[1]/div[3]')
recipe_list = most_built_recipes.find_element(By.ID, 'freq-build-list')
recipe_list_items = recipe_list.find_elements(By.TAG_NAME, 'li')
- self.assertTrue(len(recipe_list_items) > 0)
+ self.assertTrue(
+ len(recipe_list_items) > 0,
+ msg="No recipes found in the most built recipes list",
+ )
checkbox = recipe_list_items[0].find_element(By.TAG_NAME, 'input')
checkbox.click()
build_btn = self.find('#freq-build-btn')
@@ -465,6 +468,7 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase):
recipe_input = self.find('#search-input-imagerecipestable')
recipe_input.send_keys('core-image-minimal')
self.find('#search-submit-imagerecipestable').click()
+ self.wait_until_visible('#imagerecipestable tbody tr')
rows = self.find_all('#imagerecipestable tbody tr')
self.assertTrue(len(rows) > 0)
@@ -542,3 +546,33 @@ class TestProjectConfigTab(SeleniumFunctionalTestCase):
test_edit_column('checkbox-recipe-file')
test_edit_column('checkbox-section')
test_edit_column('checkbox-version')
+
+ def test_image_recipe_show_rows(self):
+ """ Test the show rows feature in image recipe table on project page """
+ self._get_create_builds(success=100, failure=100)
+
+ def test_show_rows(row_to_show, show_row_link):
+ # Check that we can show rows == row_to_show
+ show_row_link.select_by_value(str(row_to_show))
+ self.wait_until_present('#imagerecipestable tbody tr')
+ sleep(1)
+ self.assertTrue(
+ len(self.find_all('#imagerecipestable tbody tr')) == row_to_show
+ )
+
+ url = reverse('projectimagerecipes', args=(2,))
+ self.get(url)
+ self.wait_until_present('#imagerecipestable tbody tr')
+
+ show_rows = self.driver.find_elements(
+ By.XPATH,
+ '//select[@class="form-control pagesize-imagerecipestable"]'
+ )
+ # Check show rows
+ for show_row_link in show_rows:
+ show_row_link = Select(show_row_link)
+ test_show_rows(10, show_row_link)
+ test_show_rows(25, show_row_link)
+ test_show_rows(50, show_row_link)
+ test_show_rows(100, show_row_link)
+ test_show_rows(150, show_row_link)
--
2.34.1
prev parent reply other threads:[~2023-11-21 13:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 13:50 [PATCH 1/7] Toaster: Write UI TestCase -> Test project config tab navigation: Alassane Yattara
2023-11-21 13:50 ` [PATCH 2/7] Toaster: Write UI TestCase -> Test project config tab Alassane Yattara
2023-11-21 13:50 ` [PATCH 3/7] Toaster: Write UI TestCase -> Test project page tab import layer Alassane Yattara
2023-11-21 13:50 ` [PATCH 4/7] Toaster: Write UI TestCase -> Test project page tab "New custom image" Alassane Yattara
2023-11-21 13:50 ` [PATCH 5/7] Toaster: Write UI TestCase -> Test project page section images Alassane Yattara
2023-11-21 13:50 ` [PATCH 6/7] Toaster: Write UI TestCase -> the edit column feature in image recipe Alassane Yattara
2023-11-21 13:50 ` Alassane Yattara [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=20231121135043.105385-7-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 read-only IMAP folder(s) and NNTP newsgroup(s).