diff options
Diffstat (limited to 'bitbake/lib/toaster/tests')
-rw-r--r-- | bitbake/lib/toaster/tests/browser/test_all_projects_page.py | 58 |
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') | ||