TT#56376 selenium: initial controller_reseller.t code refractoring

controller_reseller.t:
- Test will now 'create' a reseller first, then it will check the search.
(It doesnt create anything right now...)
- Searching and verifying garbage text improved.

Change-Id: Id3b9a3a12cb62df9ed5163aee86fa6a97995977e
changes/82/29082/5
Nico Schedel 7 years ago
parent 41c3332af2
commit abe43af462

@ -19,22 +19,6 @@ $d->login_ok();
diag("Go to reseller list");
$d->find_element('//a[@class="btn" and contains(@href,"/reseller")]')->click();
diag("Search nonexisting reseller");
my $searchfield = $d->find_element('#Resellers_table_filter label input', 'css');
ok($searchfield);
$searchfield->send_keys('donotfindme');
diag("Verify that nothing is shown");
my $elem = $d->find_element('#Resellers_table td.dataTables_empty', 'css');
ok($elem);
is($elem->get_text,'No matching records found');
diag('Search for "1" in resellers');
$searchfield->clear();
$searchfield->send_keys('active');
$d->find_element('#Resellers_table tr.sw_action_row', 'css');
is($d->find_element('//table[@id="Resellers_table"]//tr[1]/td[1]')->get_text(), '1');
diag("Going to create a reseller");
$d->find_element('Create Reseller', 'link_text')->click();
$d->find_element('#save', 'css')->click();
@ -42,6 +26,16 @@ ok($d->find_text("Contract field is required"), 'Error "Contract field is requir
ok($d->find_text("Name field is required"), 'Error "Name field is required" appears');
$d->find_element('#mod_close', 'css')->click();
diag("Search nonexisting reseller");
my $searchfield = $d->find_element('#Resellers_table_filter label input', 'css');
$searchfield->send_keys('thisshouldnotexist');
diag("Verify that nothing is shown");
ok($d->find_element_by_css('#Resellers_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$searchfield->clear();
$searchfield->send_keys('active');
ok($d->wait_for_text('//*[@id="Resellers_table"]/tbody/tr[1]/td[2]', '1'), 'Default Reseller found');
diag("Click Edit on the first reseller shown (first row)");
sleep 1; #prevent a StaleElementReferenceException
my $row = $d->find_element('//*[@id="Resellers_table"]/tbody/tr[1]');

Loading…
Cancel
Save