diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/toaster/tests/functional/test_project_config.py | 164 |
1 files changed, 85 insertions, 79 deletions
diff --git a/bitbake/lib/toaster/tests/functional/test_project_config.py b/bitbake/lib/toaster/tests/functional/test_project_config.py index 2d162d81e7..dbee36aa4e 100644 --- a/bitbake/lib/toaster/tests/functional/test_project_config.py +++ b/bitbake/lib/toaster/tests/functional/test_project_config.py | |||
@@ -163,51 +163,53 @@ class TestProjectConfig(SeleniumFunctionalTestCase): | |||
163 | change_dl_dir_btn = self.wait_until_visible('#change-dl_dir-icon', poll=2) | 163 | change_dl_dir_btn = self.wait_until_visible('#change-dl_dir-icon', poll=2) |
164 | except TimeoutException: | 164 | except TimeoutException: |
165 | # If download dir is not displayed, test is skipped | 165 | # If download dir is not displayed, test is skipped |
166 | return True | 166 | change_dl_dir_btn = None |
167 | change_dl_dir_btn = self.wait_until_visible('#change-dl_dir-icon', poll=2) | ||
168 | change_dl_dir_btn.click() | ||
169 | 167 | ||
170 | # downloads dir path doesn't start with / or ${...} | 168 | if change_dl_dir_btn: |
171 | input_field = self.wait_until_visible('#new-dl_dir', poll=2) | 169 | change_dl_dir_btn = self.wait_until_visible('#change-dl_dir-icon', poll=2) |
172 | input_field.clear() | 170 | change_dl_dir_btn.click() |
173 | self.enter_text('#new-dl_dir', 'home/foo') | 171 | |
174 | element = self.wait_until_visible('#hintError-initialChar-dl_dir', poll=2) | 172 | # downloads dir path doesn't start with / or ${...} |
173 | input_field = self.wait_until_visible('#new-dl_dir', poll=2) | ||
174 | input_field.clear() | ||
175 | self.enter_text('#new-dl_dir', 'home/foo') | ||
176 | element = self.wait_until_visible('#hintError-initialChar-dl_dir', poll=2) | ||
175 | 177 | ||
176 | msg = 'downloads directory path starts with invalid character but ' \ | 178 | msg = 'downloads directory path starts with invalid character but ' \ |
177 | 'treated as valid' | 179 | 'treated as valid' |
178 | self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), msg) | 180 | self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), msg) |
179 | 181 | ||
180 | # downloads dir path has a space | 182 | # downloads dir path has a space |
181 | self.driver.find_element(By.ID, 'new-dl_dir').clear() | 183 | self.driver.find_element(By.ID, 'new-dl_dir').clear() |
182 | self.enter_text('#new-dl_dir', '/foo/bar a') | 184 | self.enter_text('#new-dl_dir', '/foo/bar a') |
183 | 185 | ||
184 | element = self.wait_until_visible('#hintError-dl_dir', poll=2) | 186 | element = self.wait_until_visible('#hintError-dl_dir', poll=2) |
185 | msg = 'downloads directory path characters invalid but treated as valid' | 187 | msg = 'downloads directory path characters invalid but treated as valid' |
186 | self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg) | 188 | self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg) |
187 | 189 | ||
188 | # downloads dir path starts with ${...} but has a space | 190 | # downloads dir path starts with ${...} but has a space |
189 | self.driver.find_element(By.ID,'new-dl_dir').clear() | 191 | self.driver.find_element(By.ID,'new-dl_dir').clear() |
190 | self.enter_text('#new-dl_dir', '${TOPDIR}/down foo') | 192 | self.enter_text('#new-dl_dir', '${TOPDIR}/down foo') |
191 | 193 | ||
192 | element = self.wait_until_visible('#hintError-dl_dir', poll=2) | 194 | element = self.wait_until_visible('#hintError-dl_dir', poll=2) |
193 | msg = 'downloads directory path characters invalid but treated as valid' | 195 | msg = 'downloads directory path characters invalid but treated as valid' |
194 | self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg) | 196 | self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg) |
195 | 197 | ||
196 | # downloads dir path starts with / | 198 | # downloads dir path starts with / |
197 | self.driver.find_element(By.ID,'new-dl_dir').clear() | 199 | self.driver.find_element(By.ID,'new-dl_dir').clear() |
198 | self.enter_text('#new-dl_dir', '/bar/foo') | 200 | self.enter_text('#new-dl_dir', '/bar/foo') |
199 | 201 | ||
200 | hidden_element = self.driver.find_element(By.ID,'hintError-dl_dir') | 202 | hidden_element = self.driver.find_element(By.ID,'hintError-dl_dir') |
201 | self.assertEqual(hidden_element.is_displayed(), False, | 203 | self.assertEqual(hidden_element.is_displayed(), False, |
202 | 'downloads directory path valid but treated as invalid') | 204 | 'downloads directory path valid but treated as invalid') |
203 | 205 | ||
204 | # downloads dir path starts with ${...} | 206 | # downloads dir path starts with ${...} |
205 | self.driver.find_element(By.ID,'new-dl_dir').clear() | 207 | self.driver.find_element(By.ID,'new-dl_dir').clear() |
206 | self.enter_text('#new-dl_dir', '${TOPDIR}/down') | 208 | self.enter_text('#new-dl_dir', '${TOPDIR}/down') |
207 | 209 | ||
208 | hidden_element = self.driver.find_element(By.ID,'hintError-dl_dir') | 210 | hidden_element = self.driver.find_element(By.ID,'hintError-dl_dir') |
209 | self.assertEqual(hidden_element.is_displayed(), False, | 211 | self.assertEqual(hidden_element.is_displayed(), False, |
210 | 'downloads directory path valid but treated as invalid') | 212 | 'downloads directory path valid but treated as invalid') |
211 | 213 | ||
212 | def test_set_sstate_dir(self): | 214 | def test_set_sstate_dir(self): |
213 | """ | 215 | """ |
@@ -217,53 +219,57 @@ class TestProjectConfig(SeleniumFunctionalTestCase): | |||
217 | self._navigate_bbv_page() | 219 | self._navigate_bbv_page() |
218 | 220 | ||
219 | try: | 221 | try: |
220 | self.wait_until_visible('#change-sstate_dir-icon', poll=2) | 222 | btn_chg_sstate_dir = self.wait_until_visible( |
223 | '#change-sstate_dir-icon', | ||
224 | poll=2 | ||
225 | ) | ||
221 | self.click('#change-sstate_dir-icon') | 226 | self.click('#change-sstate_dir-icon') |
222 | except TimeoutException: | 227 | except TimeoutException: |
223 | # If sstate_dir is not displayed, test is skipped | 228 | # If sstate_dir is not displayed, test is skipped |
224 | return True | 229 | btn_chg_sstate_dir = None |
225 | 230 | ||
226 | # path doesn't start with / or ${...} | 231 | if btn_chg_sstate_dir: # Skip continuation if sstate_dir is not displayed |
227 | input_field = self.wait_until_visible('#new-sstate_dir', poll=2) | 232 | # path doesn't start with / or ${...} |
228 | input_field.clear() | 233 | input_field = self.wait_until_visible('#new-sstate_dir', poll=2) |
229 | self.enter_text('#new-sstate_dir', 'home/foo') | 234 | input_field.clear() |
230 | element = self.wait_until_visible('#hintError-initialChar-sstate_dir', poll=2) | 235 | self.enter_text('#new-sstate_dir', 'home/foo') |
231 | 236 | element = self.wait_until_visible('#hintError-initialChar-sstate_dir', poll=2) | |
232 | msg = 'sstate directory path starts with invalid character but ' \ | 237 | |
233 | 'treated as valid' | 238 | msg = 'sstate directory path starts with invalid character but ' \ |
234 | self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), msg) | 239 | 'treated as valid' |
235 | 240 | self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), msg) | |
236 | # path has a space | 241 | |
237 | self.driver.find_element(By.ID, 'new-sstate_dir').clear() | 242 | # path has a space |
238 | self.enter_text('#new-sstate_dir', '/foo/bar a') | 243 | self.driver.find_element(By.ID, 'new-sstate_dir').clear() |
239 | 244 | self.enter_text('#new-sstate_dir', '/foo/bar a') | |
240 | element = self.wait_until_visible('#hintError-sstate_dir', poll=2) | 245 | |
241 | msg = 'sstate directory path characters invalid but treated as valid' | 246 | element = self.wait_until_visible('#hintError-sstate_dir', poll=2) |
242 | self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg) | 247 | msg = 'sstate directory path characters invalid but treated as valid' |
243 | 248 | self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg) | |
244 | # path starts with ${...} but has a space | 249 | |
245 | self.driver.find_element(By.ID,'new-sstate_dir').clear() | 250 | # path starts with ${...} but has a space |
246 | self.enter_text('#new-sstate_dir', '${TOPDIR}/down foo') | 251 | self.driver.find_element(By.ID,'new-sstate_dir').clear() |
247 | 252 | self.enter_text('#new-sstate_dir', '${TOPDIR}/down foo') | |
248 | element = self.wait_until_visible('#hintError-sstate_dir', poll=2) | 253 | |
249 | msg = 'sstate directory path characters invalid but treated as valid' | 254 | element = self.wait_until_visible('#hintError-sstate_dir', poll=2) |
250 | self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg) | 255 | msg = 'sstate directory path characters invalid but treated as valid' |
251 | 256 | self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg) | |
252 | # path starts with / | 257 | |
253 | self.driver.find_element(By.ID,'new-sstate_dir').clear() | 258 | # path starts with / |
254 | self.enter_text('#new-sstate_dir', '/bar/foo') | 259 | self.driver.find_element(By.ID,'new-sstate_dir').clear() |
255 | 260 | self.enter_text('#new-sstate_dir', '/bar/foo') | |
256 | hidden_element = self.driver.find_element(By.ID, 'hintError-sstate_dir') | 261 | |
257 | self.assertEqual(hidden_element.is_displayed(), False, | 262 | hidden_element = self.driver.find_element(By.ID, 'hintError-sstate_dir') |
258 | 'sstate directory path valid but treated as invalid') | 263 | self.assertEqual(hidden_element.is_displayed(), False, |
259 | 264 | 'sstate directory path valid but treated as invalid') | |
260 | # paths starts with ${...} | 265 | |
261 | self.driver.find_element(By.ID, 'new-sstate_dir').clear() | 266 | # paths starts with ${...} |
262 | self.enter_text('#new-sstate_dir', '${TOPDIR}/down') | 267 | self.driver.find_element(By.ID, 'new-sstate_dir').clear() |
263 | 268 | self.enter_text('#new-sstate_dir', '${TOPDIR}/down') | |
264 | hidden_element = self.driver.find_element(By.ID, 'hintError-sstate_dir') | 269 | |
265 | self.assertEqual(hidden_element.is_displayed(), False, | 270 | hidden_element = self.driver.find_element(By.ID, 'hintError-sstate_dir') |
266 | 'sstate directory path valid but treated as invalid') | 271 | self.assertEqual(hidden_element.is_displayed(), False, |
272 | 'sstate directory path valid but treated as invalid') | ||
267 | 273 | ||
268 | def _change_bbv_value(self, **kwargs): | 274 | def _change_bbv_value(self, **kwargs): |
269 | var_name, field, btn_id, input_id, value, save_btn, *_ = kwargs.values() | 275 | var_name, field, btn_id, input_id, value, save_btn, *_ = kwargs.values() |