TT#56376 selenium: add label checks to controller_admin.t

controller_admin.t:
- add checks to see if create/delete labels show up and if the show the
correct text

Change-Id: Ie7520c518518624e3970d097b28dda93ed89b04b
changes/56/30956/2
Nico Schedel 6 years ago
parent 5f503e2a48
commit fb7467b455

@ -48,6 +48,7 @@ sub ctr_admin() {
$d->fill_element('//*[@id="login"]', 'xpath', $adminname);
$d->fill_element('//*[@id="password"]', 'xpath', $adminpwd);
$d->find_element('//*[@id="save"]')->click();
ok($d->find_element_by_xpath('//*[@id="content"]//div[contains(text(), "Administrator successfully created")]'), "Label 'Administrator successfully created' was shown");
diag('Search for our new admin');
$d->fill_element('//*[@id="administrator_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
@ -66,6 +67,7 @@ sub ctr_admin() {
$d->scroll_to_element($d->find_element('//form//div/label[contains(text(), "Read only")]'));
$d->select_if_unselected('//*[@id="read_only"]');
$d->find_element('//*[@id="save"]')->click();
ok($d->find_element_by_xpath('//*[@id="content"]//div[contains(text(), "Administrator successfully updated")]'), "Label 'Administrator successfully updated' was shown");
diag('Check Admin details');
$d->fill_element('//*[@id="administrator_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
@ -134,6 +136,7 @@ sub ctr_admin() {
$d->find_element('//*[@id="dataConfirmOK"]')->click();
diag('Check if admin is deleted');
ok($d->find_element_by_xpath('//*[@id="content"]//div[contains(text(), "Administrator successfully deleted")]'), "Label 'Administrator successfully deleted' was shown");
$d->fill_element('//*[@id="administrator_table_filter"]/label/input', 'xpath', $adminname);
ok($d->find_element_by_css('#administrator_table tr > td.dataTables_empty', 'css'), 'Admin was deleted');

Loading…
Cancel
Save