diff options
author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-11-14 15:28:03 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-14 23:38:13 +0000 |
commit | 2d73d6148eba7dbda0d2c95415bc0d205d630237 (patch) | |
tree | 1535ee61f682bd8c96b28a0f224d8e333deea8d5 /bitbake | |
parent | 3375714aa4abb7dc884ba0e7739b638633c522a0 (diff) | |
download | poky-2d73d6148eba7dbda0d2c95415bc0d205d630237.tar.gz |
bitbake: toaster/tests: Add UI TestCase to test the filtering feature on 'failure tasks' column
Test the filtering on failure tasks column in the builds table on the all builds page
(Bitbake rev: 9e48818f08c71ae2529aa52166e3527850a6234f)
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/toaster/tests/browser/test_all_builds_page.py | 38 |
1 files changed, 38 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 eb14f89db1..81498aa818 100644 --- a/bitbake/lib/toaster/tests/browser/test_all_builds_page.py +++ b/bitbake/lib/toaster/tests/browser/test_all_builds_page.py | |||
@@ -113,6 +113,20 @@ class TestAllBuildsPage(SeleniumTestCase): | |||
113 | # a particular build) | 113 | # a particular build) |
114 | Target.objects.create(build=build1, target='foo') | 114 | Target.objects.create(build=build1, target='foo') |
115 | Target.objects.create(build=build2, target='bar') | 115 | Target.objects.create(build=build2, target='bar') |
116 | |||
117 | if kwargs: | ||
118 | # Create kwargs.get('success') builds with success status with target | ||
119 | # and kwargs.get('failure') builds with failure status with target | ||
120 | for i in range(kwargs.get('success', 0)): | ||
121 | build = Build.objects.create(**self.project1_build_success) | ||
122 | Target.objects.create(build=build, | ||
123 | target=f'{i}_success_recipe', | ||
124 | task=f'{i}_success_task') | ||
125 | for i in range(kwargs.get('failure', 0)): | ||
126 | build = Build.objects.create(**self.project1_build_failure) | ||
127 | Target.objects.create(build=build, | ||
128 | target=f'{i}_fail_recipe', | ||
129 | task=f'{i}_fail_task') | ||
116 | return build1, build2 | 130 | return build1, build2 |
117 | 131 | ||
118 | def test_show_tasks_with_suffix(self): | 132 | def test_show_tasks_with_suffix(self): |
@@ -248,3 +262,27 @@ class TestAllBuildsPage(SeleniumTestCase): | |||
248 | self.wait_until_present('#allbuildstable tbody tr') | 262 | self.wait_until_present('#allbuildstable tbody tr') |
249 | rows = self.find_all('#allbuildstable tbody tr') | 263 | rows = self.find_all('#allbuildstable tbody tr') |
250 | self.assertTrue(len(rows) >= 1) | 264 | self.assertTrue(len(rows) >= 1) |
265 | |||
266 | def test_filtering_on_failure_tasks_column(self): | ||
267 | """ Test the filtering on failure tasks column in the builds table on the all builds page """ | ||
268 | self._get_create_builds(success=10, failure=10) | ||
269 | |||
270 | url = reverse('all-builds') | ||
271 | self.get(url) | ||
272 | |||
273 | # Check filtering on failure tasks column | ||
274 | self.wait_until_present('#allbuildstable tbody tr') | ||
275 | failed_tasks_filter = self.find('#failed_tasks_filter') | ||
276 | failed_tasks_filter.click() | ||
277 | # Check popup is visible | ||
278 | time.sleep(1) | ||
279 | self.wait_until_present('#filter-modal-allbuildstable') | ||
280 | self.assertTrue(self.find('#filter-modal-allbuildstable').is_displayed()) | ||
281 | # Check that we can filter by failure tasks | ||
282 | build_without_failure_tasks = self.find('#failed_tasks_filter\\:without_failed_tasks') | ||
283 | build_without_failure_tasks.click() | ||
284 | # click on apply button | ||
285 | self.find('#filter-modal-allbuildstable .btn-primary').click() | ||
286 | self.wait_until_present('#allbuildstable tbody tr') | ||
287 | # Check if filter is applied, by checking if failed_tasks_filter has btn-primary class | ||
288 | self.assertTrue(self.find('#failed_tasks_filter').get_attribute('class').find('btn-primary') != -1) | ||