TT#56376 selenium: little cleanups for controller_admin

controller_admin.t:
- remove some lines to prevent a unnecessary double search
- edit admin now also edits the name, just like in other scripts

Change-Id: Ie53298f90a0db713bd74329d3d7429750ddab709
changes/02/31702/3
Nico Schedel 6 years ago
parent e0df16d347
commit 007b1a4d98

@ -61,9 +61,9 @@ ok($d->wait_for_text('//*[@id="administrator_table"]/tbody/tr[1]/td[2]', $resell
ok($d->find_element_by_xpath('//*[@id="administrator_table"]/tbody/tr[1]/td[6][contains(text(), "0")]'), "Read-Only value is correct");
diag('Edit Admin details');
$adminname = ("admin" . int(rand(100000)) . "test");
$d->fill_element('//*[@id="login"]', 'xpath', $adminname);
$d->move_and_click('//*[@id="administrator_table"]//tr[1]/td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="administrator_table_filter"]/label/input');
diag('Enable Attribute "Read only"');
$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();
@ -128,10 +128,6 @@ $d->fill_element('//*[@id="administrator_table_filter"]/label/input', 'xpath', $
ok($d->wait_for_text('//*[@id="administrator_table"]/tbody/tr[1]/td[3]', $adminname), "Admin is still here");
diag('Try to delete Administrator');
$d->fill_element('//*[@id="administrator_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#administrator_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="administrator_table_filter"]/label/input', 'xpath', $adminname);
ok($d->wait_for_text('//*[@id="administrator_table"]/tbody/tr[1]/td[3]', $adminname), "Admin found");
$d->move_and_click('//*[@id="administrator_table"]/tbody/tr[1]/td//a[contains(text(), "Delete")]', 'xpath', '//*[@id="administrator_table_filter"]/label/input');
$d->find_element('//*[@id="dataConfirmOK"]')->click();

Loading…
Cancel
Save