noteable changes:
- added function wait_for_attribute, which will pause the script until a
elements attribute changes to a desired value
- move_action is no longer available, was replaced with ActionChains
- fill_element now scrolls to element when it needs to. removed unnecessary
scroll_to_element lines with it
- there are now checks if a edit window is opened, to prevent
element_not_interactable exception
- some checks needed sleep(1), else the test would be redirected to a totaly
wrong page
- added some checks to see if test is on the right page, to prevent failing
alert checks
Change-Id: Ic516fbd1c5bc94bd8b7cb21b1d6bd089d8880fdf
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),'Contact successfully changed',"Correct Alert was shown");
ok($d->wait_for_text('//*[@id="collapse_contact"]//table//tr//td[contains(text(), "Email")]/../td[2]',$contactmail),"Email is correct");
ok($d->find_element_by_xpath('//*[@id="collapse_contact"]//table//tr//td[contains(text(), "Name")]/../td[contains(text(), "Alice")]'),"Name is correct");
ok($d->find_element_by_xpath('//*[@id="collapse_contact"]//table//tr//td[contains(text(), "Address")]/../td[text()[contains(.,"Frunze Square")]]'),"Street is correct");
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");
$d->move_and_click('//table//tr//td[contains(text(), "emergency_mapping_container")]/../td//a[contains(text(), "Edit")]','xpath','//*[@id="preference_groups"]//div//a[contains(text(), "NAT and Media Flow Control")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'),"Edit Window has been opened");
is($d->get_text('//*[@id="content"]//div[contains(@class, "alert")]'),"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->find_element_by_xpath('//*[@id="subscribers_table"]//tr//td[contains(text(), "Status")]/../td[contains(text(), "locked")]'),"Status is correct");
@ -106,7 +106,7 @@ $d->fill_element('//*[@id="event_table_filter"]/label/input', 'xpath', 'Hello, i
diag("Check Details");
ok($d->wait_for_text('//*[@id="event_table"]/tbody/tr[1]/td[2]','Hello, im a special Event =)'),"Description is correct");
ok($d->wait_for_text('//*[@id="event_table"]/tbody/tr[1]/td[3]','every week from 2019-01-01 12:00:00 to 2019-06-05 12:20:00'),"Date/Time is correct");
ok($d->wait_for_text('//*[@id="event_table"]/tbody/tr[1]/td[3]','every week on Monday from 2019-01-01 12:00:00 to 2019-06-05 12:20:00'),"Date/Time is correct");
ok($d->wait_for_text('//*[@id="event_table"]/tbody/tr[1]/td[2]','Very important event'),"Description is correct");
ok($d->wait_for_text('//*[@id="event_table"]/tbody/tr[1]/td[3]','every week from 2020-06-01 12:00:00 to 2020-07-01 13:00:00'),"Date/Time is correct");
ok($d->wait_for_text('//*[@id="event_table"]/tbody/tr[1]/td[3]','every week on Monday from 2020-06-01 12:00:00 to 2020-07-01 13:00:00'),"Date/Time is correct");