controller_peering.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: I233967e4cc9729c56dfc9cd7583249d44103d4a1
(cherry picked from commit 7699e25d78)
diag("Search for the newly created Peering Group");
diag("Search for the newly created Peering Group");
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Peering group successfully created","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Peering group successfully created","Correct Alert was shown");
diag("Search for the newly created Peering Group");
diag("Search for the newly created Peering Group");
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Peering group successfully updated","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Peering group successfully updated","Correct Alert was shown");
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Inbound peering rule successfully changed","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Inbound peering rule successfully changed","Correct Alert was shown");
ok($d->find_element_by_xpath('//*[@id="InboundPeeringRules_table"]/tbody/tr/td[contains(text(), "^sup")]'),"Pattern is correct");
ok($d->find_element_by_xpath('//*[@id="InboundPeeringRules_table"]/tbody/tr/td[contains(text(), "^sup")]'),"Pattern is correct");
ok($d->find_element_by_xpath('//*[@id="InboundPeeringRules_table"]/tbody/tr/td[contains(text(), "404")]'),"Reject Code is correct");
ok($d->find_element_by_xpath('//*[@id="InboundPeeringRules_table"]/tbody/tr/td[contains(text(), "404")]'),"Reject Code is correct");
ok($d->find_element_by_xpath('//*[@id="InboundPeeringRules_table"]/tbody/tr/td[contains(text(), "not found")]'),"Reject Reason is correct");
ok($d->find_element_by_xpath('//*[@id="InboundPeeringRules_table"]/tbody/tr/td[contains(text(), "not found")]'),"Reject Reason is correct");
@ -183,7 +183,7 @@ ok($d->find_text('Peering server successfully created'), 'Text "Peering server s
my$server_rules_uri=$d->get_current_url();
my$server_rules_uri=$d->get_current_url();
diag("Check Peering Server Details");
diag("Check Peering Server Details");
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Peering server successfully created","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Peering server successfully created","Correct Alert was shown");
ok($d->wait_for_text('//*[@id="peering_servers_table"]/tbody/tr/td[2]',$servername),"Name is correct");
ok($d->wait_for_text('//*[@id="peering_servers_table"]/tbody/tr/td[2]',$servername),"Name is correct");
ok($d->find_element_by_xpath('//*[@id="peering_servers_table"]/tbody/tr/td[contains(text(), "10.0.0.100")]'),"IP is correct");
ok($d->find_element_by_xpath('//*[@id="peering_servers_table"]/tbody/tr/td[contains(text(), "10.0.0.100")]'),"IP is correct");
ok($d->find_element_by_xpath('//*[@id="peering_servers_table"]/tbody/tr/td[contains(text(), "sipwise.com")]'),"Host is correct");
ok($d->find_element_by_xpath('//*[@id="peering_servers_table"]/tbody/tr/td[contains(text(), "sipwise.com")]'),"Host is correct");
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Peering server successfully updated","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Peering server successfully updated","Correct Alert was shown");
ok($d->wait_for_text('//*[@id="peering_servers_table"]/tbody/tr/td[2]',$servername),"Name is correct");
ok($d->wait_for_text('//*[@id="peering_servers_table"]/tbody/tr/td[2]',$servername),"Name is correct");
ok($d->find_element_by_xpath('//*[@id="peering_servers_table"]/tbody/tr/td[contains(text(), "10.0.1.101")]'),"IP is correct");
ok($d->find_element_by_xpath('//*[@id="peering_servers_table"]/tbody/tr/td[contains(text(), "10.0.1.101")]'),"IP is correct");
ok($d->find_element_by_xpath('//*[@id="peering_servers_table"]/tbody/tr/td[contains(text(), "google.at")]'),"Host is correct");
ok($d->find_element_by_xpath('//*[@id="peering_servers_table"]/tbody/tr/td[contains(text(), "google.at")]'),"Host is correct");
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Preference inbound_upn successfully updated","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Preference inbound_upn successfully updated","Correct Alert was shown");
ok($d->wait_for_text('//table//td[contains(text(), "inbound_upn")]/../td/select/option[@selected="selected"]',"P-Asserted-Identity"),"Value has been applied");
ok($d->wait_for_text('//table//td[contains(text(), "inbound_upn")]/../td/select/option[@selected="selected"]',"P-Asserted-Identity"),"Value has been applied");
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Peering server successfully deleted","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Peering server successfully deleted","Correct Alert was shown");
diag('Checking if Testing Group has been deleted');
diag('Checking if Testing Group has been deleted');
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"Peering Group successfully deleted","Correct Alert was shown");
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(),"Peering Group successfully deleted","Correct Alert was shown");