TT#68016 selenium: check customer alerts after expanding all columns

controller_customer.t:
- first expand all columns in customer details, then check for alerts since
alert messages usually are inside those columns and when they are closed,
selenium cant pick them up

Change-Id: I78cc8ad80784fe734041d4b893575e5b8d71cf6a
(cherry picked from commit a2d22e15e9)
changes/09/35109/1
Nico Schedel 6 years ago
parent 043199cc9e
commit 4c25bb2533

@ -166,8 +166,8 @@ $d->fill_element('#fraud_interval_notify', 'css', 'mymail@example.org');
$d->find_element('#save', 'css')->click();
diag("Check Fraud Limit details");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Fraud settings successfully changed!', "Correct Alert was shown");
$d->find_element('//*[@id="toggle-accordions"]')->click();
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Fraud settings successfully changed!', 'Correct Alert was shown');
$d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[contains(text(),"Fraud Limits")]'));
ok($d->find_element_by_xpath('//*[@id="collapse_fraud"]//table//tr//td[contains(text(), "Monthly Settings")]/../td[contains(text(), "100")]'), "Limit is correct");
ok($d->wait_for_text('//*[@id="collapse_fraud"]//table//tr//td[contains(text(), "Monthly Settings")]/../td[4]', 'mymail@example.org'), "Mail is correct");
@ -197,10 +197,10 @@ diag("Set valid Cash Balance");
$d->fill_element('//*[@id="cash_balance"]', 'xpath', '200');
$d->fill_element('//*[@id="free_time_balance"]', 'xpath', '300');
$d->find_element('//*[@id="save"]')->click();
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Account balance successfully changed!', "Correct Alert was shown");
diag("Check if Cash Balance was set correctly");
$d->find_element('//*[@id="toggle-accordions"]')->click();
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Account balance successfully changed!', 'Correct Alert was shown');
$d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[contains(text(), "Contract Balance")]'));
ok($d->find_element_by_xpath('//*[@id="collapse_balance"]//table//tr//td//b[contains(text(), "200.00")]'), "Cash Balance is correct");
ok($d->find_element_by_xpath('//*[@id="collapse_balance"]//table//tr//td//b[contains(text(), "300")]'), "Free-Time Balance is correct");
@ -217,10 +217,10 @@ ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Amount field i
diag("Top-up Cash");
$d->fill_element('//*[@id="amount"]', 'xpath', '200');
$d->find_element('//*[@id="save"]')->click();
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Top-up using cash performed successfully!', "Correct Alert was shown");
diag("Check if Top-up was successful");
$d->find_element('//*[@id="toggle-accordions"]')->click();
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Top-up using cash performed successfully!', 'Correct Alert was shown');
$d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[contains(text(), "Contract Balance")]'));
ok($d->find_element_by_xpath('//*[@id="collapse_balance"]//table//tr//td//b[contains(text(), "400.00")]'), "Cash Balance is correct");
ok($d->find_element_by_xpath('//*[@id="collapse_balance"]//table//tr//td//b[contains(text(), "300")]'), "Free-Time Balance is correct");
@ -239,9 +239,9 @@ $d->fill_element('//*[@id="name"]', 'xpath', 'Tester');
$d->fill_element('//*[@id="number"]', 'xpath', '0123456789');
$d->find_element('//*[@id="save"]')->click();
diag("Search for Phonebook Entry");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Phonebook entry successfully created', "Correct Alert was shown");
diag("Search Phonebook entry");
$d->find_element('//*[@id="toggle-accordions"]')->click();
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Phonebook entry successfully created', 'Correct Alert was shown');
$d->fill_element('//*[@id="phonebook_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#phonebook_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="phonebook_table_filter"]/label/input', 'xpath', 'Tester');
@ -258,9 +258,9 @@ $d->fill_element('//*[@id="name"]', 'xpath', 'TesterTester');
$d->fill_element('//*[@id="number"]', 'xpath', '987654321');
$d->find_element('//*[@id="save"]')->click();
diag("Check if information has changed");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Phonebook entry successfully updated', "Correct Alert was shown");
diag("Check Phonebook entry details");
$d->find_element('//*[@id="toggle-accordions"]')->click();
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Phonebook entry successfully updated', 'Correct Alert was shown');
$d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[contains(text(),"Phonebook")]'));
ok($d->find_element_by_xpath('//*[@id="phonebook_table"]/tbody/tr[1]/td[contains(text(), "TesterTester")]'), "Name is correct");
ok($d->find_element_by_xpath('//*[@id="phonebook_table"]/tbody/tr[1]/td[contains(text(), "987654321")]'), "Number is correct");
@ -313,9 +313,9 @@ $d->fill_element('//*[@id="blocks.0.row.ip"]', 'xpath', '127.0.0.1');
$d->fill_element('//*[@id="blocks.0.row.mask"]', 'xpath', '16');
$d->find_element('//*[@id="save"]')->click();
diag("Search for Location");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Location successfully created', "Correct Alert was shown");
diag("Search Location");
$d->find_element('//*[@id="toggle-accordions"]')->click();
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Location successfully created', 'Correct Alert was shown');
$d->fill_element('//*[@id="locations_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#locations_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="locations_table_filter"]/label/input', 'xpath', 'Test Location');
@ -337,9 +337,9 @@ $d->fill_element('//*[@id="blocks.1.row.mask"]', 'xpath', '16');
$d->find_element('//*[@id="save"]')->click();
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Location successfully updated', "Correct Alert was shown");
diag("Check location details");
$d->find_element('//*[@id="customer_details"]//div//div//a[contains(text(),"Locations")]')->click();
diag("Check Location details");
$d->find_element('//*[@id="toggle-accordions"]')->click();
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Location successfully updated', 'Correct Alert was shown');
$d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//div//a[contains(text(),"Locations")]'));
ok($d->find_element_by_xpath('//*[@id="locations_table"]/tbody/tr[1]/td[contains(text(), "TestTest Location")]'), "Name is correct");
ok($d->find_element_by_xpath('//*[@id="locations_table"]/tbody/tr[1]/td[contains(text(), "This is a very Test Location")]'), "Description is correct");

Loading…
Cancel
Save