TT#56376 selenium: simplified code around deleting billing fee

controller_billing.t:
- made delete billing fee test a bit simpler

Change-Id: I7eecb379045cdf260960b9a06cfc54486fc34ddc
changes/73/29373/1
Nico Schedel 7 years ago
parent f2746edfa7
commit ed50e78499

@ -70,15 +70,14 @@ $d->fill_element('#destination', 'css', '.+');
$d->find_element('#save', 'css')->click();
diag("Delete billing fee");
$d->find_element('//div[contains(@class,"dataTables_wrapper")]//td[contains(text(),"testingdetail")]/..//a[contains(@class,"btn-primary") and contains(text(),"Edit")]');
my $row = $d->find_element('//div[contains(@class,"dataTables_wrapper")]//td[contains(text(),"testingdetail")]/..');
ok($row, "Find row");
$d->move_action(element => $row);
ok(1, "Mouse over row");
$d->find_element('//div[contains(@class,"dataTables_wrapper")]//td[contains(text(),"testingdetail")]/..//a[contains(@class,"btn-secondary") and contains(text(),"Delete")]')->click();
$d->fill_element('//*[@id="billing_fee_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#billing_fee_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="billing_fee_table_filter"]/label/input', 'xpath', '.+');
ok($d->wait_for_text('//*[@id="billing_fee_table"]/tbody/tr/td[3]', '.+'), 'Entry appears');
$d->move_action(element => $d->find_element('//*[@id="billing_fee_table"]/tbody/tr[1]/td//div//a[contains(text(), "Delete")]'));
$d->find_element('//*[@id="billing_fee_table"]/tbody/tr[1]/td//div//a[contains(text(), "Delete")]')->click();
ok($d->find_text("Are you sure?"), 'Delete dialog appears');
$d->find_element('#dataConfirmOK', 'css')->click();
diag('skip was here');
ok($d->find_text("successfully deleted"), 'Text "successfully deleted" appears');
diag("Click Edit Zones");
@ -89,7 +88,7 @@ diag("Delete testingzone");
$d->fill_element('//div[contains(@class, "dataTables_filter")]//input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#billing_zone_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//div[contains(@class, "dataTables_filter")]//input', 'xpath', 'testingdetail');
$row = $d->find_element('//div[contains(@class,"dataTables_wrapper")]//td[contains(text(),"testingzone")]/..');
my $row = $d->find_element('//div[contains(@class,"dataTables_wrapper")]//td[contains(text(),"testingzone")]/..');
ok($row);
$d->move_action(element => $row);
$d->find_element('//div[contains(@class,"dataTables_wrapper")]//td[contains(text(),"testingzone")]/..//a[contains(text(),"Delete")]')->click();

Loading…
Cancel
Save