summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlassane Yattara <alassane.yattara@savoirfairelinux.com>2023-11-21 14:48:00 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-11-23 12:06:06 +0000
commitf1230edc55257dec03a055876cba775af4ee208f (patch)
tree7437b8db0b9827e7d3d03a4e260329933a4f9a43
parent6c5dff75f5bf4bc7dd67599a27fce88622b5b59e (diff)
downloadpoky-f1230edc55257dec03a055876cba775af4ee208f.tar.gz
bitbake: toaster/tests: Add UI TestCase for visualize all projects edit column
Test the edit column feature in the projects table on the all projects page (Bitbake rev: 16e05122b7298c449bf6cec1bcae75c3fb5d87db) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/tests/browser/test_all_projects_page.py58
1 files changed, 58 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_all_projects_page.py b/bitbake/lib/toaster/tests/browser/test_all_projects_page.py
index db25e72333..2b1d8cc1cd 100644
--- a/bitbake/lib/toaster/tests/browser/test_all_projects_page.py
+++ b/bitbake/lib/toaster/tests/browser/test_all_projects_page.py
@@ -239,3 +239,61 @@ class TestAllProjectsPage(SeleniumTestCase):
239 time.sleep(1) 239 time.sleep(1)
240 rows = self.find_all('#projectstable tbody tr') 240 rows = self.find_all('#projectstable tbody tr')
241 self.assertTrue(len(rows) == 1) 241 self.assertTrue(len(rows) == 1)
242
243 def test_allProject_table_editColumn(self):
244 """ Test the edit column feature in the projects table on the all projects page """
245 self._create_projects()
246
247 def test_edit_column(check_box_id):
248 # Check that we can hide/show table column
249 check_box = self.find(f'#{check_box_id}')
250 th_class = str(check_box_id).replace('checkbox-', '')
251 if check_box.is_selected():
252 # check if column is visible in table
253 self.assertTrue(
254 self.find(
255 f'#projectstable thead th.{th_class}'
256 ).is_displayed(),
257 f"The {th_class} column is checked in EditColumn dropdown, but it's not visible in table"
258 )
259 check_box.click()
260 # check if column is hidden in table
261 self.assertFalse(
262 self.find(
263 f'#projectstable thead th.{th_class}'
264 ).is_displayed(),
265 f"The {th_class} column is unchecked in EditColumn dropdown, but it's visible in table"
266 )
267 else:
268 # check if column is hidden in table
269 self.assertFalse(
270 self.find(
271 f'#projectstable thead th.{th_class}'
272 ).is_displayed(),
273 f"The {th_class} column is unchecked in EditColumn dropdown, but it's visible in table"
274 )
275 check_box.click()
276 # check if column is visible in table
277 self.assertTrue(
278 self.find(
279 f'#projectstable thead th.{th_class}'
280 ).is_displayed(),
281 f"The {th_class} column is checked in EditColumn dropdown, but it's not visible in table"
282 )
283 url = reverse('all-projects')
284 self.get(url)
285 self.wait_until_present('#projectstable tbody tr')
286
287 # Check edit column
288 edit_column = self.find('#edit-columns-button')
289 self.assertTrue(edit_column.is_displayed())
290 edit_column.click()
291 # Check dropdown is visible
292 self.wait_until_visible('ul.dropdown-menu.editcol')
293
294 # Check that we can hide the edit column
295 test_edit_column('checkbox-errors')
296 test_edit_column('checkbox-image_files')
297 test_edit_column('checkbox-last_build_outcome')
298 test_edit_column('checkbox-recipe_name')
299 test_edit_column('checkbox-warnings')