controller_subscriber.t:
- sometimes, alerts wont get displayed in this test, which causes the script
to crash completley. it will now print a error message instead of crashing
the entire test
Change-Id: I3e8d1e98e38b2545839f127307f2a3696fefc59c
(cherry picked from commit 94d034e239)
ok($d->find_element_by_css('#subscribers_table tr > td.dataTables_empty'),'Table is empty');
@ -105,7 +105,7 @@ $d->fill_element('//*[@id="description"]', 'xpath', 'This is a description. It d
$d->find_element('//*[@id="save"]')->click();
diag('Trying to find Subscriber profile set');
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Subscriber profile set successfully created","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Subscriber profile set successfully created","Correct Alert was shown");
@ -123,7 +123,7 @@ $d->fill_element('//*[@id="description"]', 'xpath', 'Very Good description here'
$d->find_element('//*[@id="save"]')->click();
diag('Trying to find Subscriber profile set');
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Subscriber profile set successfully updated","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Subscriber profile set successfully updated","Correct Alert was shown");
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Successfully updated subscriber","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Successfully updated subscriber","Correct Alert was shown");
#ok($d->find_element_by_xpath('//div[text()[contains(., "Subscriber status is locked")]]'), 'Message "Subscriber status is locked" was shown');
#ok($d->find_element_by_xpath('//div[text()[contains(., "Subscriber is locked for global")]]'), 'Message "Subscriber is locked for global" was shown');
ok($d->find_element_by_xpath('//*[@id="subscribers_table"]//tr//td[contains(text(), "Status")]/../td[contains(text(), "locked")]'),"Status is correct");
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Successfully updated subscriber","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Successfully updated subscriber","Correct Alert was shown");
ok($d->find_element_by_xpath('//*[@id="subscribers_table"]//tr//td[contains(text(), "Status")]/../td[contains(text(), "active")]'),"Status is correct");
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Preference language successfully updated","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Preference language successfully updated","Correct Alert was shown");
ok($d->find_element_by_xpath('//table//tr/td[contains(text(), "language")]/../td/select/option[contains(text(), "German") and @selected="selected"]'),'"German" has been selected');
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Successfully saved Call Forward","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Successfully saved Call Forward","Correct Alert was shown");
ok($d->find_element_by_xpath('//*[@id="preferences_table_cf"]/tbody/tr[1]/td[contains(text(), '.$bsetname.')]'),'B-Set was selected');
ok($d->find_element_by_xpath('//*[@id="preferences_table_cf"]/tbody/tr[1]/td[contains(text(), '.$destinationname.')]'),'Destination set was selected');
diag('Check if Subscriber Profile Set has been deleted');
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Subscriber profile set successfully deleted","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Subscriber profile set successfully deleted","Correct Alert was shown");