summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/tests/browser
diff options
context:
space:
mode:
authorAlassane Yattara <alassane.yattara@savoirfairelinux.com>2023-11-14 15:28:05 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-11-14 23:38:13 +0000
commitb2db1c4e81df605eeee2b067d189ec131362523a (patch)
treec9dad2d62a63de02a7e3951af44384b4be778e97 /bitbake/lib/toaster/tests/browser
parent853deb8f75cc9bd31c7597ba7a57e02e64f78c90 (diff)
downloadpoky-b2db1c4e81df605eeee2b067d189ec131362523a.tar.gz
bitbake: toaster/tests: Add UI TestCase to test "edit column" feature show/hide column
Test the "edit column" feature in the builds table on the all builds page (Bitbake rev: eb9f8ae240bb0b934da28474075a72a409e336ef) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/tests/browser')
-rw-r--r--bitbake/lib/toaster/tests/browser/test_all_builds_page.py59
1 files changed, 59 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_all_builds_page.py b/bitbake/lib/toaster/tests/browser/test_all_builds_page.py
index 90dcdd9193..bd2b479912 100644
--- a/bitbake/lib/toaster/tests/browser/test_all_builds_page.py
+++ b/bitbake/lib/toaster/tests/browser/test_all_builds_page.py
@@ -362,3 +362,62 @@ class TestAllBuildsPage(SeleniumTestCase):
362 time.sleep(1) 362 time.sleep(1)
363 self.assertTrue(len(self.find_all('#allbuildstable tbody tr')) == 6) 363 self.assertTrue(len(self.find_all('#allbuildstable tbody tr')) == 6)
364 364
365 def test_builds_table_editColumn(self):
366 """ Test the edit column feature in the builds table on the all builds page """
367 self._get_create_builds(success=10, failure=10)
368
369 def test_edit_column(check_box_id):
370 # Check that we can hide/show table column
371 check_box = self.find(f'#{check_box_id}')
372 th_class = str(check_box_id).replace('checkbox-', '')
373 if check_box.is_selected():
374 # check if column is visible in table
375 self.assertTrue(
376 self.find(
377 f'#allbuildstable thead th.{th_class}'
378 ).is_displayed(),
379 f"The {th_class} column is checked in EditColumn dropdown, but it's not visible in table"
380 )
381 check_box.click()
382 # check if column is hidden in table
383 self.assertFalse(
384 self.find(
385 f'#allbuildstable thead th.{th_class}'
386 ).is_displayed(),
387 f"The {th_class} column is unchecked in EditColumn dropdown, but it's visible in table"
388 )
389 else:
390 # check if column is hidden in table
391 self.assertFalse(
392 self.find(
393 f'#allbuildstable thead th.{th_class}'
394 ).is_displayed(),
395 f"The {th_class} column is unchecked in EditColumn dropdown, but it's visible in table"
396 )
397 check_box.click()
398 # check if column is visible in table
399 self.assertTrue(
400 self.find(
401 f'#allbuildstable thead th.{th_class}'
402 ).is_displayed(),
403 f"The {th_class} column is checked in EditColumn dropdown, but it's not visible in table"
404 )
405 url = reverse('all-builds')
406 self.get(url)
407 self.wait_until_present('#allbuildstable tbody tr')
408
409 # Check edit column
410 edit_column = self.find('#edit-columns-button')
411 self.assertTrue(edit_column.is_displayed())
412 edit_column.click()
413 # Check dropdown is visible
414 self.wait_until_visible('ul.dropdown-menu.editcol')
415
416 # Check that we can hide the edit column
417 test_edit_column('checkbox-errors_no')
418 test_edit_column('checkbox-failed_tasks')
419 test_edit_column('checkbox-image_files')
420 test_edit_column('checkbox-project')
421 test_edit_column('checkbox-started_on')
422 test_edit_column('checkbox-time')
423 test_edit_column('checkbox-warnings_no')