summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/tests/browser/test_builddashboard_page.py')
-rw-r--r--bitbake/lib/toaster/tests/browser/test_builddashboard_page.py31
1 files changed, 15 insertions, 16 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py b/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py
index 0d39abb050..cdb0616235 100644
--- a/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py
+++ b/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py
@@ -140,7 +140,7 @@ class TestBuildDashboardPage(SeleniumTestCase):
140 dashboard for the Build object build 140 dashboard for the Build object build
141 """ 141 """
142 self._get_build_dashboard(build) 142 self._get_build_dashboard(build)
143 return self.find_all('#errors div.alert-error') 143 return self.find_all('#errors div.alert-danger')
144 144
145 def _check_for_log_message(self, build, log_message): 145 def _check_for_log_message(self, build, log_message):
146 """ 146 """
@@ -179,23 +179,15 @@ class TestBuildDashboardPage(SeleniumTestCase):
179 the WebElement modal match the list of text values in expected 179 the WebElement modal match the list of text values in expected
180 """ 180 """
181 # labels containing the radio buttons we're testing for 181 # labels containing the radio buttons we're testing for
182 labels = modal.find_elements_by_tag_name('label') 182 labels = modal.find_elements_by_css_selector(".radio")
183
184 # because the label content has the structure
185 # label text
186 # <input...>
187 # we have to regex on its innerHTML, as we can't just retrieve the
188 # "label text" on its own via the Selenium API
189 labels_text = sorted(map(
190 lambda label: label.get_attribute('innerHTML'), labels
191 ))
192
193 expected = sorted(expected)
194 183
184 labels_text = [lab.text for lab in labels]
195 self.assertEqual(len(labels_text), len(expected)) 185 self.assertEqual(len(labels_text), len(expected))
196 186
197 for idx, label_text in enumerate(labels_text): 187 for expected_text in expected:
198 self.assertRegexpMatches(label_text, expected[idx]) 188 self.assertTrue(expected_text in labels_text,
189 "Could not find %s in %s" % (expected_text,
190 labels_text))
199 191
200 def test_exceptions_show_as_errors(self): 192 def test_exceptions_show_as_errors(self):
201 """ 193 """
@@ -217,7 +209,13 @@ class TestBuildDashboardPage(SeleniumTestCase):
217 the user choose one of them to edit 209 the user choose one of them to edit
218 """ 210 """
219 self._get_build_dashboard(self.build1) 211 self._get_build_dashboard(self.build1)
212
213 # click the "edit custom image" button, which populates the modal
214 selector = '[data-role="edit-custom-image-trigger"]'
215 self.click(selector)
216
220 modal = self.driver.find_element_by_id('edit-custom-image-modal') 217 modal = self.driver.find_element_by_id('edit-custom-image-modal')
218 self.wait_until_visible("#edit-custom-image-modal")
221 219
222 # recipes we expect to see in the edit custom image modal 220 # recipes we expect to see in the edit custom image modal
223 expected_recipes = [ 221 expected_recipes = [
@@ -235,10 +233,11 @@ class TestBuildDashboardPage(SeleniumTestCase):
235 self._get_build_dashboard(self.build1) 233 self._get_build_dashboard(self.build1)
236 234
237 # click the "new custom image" button, which populates the modal 235 # click the "new custom image" button, which populates the modal
238 selector = '[data-role="new-custom-image-trigger"] button' 236 selector = '[data-role="new-custom-image-trigger"]'
239 self.click(selector) 237 self.click(selector)
240 238
241 modal = self.driver.find_element_by_id('new-custom-image-modal') 239 modal = self.driver.find_element_by_id('new-custom-image-modal')
240 self.wait_until_visible("#new-custom-image-modal")
242 241
243 # recipes we expect to see in the new custom image modal 242 # recipes we expect to see in the new custom image modal
244 expected_recipes = [ 243 expected_recipes = [