TT#68016 selenium: check if edit windows are opened

check title of edit windows to see if said windows are open and useable

Change-Id: I128233a2d3750583f1c076e8a39878d10debf1e7
changes/45/34945/2
Nico Schedel 6 years ago
parent fa3feb531f
commit ba3a2b158e

@ -33,6 +33,7 @@ diag("Try to create a new Administrator");
$d->find_element('Create Administrator', 'link_text')->click();
diag("Save without entering anything");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Administrator")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="reselleridtable"]/tbody/tr[1]/td[5]/input');
$d->find_element('//*[@id="save"]')->click();
@ -69,6 +70,7 @@ ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[7][contai
diag("Edit Administrator details. Enable read-only setting");
$adminname = ("admin" . int(rand(100000)) . "test");
$d->move_and_click('//*[@id="administrator_table"]//tr[1]/td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="administrator_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Administrator")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="login"]', 'xpath', $adminname);
$d->scroll_to_element($d->find_element('//*[@id="is_superuser"]'));
$d->select_if_unselected('//*[@id="read_only"]');
@ -125,6 +127,7 @@ ok($d->find_element_by_css('#administrator_table tr > td.dataTables_empty', 'css
$d->fill_element('//*[@id="administrator_table_filter"]/label/input', 'xpath', $adminname);
ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[contains(text(), "' . $adminname .'")]'), 'Administrator found');
$d->move_and_click('//*[@id="administrator_table"]//tr[1]/td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="administrator_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Administrator")]'), 'Edit window has been opened');
$d->scroll_to_element($d->find_element('//*[@id="is_superuser"]'));
$d->find_element('//*[@id="is_active"]')->click();
$d->find_element('//*[@id="save"]')->click();
@ -160,6 +163,7 @@ ok($d->find_element_by_css('#administrator_table tr > td.dataTables_empty', 'css
$d->fill_element('//*[@id="administrator_table_filter"]/label/input', 'xpath', $adminname);
ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[contains(text(), "' . $adminname . '")]'), 'Administrator found');
$d->move_and_click('//*[@id="administrator_table"]/tbody/tr[1]/td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="administrator_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Administrator")]'), 'Edit window has been opened');
$d->scroll_to_element($d->find_element('//*[@id="is_superuser"]'));
$d->select_if_unselected('//*[@id="is_superuser"]');
$d->select_if_unselected('//*[@id="is_master"]');

@ -28,6 +28,7 @@ $c->create_billing_profile($billingname, $resellername);
diag("Try to create an empty Billing Profile");
$d->find_element('Create Billing Profile', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Billing Profile")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -46,8 +47,9 @@ ok($d->find_element_by_xpath('//*[@id="billing_profile_table"]/tbody/tr/td[2][co
ok($d->find_element_by_xpath('//*[@id="billing_profile_table"]/tbody/tr/td[3][contains(text(), "' . $resellername . '")]'), 'Reseller name is correct');
diag("Edit Billing Profile");
$d->move_and_click('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="billing_profile_table_filter"]//input');
$billingname = ("billing" . int(rand(100000)) . "test");
$d->move_and_click('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="billing_profile_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Billing Profile")]'), 'Edit window has been opened');
$d->fill_element('#name', 'css', $billingname);
$d->select_if_unselected('//*[@id="prepaid"]');
$d->fill_element('#interval_charge', 'css', '3.2');
@ -70,6 +72,7 @@ $d->find_element('Edit Zones', 'link_text')->click();
diag("Create a Billing Zone");
$d->find_element('Create', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Billing Zone")]'), 'Edit window has been opened');
diag("Save without entering anything");
$d->find_element('//*[@id="save"]')->click();
@ -97,6 +100,7 @@ diag("Create a Billing Fee");
$d->find_element('Create Fee Entry', 'link_text')->click();
diag("Save without entering anything");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Billing Fee")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="billing_zoneidtable"]//tr[1]/td[4]/input');
$d->find_element('//*[@id="save"]')->click();
@ -150,6 +154,7 @@ ok($d->find_element_by_xpath('//*[@id="billing_fee_table"]//tr[1]/td[contains(te
diag("Edit Billing Fee");
$d->move_and_click('//*[@id="billing_fee_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="billing_fee_table_filter"]/label/input');
$d->move_and_click('//*[@id="direction"]', 'xpath', '//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Billing Fee")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Billing Fee")]'), 'Edit window has been opened');
$d->find_element('//*[@id="direction"]/option[@value="in"]')->click();
$d->find_element('//*[@id="save"]')->click();
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Billing fee successfully changed!', 'Correct Alert was shown');
@ -173,6 +178,7 @@ ok($d->find_element_by_xpath('//*[@id="billing_profile_table"]//tr[1]/td[contain
$d->move_and_click('//*[@id="billing_profile_table"]//tr[1]//td//a[contains(text(), "Duplicate")]', 'xpath', '//*[@id="billing_profile_table_filter"]//input');
diag("Fill in clone details");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Duplicate Billing Profile")]'), 'Edit window has been opened');
my $clonename = ("billing" . int(rand(100000)) . "test");
$d->fill_element('//*[@id="handle"]', 'xpath', $clonename);
$d->fill_element('//*[@id="name"]', 'xpath', $clonename);
@ -302,6 +308,7 @@ diag("Create a Date Definition");
$d->find_element('Create Special Off-Peak Date', 'link_text')->click();
diag("Save without entering anything");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Date Definition")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -333,6 +340,7 @@ ok($d->find_element_by_xpath('//*[@id="date_definition_table"]//tr[1]/td[contain
diag("Edit Date Definition");
$d->move_and_click('//*[@id="date_definition_table"]/tbody/tr/td[4]/div/a[1]', 'xpath', '//div[contains(@class, "dataTables_filter")]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Date Definition")]'), 'Edit window has been opened');
$d->fill_element('#start', 'css', "2018-01-01 00:00:00");
$d->fill_element('#end', 'css', "2019-01-01 23:59:59");
$d->find_element('#save', 'css')->click();
@ -374,6 +382,7 @@ $d->find_element('Billing Networks', 'link_text')->click();
diag("Try to create an empty Billing Network");
$d->find_element('Create Billing Network', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Billing Network")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -419,6 +428,7 @@ ok($d->find_element_by_xpath('//*[@id="networks_table"]//tr[1]/td[contains(text(
diag("Edit Billing Network");
$billingnetwork = ("billing" . int(rand(100000)) . "network");
$d->move_and_click('//*[@id="networks_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="networks_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Billing Network")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $billingnetwork);
$d->fill_element('//*[@id="description"]', 'xpath', 'also good description');

@ -44,6 +44,7 @@ if($pbx == 1){
diag("Try to create an empty Customer");
$d->find_element('Create Customer', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Customer")]'), 'Edit window has been opened');
$d->scroll_to_element($d->find_element('//table[@id="contactidtable"]/tbody/tr[1]/td//input[@type="checkbox"]'));
$d->unselect_if_selected('//table[@id="contactidtable"]/tbody/tr[1]/td//input[@type="checkbox"]');
$d->scroll_to_element($d->find_element('//table[@id="billing_profileidtable"]/tbody/tr[1]/td//input[@type="checkbox"]'));
@ -82,6 +83,7 @@ ok($d->find_element_by_xpath('//*[@id="Customer_table"]//tr[1]/td[contains(text(
$d->move_and_click('//*[@id="Customer_table"]/tbody/tr[1]//td//div//a[contains(text(),"Edit")]', 'xpath', '//*[@id="Customer_table_filter"]//input');
diag("Set status to 'active'");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Customer")]'), 'Edit window has been opened');
$d->scroll_to_element($d->find_element('//*[@id="status"]'));
$d->find_element('//*[@id="status"]/option[contains(text(), "active")]')->click();
$d->find_element('#save', 'css')->click();
@ -109,6 +111,7 @@ diag("Edit Contact");
$d->find_element('//*[@id="toggle-accordions"]')->click();
$d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[contains(text(),"Contact Details")]'));
$d->find_element('//div[contains(@class,"accordion-body")]//*[contains(@class,"btn-primary") and contains(text(),"Edit Contact")]')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Contact")]'), 'Edit window has been opened');
$d->fill_element('div.modal #firstname', 'css', "Alice");
$d->fill_element('#company', 'css', 'Sipwise');
ok($d, 'Inserting name works');
@ -144,6 +147,7 @@ $d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[cont
$d->move_and_click('//*[@id="collapse_fraud"]//table//tr//td[text()[contains(.,"Monthly Settings")]]/../td//a[text()[contains(.,"Edit")]]', 'xpath', '//*[@id="customer_details"]//div//a[contains(text(),"Fraud Limits")]');
diag("Fill in invalid values");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Settings")]'), 'Edit window has been opened');
$d->fill_element('#fraud_interval_limit', 'css', "invalid");
$d->fill_element('#fraud_interval_notify', 'css', 'stuff');
$d->find_element('#save', 'css')->click();
@ -169,6 +173,7 @@ $d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[cont
diag("Set Cash Balance without entering anything");
$d->find_element('//*[@id="collapse_balance"]//div//span//a[contains(text(), "Set Cash Balance")]')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Settings")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="cash_balance"]', 'xpath', ' ');
$d->fill_element('//*[@id="free_time_balance"]', 'xpath', ' ');
$d->find_element('//*[@id="save"]')->click();
@ -203,6 +208,7 @@ diag("Top-up Cash Balance");
$d->find_element('//*[@id="collapse_balance"]//div//span//a[contains(text(), "Top-up Cash")]')->click();
diag("Perform Top-up without entering anything");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Settings")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -223,6 +229,7 @@ ok($d->find_element_by_xpath('//*[@id="topup_logs_table"]//tr//td[contains(text(
diag("Create a new empty Phonebook entry");
$d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[contains(text(),"Phonebook")]'));
$d->find_element('Create Phonebook Entry', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Phonebook")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -247,8 +254,7 @@ ok($d->find_element_by_xpath('//*[@id="phonebook_table"]//tr[1]/td[contains(text
diag("Edit Phonebook entry");
$d->move_and_click('//*[@id="phonebook_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="customer_details"]//div//a[contains(text(), "Phonebook")]');
diag("Change Information");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Phonebook")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', 'TesterTester');
$d->fill_element('//*[@id="number"]', 'xpath', '987654321');
$d->find_element('//*[@id="save"]')->click();
@ -260,11 +266,10 @@ $d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[cont
ok($d->find_element_by_xpath('//*[@id="phonebook_table"]//tr[1]/td[contains(text(), "TesterTester")]'), 'Name is correct');
ok($d->find_element_by_xpath('//*[@id="phonebook_table"]//tr[1]/td[contains(text(), "987654321")]'), 'Number is correct');
diag("Create a new Location");
diag("Create a new empty Location");
$d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[contains(text(), "Locations")]'));
$d->find_element('Create Location', 'link_text')->click();
diag("Try to create an empty Location");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Location")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -320,6 +325,7 @@ ok($d->find_element_by_xpath('//*[@id="locations_table"]//tr[1]/td[contains(text
diag("Edit Location and add another Location block");
$d->move_and_click('//*[@id="locations_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="customer_details"]//div//a[contains(text(), "Locations")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Settings")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="description"]', 'xpath', 'This is a very Test Location');
$d->fill_element('//*[@id="name"]', 'xpath', 'TestTest Location');
$d->fill_element('//*[@id="blocks.0.row.ip"]', 'xpath', '10.0.0.138');

@ -21,6 +21,7 @@ $c->create_domain($domainstring);
diag("Try to create an empty Domain");
$d->find_element('Create Domain', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Domain")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -67,9 +68,9 @@ ok($d->find_element_by_xpath('//table//tr/td[contains(text(), "concurrent_max")]
diag("Edit preference 'allowed_ips'");
$d->move_and_click('//table/tbody/tr/td[contains(text(), "allowed_ips")]/../td/div/a[contains(text(), "Edit")]', 'xpath', '//table/tbody/tr/td[contains(text(), "man_allowed_ips")]/../td/div/a[contains(text(), "Edit")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
diag("Enter an IP address");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->find_element('//*[@id="add"]')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]//div//span[contains(text(), "Invalid IPv4 or IPv6 address")]'), 'Invalid IP address detected');
$d->fill_element('//*[@id="allowed_ips"]', 'xpath', '127.0.0.0.0');
@ -122,12 +123,10 @@ is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Pre
$d->find_element('//*[@id="toggle-accordions"]')->click();
ok($d->find_element_by_xpath('//table//tr/td[contains(text(), "transcode_opus_mono")]/../td//input[@checked="checked"]'), 'Opus Mono was enabled');
diag("Change Opus Mono Bitrate");
diag("Change Opus Mono Bitrate to 32 kbit/s");
$d->scroll_to_element($d->find_element('//table//tr/td[contains(text(), "transcode_opus_mono")]'));
$d->move_and_click('//table//tr/td[contains(text(), "opus_mono_bitrate")]/../td//a[contains(text(), "Edit")]', 'xpath', '//table//tr/td[contains(text(), "opus_stereo_bitrate")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
diag("Change to 32 kbit/s");
$d->move_and_click('//*[@id="opus_mono_bitrate"]', 'xpath', '//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]');
$d->find_element('//*[@id="opus_mono_bitrate"]/option[contains(text(), "32")]')->click();
$d->find_element('//*[@id="save"]')->click();
@ -149,12 +148,10 @@ is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Pre
$d->find_element('//*[@id="toggle-accordions"]')->click();
ok($d->find_element_by_xpath('//table//tr/td[contains(text(), "transcode_opus_stereo")]/../td//input[@checked="checked"]'), 'Opus Stereo was enabled');
diag("Change Opus Stereo Bitrate");
diag("Change Opus Stereo Bitrate to 32 kbit/s");
$d->scroll_to_element($d->find_element('//table//tr/td[contains(text(), "transcode_opus_stereo")]'));
$d->move_and_click('//table//tr/td[contains(text(), "opus_stereo_bitrate")]/../td//a[contains(text(), "Edit")]', 'xpath', '//table//tr/td[contains(text(), "opus_mono_bitrate")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
diag("Change to 32 kbit/s");
$d->move_and_click('//*[@id="opus_stereo_bitrate"]', 'xpath', '//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]');
$d->find_element('//*[@id="opus_stereo_bitrate"]/option[contains(text(), "32")]')->click();
$d->find_element('//*[@id="save"]')->click();

@ -29,6 +29,7 @@ $d->find_element('Emergency Mappings', 'link_text')->click();
diag("Try to create an empty Emergency Container");
$d->find_element('Create Emergency Container', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Emergency Container")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="reselleridtable"]//tr[1]//td//input');
$d->find_element('//*[@id="save"]')->click();
@ -58,6 +59,7 @@ ok($d->find_element_by_xpath('//*[@id="emergency_containers_table"]//tr[1]/td[co
diag("Edit Emergency Container name");
$containername = ("emergency" . int(rand(100000)) . "container");
$d->move_and_click('//*[@id="emergency_containers_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="emergency_containers_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Emergency Container")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $containername);
$d->find_element('//*[@id="save"]')->click();
@ -73,6 +75,7 @@ ok($d->find_element_by_xpath('//*[@id="emergency_containers_table"]//tr[1]/td[co
diag("Try to create a empty Emergency Mapping");
$d->find_element('Create Emergency Mapping', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Emergency Mapping")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="emergency_containeridtable"]//tr[1]//td//input');
$d->find_element('//*[@id="save"]')->click();
@ -104,6 +107,7 @@ ok($d->find_element_by_xpath('//*[@id="emergency_mappings_table"]//tr[1]/td[cont
diag("Edit Emergency Mapping Details");
$d->move_and_click('//*[@id="emergency_mappings_table"]/tbody/tr[1]/td[6]/div/a[2]', 'xpath', '//*[@id="emergency_mappings_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Emergency Mapping")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="code"]', 'xpath', "144");
$d->fill_element('//*[@id="prefix"]', 'xpath', "E2_144_");
$d->find_element('//*[@id="save"]')->click();
@ -136,7 +140,7 @@ $d->find_element('//*[@id="toggle-accordions"]')->click();
diag("Edit setting 'emergency_mapping_container'");
$d->scroll_to_element($d->find_element('//table//tr//td[contains(text(), "emergency_mapping_container")]'));
$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");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), "Edit window has been opened");
$d->move_and_click('//*[@id="emergency_mapping_container"]', 'xpath', '//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]');
$d->find_element('//*[@id="emergency_mapping_container"]/option[contains(text(), "' . $containername . '")]')->click();
$d->find_element('//*[@id="save"]')->click();
@ -149,7 +153,7 @@ ok($d->find_element_by_xpath('//table//tr//td[contains(text(), "emergency_mappin
diag("Edit setting 'emergency_mode_enabled'");
$d->scroll_to_element($d->find_element('//table//tr//td[contains(text(), "emergency_mode_enabled")]'));
$d->move_and_click('//table//tr//td[contains(text(), "emergency_mode_enabled")]/../td//a[contains(text(), "Edit")]', 'xpath', '//table//tr//td[contains(text(), "call_deflection")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit Window has been opened');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->select_if_unselected('//*[@id="emergency_mode_enabled"]');
$d->find_element('//*[@id="save"]')->click();

@ -31,8 +31,9 @@ diag("Go to 'Header Manipulations' page");
$d->find_element('//*[@id="main-nav"]//*[contains(text(),"Settings")]')->click();
$d->find_element('Header Manipulations', 'link_text')->click();
diag("Try to create a empty Header Rule Set");
diag("Try to create an empty Header Rule Set");
$d->find_element('Create Header Rule Set', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Header Rule Set")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="reselleridtable"]/tbody/tr[1]/td[5]/input', 'xpath');
$d->find_element('//*[@id="save"]')->click();
@ -64,6 +65,7 @@ ok($d->find_element_by_xpath('//*[@id="header_rule_set_table"]//tr[1]//td[contai
diag("Edit Header Rule Set");
$headername = ("header" . int(rand(100000)) . "manipuls");
$d->move_and_click('//*[@id="header_rule_set_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="header_rule_set_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Header Rule Set")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $headername);
$d->fill_element('//*[@id="description"]' , 'xpath', 'This is a very nice description');
$d->find_element('//*[@id="save"]')->click();
@ -82,8 +84,9 @@ ok($d->find_element_by_xpath('//*[@id="header_rule_set_table"]//tr[1]//td[contai
diag("Go to 'Header Rule Set Rules' page");
$d->move_and_click('//*[@id="header_rule_set_table"]//tr[1]//td//a[contains(text(), "Rules")]', 'xpath', '//*[@id="header_rule_set_table_filter"]/label/input');
diag("Try to create a empty Header Rule");
diag("Try to create an empty Header Rule");
$d->find_element('Create Header Rule', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Header Rule")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -107,6 +110,7 @@ ok($d->find_element_by_xpath('//*[@id="header_rules_table"]//tr[1]//td[contains(
diag("Edit Header Rule");
$headerrule = ("header" . int(rand(100000)) . "rule");
$d->move_and_click('//*[@id="header_rules_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="header_rules_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Header Rule")]'), 'Edit window has been opened');
$d->find_element('//*[@id="priority"]')->click();
sleep 1;
$d->fill_element('//*[@id="priority"]', 'xpath', '1');
@ -127,6 +131,7 @@ ok($d->find_element_by_xpath('//*[@id="header_rules_table"]//tr[1]//td[contains(
diag("Create a Second Header Rule");
$d->find_element("Create Header Rule", 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Header Rule")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', 'second');
$d->fill_element('//*[@id="description"]', 'xpath', 'this is a nice description');+
$d->find_element('//*[@id="save"]')->click();
@ -139,7 +144,7 @@ $d->move_and_click('//*[@id="header_rules_table"]//tr[2]//td//a[1]', 'xpath', '/
diag("Check if entry has moved up");
ok($d->find_element_by_xpath('//*[@id="header_rules_table"]//tr[1]/td[contains(text(), "second")]'), "Entry has been moved");
diag("Delete second Header Rule");
diag("Try to delete second Header Rule");
$d->fill_element('//*[@id="header_rules_table_filter"]//input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#header_rules_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="header_rules_table_filter"]//input', 'xpath', 'second');
@ -157,8 +162,9 @@ $d->fill_element('//*[@id="header_rules_table_filter"]//input', 'xpath', $header
$d->move_and_click('//*[@id="header_rules_table"]//tr[1]//td//a[contains(text(), "Conditions")]', 'xpath', '//*[@id="header_rules_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="masthead"]//div//h2[contains(text(), "Header Rule Conditions for ' . $headerrule . '")]'), "We are on the correct page");
diag("Try to create a empty Header Rule Condition");
diag("Try to create an empty Header Rule Condition");
$d->find_element('Create Header Rule Condition', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Header Rule Condition")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -184,6 +190,7 @@ ok($d->find_element_by_xpath('//*[@id="header_rule_conditions_table"]//tr[1]//td
diag("Edit Condition");
$headercondition = ("header" . int(rand(100000)) . "condition");
$d->move_and_click('//*[@id="header_rule_conditions_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="header_rule_conditions_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Header Rule Condition")]'), 'Edit window has been opened');
$d->find_element('//*[@id="match_type"]/option[@value="avp"]')->click();
$d->find_element('//*[@id="match_part"]/option[@value="port"]')->click();
$d->fill_element('//*[@id="match_name"]', 'xpath', $headercondition);
@ -210,7 +217,7 @@ ok($d->find_element_by_xpath('//*[@id="header_rule_conditions_table"]//tr[1]//td
ok($d->find_element_by_xpath('//*[@id="header_rule_conditions_table"]//tr[1]//td[contains(text(), "0")]'), 'Condition is disabled');
$d->refresh();
diag("Delete Header Rule Condition");
diag("Try to delete Header Rule Condition");
$d->fill_element('//*[@id="header_rule_conditions_table_filter"]//input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#header_rule_conditions_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="header_rule_conditions_table_filter"]//input', 'xpath', $headercondition);
@ -225,8 +232,9 @@ ok($d->find_element_by_css('#header_rule_conditions_table tr > td.dataTables_emp
diag("Go to 'Header Rule Actions' page");
$d->find_element('Actions', 'link_text')->click();
diag("Try to create a empty Header Rule Action");
diag("Try to create an empty Header Rule Action");
$d->find_element('Create Header Rule Action', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Header Rule Action")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -252,6 +260,7 @@ ok($d->find_element_by_xpath('//*[@id="header_rule_actions_table"]//tr[1]//td[co
diag("Edit Header Rule Action");
$headeraction = ("header" . int(rand(100000)) . "action");
$d->move_and_click('//*[@id="header_rule_actions_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="header_rule_actions_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Header Rule Action")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="c_header"]', 'xpath', $headeraction);
$d->find_element('//*[@id="header_part"]/option[@value="port"]')->click();
$d->find_element('//*[@id="action_type"]/option[@value="add"]')->click();
@ -274,6 +283,7 @@ ok($d->find_element_by_xpath('//*[@id="header_rule_actions_table"]//tr[1]//td[co
diag("Create a second Header Rule Action");
$d->find_element('Create Header Rule Action', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Header Rule Action")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="c_header"]', 'xpath', 'second');
$d->find_element('//*[@id="save"]')->click();
@ -285,7 +295,7 @@ $d->move_and_click('//*[@id="header_rule_actions_table"]//tr[2]//td//a[1]', 'xpa
diag("Check if Entry has moved up");
ok($d->find_element_by_xpath('//*[@id="header_rule_actions_table"]//tr[1]/td[contains(text(), "second")]'), 'Entry has been moved');
diag("Delete Header Rule Action");
diag("Try to delete Header Rule Action");
$d->fill_element('//*[@id="header_rule_actions_table_filter"]//input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#header_rule_actions_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="header_rule_actions_table_filter"]//input', 'xpath', $headeraction);
@ -302,7 +312,7 @@ diag("Go back to Header Manipulations");
$d->find_element('//*[@id="main-nav"]//*[contains(text(),"Settings")]')->click();
$d->find_element("Header Manipulations", 'link_text')->click();
diag("Delete Header Rule Set");
diag("Try to delete Header Rule Set");
$d->fill_element('//*[@id="header_rule_set_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#header_rule_set_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="header_rule_set_table_filter"]/label/input', 'xpath', $headername);

@ -33,8 +33,9 @@ diag("Go to 'Invoice Templates' page");
$d->find_element('//*[@id="main-nav"]//*[contains(text(),"Settings")]')->click();
$d->find_element('Invoice Templates', 'link_text')->click();
diag("Try to create a empty Invoice Template");
diag("Try to create an empty Invoice Template");
$d->find_element('Create Invoice Template', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Invoice Template")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="reselleridtable"]/tbody/tr[1]/td[5]/input');
$d->find_element('//*[@id="save"]')->click();
@ -62,9 +63,10 @@ ok($d->find_element_by_xpath('//*[@id="InvoiceTemplate_table"]//tr[1]/td[contain
ok($d->find_element_by_xpath('//*[@id="InvoiceTemplate_table"]//tr[1]/td[contains(text(), "' . $templatename . '")]'), 'Name is correct');
ok($d->find_element_by_xpath('//*[@id="InvoiceTemplate_table"]//tr[1]/td[contains(text(), "svg")]'), 'Type is correct');
diag("Try to edit Invoice Template");
diag("Edit Invoice Template");
$templatename = ("invoice" . int(rand(100000)) . "tem");
$d->move_and_click('//*[@id="InvoiceTemplate_table"]//tr[1]//td//a[contains(text(), "Edit Meta")]', 'xpath', '//*[@id="InvoiceTemplate_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Invoice Template")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $templatename);
$d->find_element('//*[@id="save"]')->click();
@ -92,6 +94,7 @@ my $custnum = $d->find_element('//*[@id="Customer_table"]/tbody/tr/td[1]')->get_
diag("Add Invoice Template to Customer");
$d->move_and_click('//*[@id="Customer_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="Customer_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Customer")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="invoice_templateidtable_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#invoice_templateidtable tr > td.dataTables_empty', 'css'), 'Garbage test not found');
$d->fill_element('//*[@id="invoice_templateidtable_filter"]/label/input', 'xpath', $templatename);
@ -117,6 +120,7 @@ $d->find_element('Invoices', 'link_text')->click();
diag("Try to create a empty Invoice");
$d->find_element('Create Invoice', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Invoice")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="templateidtable"]/tbody/tr[1]/td[4]/input');
$d->unselect_if_selected('//*[@id="contractidtable"]/tbody/tr[1]/td[6]/input');
$d->find_element('//*[@id="save"]')->click();

@ -33,6 +33,7 @@ $d->find_element('Number Porting', 'link_text')->click();
diag("Try to create an empty LNP Carrier");
$d->find_element('Create LNP Carrier', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create LNP Carrier")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -56,6 +57,7 @@ ok($d->find_element_by_xpath('//*[@id="lnp_carriers_table"]//tr[1]/td[contains(t
diag("Edit LNP Carrier");
$d->move_and_click('//*[@id="lnp_carriers_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="lnp_carriers_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit LNP Carrier")]'), 'Edit window has been opened');
$lnpcarrier = ("lnp" . int(rand(100000)) . "carrier");
$prefix = ("prefix" . int(rand(100000)) . "stuff");
$d->fill_element('//*[@id="name"]', 'xpath', $lnpcarrier);
@ -76,42 +78,44 @@ diag("Go to 'NCOS Levels' page");
$d->find_element('//*[@id="main-nav"]//*[contains(text(),"Settings")]')->click();
$d->find_element("NCOS Levels", 'link_text')->click();
diag("Trying to create a empty NCOS Level");
diag("Try to create an empty NCOS Level");
$d->find_element("Create NCOS Level", 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create NCOS Level")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="reselleridtable"]/tbody/tr[1]/td[5]/input', 'xpath');
$d->find_element('//*[@id="save"]')->click();
diag("Check Error Messages");
diag("Check error messages");
ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Reseller field is required")]'));
ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Level Name field is required")]'));
$d->find_element('//*[@id="mod_close"]')->click();
diag("Search our new NCOS");
diag("Search NCOS Level");
$d->fill_element('//*[@id="ncos_level_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#ncos_level_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="ncos_level_table_filter"]/label/input', 'xpath', $ncosname);
diag("Check NCOS details");
diag("Check NCOS Level details");
ok($d->find_element_by_xpath('//*[@id="ncos_level_table"]//tr[1]/td[contains(text(), ' . $resellername . ')]'), 'Reseller is correct');
ok($d->find_element_by_xpath('//*[@id="ncos_level_table"]//tr[1]/td[contains(text(), ' . $ncosname . ')]'), 'NCOS name is correct');
ok($d->find_element_by_xpath('//*[@id="ncos_level_table"]//tr[1]/td[contains(text(), "blacklist")]'), 'NCOS mode is correct');
ok($d->find_element_by_xpath('//*[@id="ncos_level_table"]//tr[1]/td[contains(text(), "This is a simple description")]'), 'NCOS description is correct');
diag("Edit NCOS");
$d->move_and_click('//*[@id="ncos_level_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="ncos_level_table_filter"]//input');
diag("Edit NCOS Level");
$ncosname = ("ncos" . int(rand(100000)) . "level");
$d->move_and_click('//*[@id="ncos_level_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="ncos_level_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit NCOS Level")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="level"]', 'xpath', $ncosname);
$d->find_element('//*[@id="mode"]/option[@value="whitelist"]')->click();
$d->fill_element('//*[@id="description"]', 'xpath', 'This is a very simple description');
$d->find_element('//*[@id="save"]')->click();
diag("Search NCOS");
diag("Search NCOS Level");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'NCOS level successfully updated', 'Correct Alert was shown');
$d->fill_element('//*[@id="ncos_level_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#ncos_level_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="ncos_level_table_filter"]/label/input', 'xpath', $ncosname);
diag("Check NCOS details");
diag("Check NCOS Level details");
ok($d->find_element_by_xpath('//*[@id="ncos_level_table"]//tr[1]/td[contains(text(), ' . $resellername . ')]'), 'Reseller is correct');
ok($d->find_element_by_xpath('//*[@id="ncos_level_table"]//tr[1]/td[contains(text(), ' . $ncosname . ')]'), 'NCOS name is correct');
ok($d->find_element_by_xpath('//*[@id="ncos_level_table"]//tr[1]/td[contains(text(), "whitelist")]'), "NCOS mode is correct");
@ -122,17 +126,15 @@ $d->move_and_click('//*[@id="ncos_level_table"]/tbody/tr[1]/td/div/a[contains(te
ok($d->find_element_by_xpath('//*[@id="masthead"]//div//h2[contains(text(), "NCOS details")]'), "We are on the correct page");
sleep 1;
diag("Create a new Pattern");
diag("Create a new empty Pattern");
$d->find_element('Create Pattern Entry', 'link_text')->click();
diag("Save Pattern");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Number Pattern")]'), "Edit window has been opened");
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Pattern field is required")]'));
diag("Enter Pattern details");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Number Pattern")]'), "Edit Window has been opened");
$d->fill_element('//*[@id="pattern"]', 'xpath', '^439');
$d->fill_element('//*[@id="description"]', 'xpath', 'Austrian Premium Numbers');
$d->find_element('//*[@id="save"]')->click();
@ -142,8 +144,9 @@ is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'NCO
ok($d->find_element_by_xpath('//*[@id="number_pattern_table"]//tr[1]/td[contains(text(), "^439")]'), 'Pattern is correct');
ok($d->find_element_by_xpath('//*[@id="number_pattern_table"]//tr[1]/td[contains(text(), "Austrian Premium Numbers")]'), 'Description is correct');
diag("Edit NCOS Pattern");
diag("Edit Pattern");
$d->move_and_click('//*[@id="number_pattern_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="number_pattern_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Number Pattern")]'), "Edit window has been opened");
$d->fill_element('//*[@id="pattern"]', 'xpath', '^491');
$d->fill_element('//*[@id="description"]', 'xpath', 'German Premium Numbers');
$d->find_element('//*[@id="save"]')->click();
@ -155,6 +158,7 @@ ok($d->find_element_by_xpath('//*[@id="number_pattern_table"]//tr[1]/td[contains
diag("Create LNP entry");
$d->find_element("Create LNP Entry", 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create LNP Carrier")]'), 'Edit window has been opened');
diag("Enter LNP details");
$d->fill_element('//*[@id="lnp_provideridtable_filter"]/label/input', 'xpath', 'thisshouldnotexist');
@ -172,6 +176,7 @@ ok($d->find_element_by_xpath('//*[@id="lnp_carriers_table"]//tr[1]/td[contains(t
diag("Edit LNP entry");
$d->move_and_click('//*[@id="lnp_carriers_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="lnp_carriers_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit LNP Carrier")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="description"]', 'xpath', 'Rule for LNP Carrier 2');
$d->find_element('//*[@id="save"]')->click();
@ -182,6 +187,7 @@ ok($d->find_element_by_xpath('//*[@id="lnp_carriers_table"]//tr[1]/td[contains(t
diag("Edit NCOS settings");
$d->find_element('//*[@id="number_patterns_extra"]//div//a')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Number Pattern")]'), 'Edit window has been opened');
$d->select_if_unselected('//*[@id="local_ac"]');
$d->find_element('//*[@id="save"]')->click();
@ -205,7 +211,7 @@ $d->scroll_to_element($d->find_element('//*[@id="preference_groups"]//div//a[con
diag("Edit setting 'NCOS'");
$d->move_and_click('//table//tr//td[contains(text(), "ncos")]/../td//a[contains(text(), "Edit")]', 'xpath', '//table//tr//td[contains(text(), "adm_cf_ncos")]/../td//a[contains(text(), "Edit")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit Window has been opened');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->move_and_click('//*[@id="ncos"]', 'xpath', '//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]');
$d->find_element('//*[@id="ncos"]/option[contains(text(), "' . $ncosname . '")]')->click();
$d->find_element('//*[@id="save"]')->click();
@ -215,11 +221,11 @@ is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Pre
$d->find_element('//*[@id="toggle-accordions"]')->click();
ok($d->find_element_by_xpath('//table//tr//td[contains(text(), "ncos")]/../td/select/option[contains(text(), "' . $ncosname . '")][@selected="selected"]'), 'NCOS Level was applied');
diag("Go back to NCOS interface");
diag("Go back to 'NCOS Levels' page");
$d->find_element('//*[@id="main-nav"]//*[contains(text(),"Settings")]')->click();
$d->find_element("NCOS Levels", 'link_text')->click();
diag("Search our new NCOS");
diag("Search NCOS Level");
$d->fill_element('//*[@id="ncos_level_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#ncos_level_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="ncos_level_table_filter"]/label/input', 'xpath', $ncosname);

@ -32,6 +32,7 @@ $d->find_element('Call List Suppressions', 'link_text')->click();
diag("Try to create an empty Call List Suppression");
$d->find_element('Create call list suppression', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Call List Suppression")]'), "Edit window has been opened");
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -107,6 +108,7 @@ $d->find_element('Phonebook', 'link_text')->click();
diag("Try to create an empty Phonebook entry");
$d->find_element('Create Phonebook Entry', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Phonebook")]'), "Edit window has been opened");
$d->unselect_if_selected('//*[@id="reselleridtable"]//tr[1]/td[5]/input');
$d->find_element('//*[@id="save"]')->click();
@ -181,6 +183,7 @@ $d->find_element('Contacts', 'link_text')->click();
diag("Try to create an empty Contact");
$d->find_element('Create Contact', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Contact")]'), "Edit window has been opened");
$d->unselect_if_selected('//*[@id="reselleridtable"]//tr[1]/td[5]/input');
$d->find_element('//*[@id="save"]')->click();

@ -22,10 +22,11 @@ $c->login_ok();
diag("Go to 'Peerings' page");
$d->find_element('//*[@id="content"]//div[contains(text(), "Peerings")]/../../div/a')->click();
diag("Create an empty Peering Group");
diag("Try to create an empty Peering Group");
$d->find_element('//*[@id="masthead"]//h2[contains(text(),"SIP Peering Groups")]');
my $peerings_uri = $d->get_current_url();
$d->find_element('Create Peering Group', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create SIP Peering Group")]'), "Edit window has been opened");
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -34,6 +35,7 @@ ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Name field is
diag("Create a new Contract");
$d->find_element('//input[@type="button" and @value="Create Contract"]')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Contract")]'), "Edit window has been opened");
$d->fill_element('//*[@id="contactidtable_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#contactidtable tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="contactidtable_filter"]/label/input', 'xpath', 'default-system@default.invalid');
@ -44,9 +46,9 @@ $d->select_if_unselected('//table[@id="billing_profileidtable"]/tbody/tr[1]//inp
$d->find_element('//*[@id="status"]')->click();
$d->find_element('//*[@id="status"]/option[@value="active"]')->click();
$d->find_element('//*[@id="save"]')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create SIP Peering Group")]'), 'Edit window has been opened');
diag("Continue creating a Peering Group");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create SIP Peering Group")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $groupname);
$d->fill_element('//*[@id="description"]', 'xpath', 'A group created for testing purposes');
$d->find_element('//*[@id="priority"]')->click();
@ -69,6 +71,7 @@ ok($d->find_element_by_xpath('//*[@id="sip_peering_group_table"]//tr[1]/td[conta
diag("Edit Peering Group");
$groupname = ("group" . int(rand(100000)) . "test");
$d->move_and_click('//*[@id="sip_peering_group_table"]/tbody/tr[1]//td//div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="sip_peering_group_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit SIP Peering Group")]'), 'Edit window has been opened');
$d->fill_element('#name', 'css', $groupname);
$d->fill_element('#description', 'css', 'A group created for very testing purposes');
$d->find_element('//*[@id="priority"]')->click();
@ -94,6 +97,7 @@ sleep 1;
diag("Create an empty Outbound Peering Rule");
$d->find_element('//a[contains(text(),"Create Outbound Peering Rule")]')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Outbound Peering Rule")]'), 'Edit window has been opened');
$d->find_element('#save', 'css')->click();
diag("Check if Outbound Peering Rule was created");
@ -106,6 +110,7 @@ is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Pee
diag("Create Outbound Peering Rule");
$d->find_element('//a[contains(text(),"Create Outbound Peering Rule")]')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Outbound Peering Rule")]'), 'Edit window has been opened');
$d->fill_element('#callee_prefix', 'css', '43');
$d->fill_element('#callee_pattern', 'css', '^sip');
$d->fill_element('#caller_pattern', 'css', '999');
@ -121,6 +126,7 @@ ok($d->find_element_by_xpath('//*[@id="PeeringRules_table"]//tr[1]/td[contains(t
diag("Edit Outbound Peering Rule");
$d->move_and_click('//*[@id="PeeringRules_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="PeeringRules_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Outbound Peering Rule")]'), 'Edit window has been opened');
$d->fill_element('#callee_prefix', 'css', '49');
$d->fill_element('#callee_pattern', 'css', '^sup');
$d->fill_element('#caller_pattern', 'css', '888');
@ -136,6 +142,7 @@ ok($d->find_element_by_xpath('//*[@id="PeeringRules_table"]//tr[1]/td[contains(t
diag("Try to create an empty Inbound Peering Rule");
$d->find_element('//a[contains(text(),"Create Inbound Peering Rule")]')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Inbound Peering Rule")]'), 'Edit window has been opened');
$d->find_element('#save', 'css')->click();
diag("Check if creation failed");
@ -143,6 +150,7 @@ ok($d->find_element_by_css('#InboundPeeringRules_table tr > td.dataTables_empty'
diag("Create Inbound Peering Rule");
$d->find_element('//a[contains(text(),"Create Inbound Peering Rule")]')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Inbound Peering Rule")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="pattern"]', 'xpath', '^sip');
$d->fill_element('//*[@id="reject_code"]', 'xpath', '403');
$d->fill_element('//*[@id="reject_reason"]', 'xpath', 'forbidden');
@ -157,6 +165,7 @@ ok($d->find_element_by_xpath('//*[@id="InboundPeeringRules_table"]//tr[1]/td[con
diag("Edit Inbound Peering Rule");
$d->scroll_to_element($d->find_element('//a[contains(text(),"Create Inbound Peering Rule")]'));
$d->move_and_click('//*[@id="InboundPeeringRules_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="InboundPeeringRules_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Inbound Peering Rule")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="pattern"]', 'xpath', '^sup');
$d->fill_element('//*[@id="reject_code"]', 'xpath', '404');
$d->fill_element('//*[@id="reject_reason"]', 'xpath', 'not found');
@ -170,6 +179,7 @@ ok($d->find_element_by_xpath('//*[@id="InboundPeeringRules_table"]//tr[1]/td[con
diag("Create an empty Peering Server");
$d->find_element('//a[contains(text(),"Create Peering Server")]')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Peering Server")]'), 'Edit window has been opened');
$d->find_element('#save', 'css')->click();
diag("Check error messages");
@ -191,6 +201,7 @@ ok($d->find_element_by_xpath('//*[@id="peering_servers_table"]//tr[1]/td[contain
diag("Edit Peering Server");
$servername = ("peering" . int(rand(100000)) . "server");
$d->move_and_click('//*[@id="peering_servers_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="peering_servers_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Peering Server")]'), 'Edit window has been opened');
$d->fill_element('#name', 'css', $servername);
$d->fill_element('#ip', 'css', '10.0.1.101');
$d->fill_element('#host', 'css', 'google.at');
@ -222,7 +233,7 @@ diag("Edit preference 'inbound_upn'");
$d->move_and_click('//table//td[contains(text(), "inbound_upn")]/..//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Number Manipulation")]');
diag("Change to 'P-Asserted-Identity'");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit Window has been opened');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->move_and_click('//*[@id="inbound_upn"]', 'xpath', '//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]');
$d->find_element('//*[@id="inbound_upn"]/option[@value="pai_user"]')->click();
$d->find_element('#save', 'css')->click();
@ -238,7 +249,7 @@ $d->scroll_to_element($d->find_element('Remote Authentication', 'link_text'));
diag("Edit setting 'peer_auth_user'");
$d->move_and_click('//table/tbody/tr/td[contains(text(), "peer_auth_user")]/../td/div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Remote Authentication")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit Window has been opened');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="peer_auth_user"]', 'xpath', 'peeruser1');
$d->find_element('#save', 'css')->click();
@ -250,7 +261,7 @@ ok($d->find_element_by_xpath('//table//tr/td[contains(text(), "peer_auth_user")]
diag("Edit setting 'peer_auth_pass'");
$d->move_and_click('//table/tbody/tr/td[contains(text(), "peer_auth_pass")]/../td/div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Remote Authentication")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit Window has been opened');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="peer_auth_pass"]', 'xpath', 'peerpass1');
$d->find_element('#save', 'css')->click();
@ -262,7 +273,7 @@ ok($d->find_element_by_xpath('//table//tr/td[contains(text(), "peer_auth_pass")]
diag("Edit setting 'peer_auth_realm'");
$d->move_and_click('//table/tbody/tr/td[contains(text(), "peer_auth_realm")]/../td/div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Remote Authentication")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit Window has been opened');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="peer_auth_realm"]', 'xpath', 'testpeering.com');
$d->find_element('#save', 'css')->click();
@ -277,14 +288,15 @@ $d->scroll_to_element($d->find_element('//*[@id="main-nav"]'));
$d->find_element('//*[@id="main-nav"]//*[contains(text(),"Tools")]')->click();
$d->find_element('Peering Overview', 'link_text')->click();
diag("Search Peering rule");
diag("Search Peering Rule");
$d->fill_element('//*[@id="PeeringOverview_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#PeeringOverview_table tr > td.dataTables_empty', 'css'), 'Inbound Peering Rule was not created');
$d->fill_element('//*[@id="PeeringOverview_table_filter"]/label/input', 'xpath', $groupname);
ok($d->find_element_by_xpath('//*[@id="PeeringOverview_table"]//tr[1]/td[contains(text(), "' . $groupname . '")]'), 'Peering Rule was found');
diag("Edit Peering rule");
diag("Edit Peering Rule");
$d->move_and_click('//*[@id="PeeringOverview_table"]//tr[1]//td//a[contains(text(), "Rule")]', 'xpath', '//*[@id="PeeringOverview_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Outbound Peering Rule")]'), 'Edit window has been opened');
$d->fill_element('#caller_pattern', 'css', '999');
$d->fill_element('#description', 'css', 'see if stuff changes');
$d->find_element('#save', 'css')->click();
@ -298,10 +310,11 @@ ok($d->find_element_by_xpath('//*[@id="PeeringOverview_table"]//tr[1]/td[contain
diag("Edit Peering Group");
$d->move_and_click('//*[@id="PeeringOverview_table"]//tr[1]//td//a[contains(text(), "Group")]', 'xpath', '//*[@id="PeeringOverview_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit SIP Peering Group")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="description"]', 'xpath', 'see if stuff changes');
$d->find_element('#save', 'css')->click();
diag("Go back to Peering group");
diag("Go back to 'Peerings' page");
$d->find_element('//*[@id="main-nav"]//*[contains(text(),"Settings")]')->click();
$d->find_element('Peerings', 'link_text')->click();

@ -33,6 +33,7 @@ $d->find_element('Profile Packages', 'link_text')->click();
diag("Try to create an empty Profile Package");
$d->find_element('Create Profile Package', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Profile Package")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="reselleridtable"]/tbody/tr[1]/td[5]/input');
$d->find_element('//*[@id="save"]')->click();
@ -88,6 +89,7 @@ ok($d->find_element_by_xpath('//*[@id="packages_table"]//tr[1]/td[contains(text(
diag("Edit Profile Package");
$profilename = ("profile" . int(rand(100000)) . "package");
$d->move_and_click('//*[@id="packages_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="packages_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Profile Package")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $profilename);
$d->fill_element('//*[@id="description"]', 'xpath', 'nice desc');
$d->find_element('//*[@id="save"]')->click();
@ -118,10 +120,9 @@ diag("Go to 'Contract Balance'");
$d->find_element('//*[@id="toggle-accordions"]')->click();
$d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[contains(text(),"Contract Balance")]'));
diag("Set Cash Balance");
diag("Try to set Cash Balance without entering anything");
$d->find_element("Set Cash Balance", "link_text")->click();
diag("Save without entering anything");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Settings")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check values");
@ -132,8 +133,9 @@ ok($d->find_element_by_xpath('//*[@id="collapse_balance"]//div//table//tr//td//b
ok($d->find_element_by_xpath('//*[@id="collapse_balance"]//div//table//tr//td//b[contains(text(), "0")]'), 'Free-Time Balance is correct');
ok($d->find_element_by_xpath('//*[@id="collapse_balance"]//div//table//tr//td[contains(text(), "'. $billingname .'")]'), 'Billing Profile is correct');
diag("Set Cash Balance again");
diag("Set Cash Balance with proper values now");
$d->find_element("Set Cash Balance", "link_text")->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Settings")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="cash_balance"]', 'xpath', '300');
$d->fill_element('//*[@id="free_time_balance"]', 'xpath', '50');
$d->find_element('//*[@id="save"]')->click();
@ -148,10 +150,9 @@ ok($d->find_element_by_xpath('//*[@id="collapse_balance"]//div//table//tr//td[co
ok($d->find_element_by_xpath('//*[@id="balance_intervals_table"]//tr//td[contains(text(), "300.00")]'), 'Cash Balance in Balance intervals table is correct');
ok($d->find_element_by_xpath('//*[@id="balance_intervals_table"]//tr//td[contains(text(), "50")]'), 'Free-Time Balance in Balance intervals table is correct');
diag("Top-up Cash");
diag("Try to Top-up Cash without entering anything");
$d->find_element('Top-up Cash', 'link_text')->click();
diag("Save without entering anything");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Settings")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");

@ -34,6 +34,7 @@ $d->find_element("Subscriber Profiles", 'link_text')->click();
diag("Try to create an empty Subscriber Profile Set");
$d->find_element("Create Subscriber Profile Set", 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Subscriber Profile Set")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="reselleridtable"]/tbody/tr[1]/td[5]/input', 'xpath');
$d->find_element('//*[@id="save"]')->click();
@ -66,6 +67,7 @@ ok($d->find_element_by_xpath('//*[@id="subscriber_profile_sets_table"]//tr[1]/td
diag("Edit Subscriber Profile set");
$setname = ("test" . int(rand(10000)) . "set");
$d->move_and_click('//*[@id="subscriber_profile_sets_table"]/tbody/tr[1]/td/div/a[contains(text(), "Edit")]', 'xpath', '//*[@id="subscriber_profile_sets_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Subscriber Profile Set")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $setname);
$d->fill_element('//*[@id="description"]', 'xpath', 'Very Good description here');
$d->find_element('//*[@id="save"]')->click();
@ -86,6 +88,7 @@ $d->move_and_click('//*[@id="subscriber_profile_sets_table"]/tbody/tr[1]/td/div/
diag("Try to create an empty Subscriber Profile");
$d->find_element('Create Subscriber Profile', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Subscriber Profile")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -113,6 +116,7 @@ ok($d->find_element_by_xpath('//*[@id="subscriber_profile_table"]//tr[1]/td[cont
diag("Edit Profile");
$profilename = ("test" . int(rand(10000)) . "profile");
$d->move_and_click('//*[@id="subscriber_profile_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="subscriber_profile_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Subscriber Profile")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $profilename);
$d->fill_element('//*[@id="description"]', 'xpath', 'Very very useful description');
$d->find_element('//*[@id="save"]')->click();
@ -143,6 +147,7 @@ if($d->find_element_by_xpath('//*[@id="masthead"]//div//h2')->get_text() eq 'Sub
diag("Clone Profile");
$d->move_and_click('//*[@id="subscriber_profile_table"]//tr[1]//td//a[contains(text(), "Clone")]', 'xpath', '//*[@id="subscriber_profile_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create cloned Subscriber Profile")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $cloneprofilename);
$d->fill_element('//*[@id="description"]', 'xpath', 'indeed a good description');
$d->find_element('//*[@id="clone"]')->click();
@ -158,6 +163,7 @@ ok($d->find_element_by_xpath('//*[@id="subscriber_profile_table"]//tr[1]/td[cont
diag("Set clone Profile as default Profile");
$d->move_and_click('//*[@id="subscriber_profile_table"]//tr[1]/td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="subscriber_profile_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Subscriber Profile")]'), 'Edit window has been opened');
$d->select_if_unselected('//*[@id="set_default"]', 'xpath');
$d->find_element('//*[@id="save"]')->click();
@ -184,6 +190,7 @@ ok($d->find_element_by_css('#subscriber_profile_sets_table tr > td.dataTables_em
$d->fill_element('//*[@id="subscriber_profile_sets_table_filter"]/label/input', 'xpath', $setname);
ok($d->find_element_by_xpath('//*[@id="subscriber_profile_sets_table"]//tr[1]/td[contains(text(), "' . $setname . '")]'), 'Profile Set was found');
$d->move_and_click('//*[@id="subscriber_profile_sets_table"]/tbody/tr[1]/td/div/a[contains(text(), "Clone")]', 'xpath', '//*[@id="subscriber_profile_sets_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create cloned Subscriber Profile Set")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $clonedsetname);
$d->fill_element('//*[@id="description"]', 'xpath', 'indeed a very interesting description');
$d->find_element('//*[@id="clone"]')->click();

@ -24,6 +24,7 @@ $c->create_reseller($resellername, $contractid);
diag("Try to create an empty Reseller");
$d->find_element('Create Reseller', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Reseller")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="contractidtable"]/tbody/tr/td[5]/input');
$d->find_element('//*[@id="save"]')->click();
@ -42,10 +43,9 @@ ok($d->find_element_by_xpath('//*[@id="Resellers_table"]//tr[1]/td[contains(text
ok($d->find_element_by_xpath('//*[@id="Resellers_table"]//tr[1]/td[contains(text(), "active")]'), 'Status is correct');
diag("Edit Reseller");
$d->move_and_click('//*[@id="Resellers_table"]/tbody/tr[1]//td//div//a[contains(text(),"Edit")]', 'xpath', '//*[@id="Resellers_table_filter"]//input');
diag("Edit name and status");
$resellername = ("reseller" . int(rand(100000)) . "test");
$d->move_and_click('//*[@id="Resellers_table"]/tbody/tr[1]//td//div//a[contains(text(),"Edit")]', 'xpath', '//*[@id="Resellers_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Reseller")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $resellername);
$d->find_element('//*[@id="status"]/option[@value="locked"]')->click();
$d->find_element('#save', 'css')->click();
@ -72,6 +72,7 @@ ok($d->find_element_by_css('#Resellers_table tr > td.dataTables_empty', 'css'),
$d->fill_element('#Resellers_table_filter label input', 'css', $resellername);
ok($d->find_element_by_xpath('//*[@id="Resellers_table"]//tr[1]/td[contains(text(), "' . $resellername . '")]'), 'Reseller was found');
$d->move_and_click('//*[@id="Resellers_table"]/tbody/tr[1]//td//div//a[contains(text(),"Edit")]', 'xpath', '//*[@id="Resellers_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Reseller")]'), 'Edit window has been opened');
$d->scroll_to_element($d->find_element('//*[@id="status"]'));
$d->find_element('//*[@id="status"]/option[@value="active"]')->click();
$d->find_element('#save', 'css')->click();
@ -91,6 +92,7 @@ diag("Create an empty Phonebook entry");
$d->find_element('//*[@id="toggle-accordions"]')->click();
$d->scroll_to_element($d->find_element('//*[@id="reseller_details"]//div//div//a[contains(text(),"Phonebook")]'));
$d->find_element("Create Phonebook Entry", 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Phonebook")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -115,6 +117,7 @@ ok($d->find_element_by_xpath('//*[@id="phonebook_table"]//tr[1]/td[contains(text
diag("Edit Phonebook entry");
$d->move_and_click('//*[@id="phonebook_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="phonebook_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Phonebook")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', 'newtestname');
$d->fill_element('//*[@id="number"]', 'xpath', '0987654321');
$d->find_element('//*[@id="save"]')->click();
@ -132,6 +135,7 @@ $d->find_element('Email Templates', 'link_text')->click();
diag("Try to create an empty Email Template");
$d->find_element('Create Email Template', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Email Template")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="reselleridtable"]//tr[1]/td[5]/input');
$d->find_element('//*[@id="save"]')->click();
@ -168,6 +172,7 @@ ok($d->find_element_by_xpath('//*[@id="email_template_table"]//tr[1]/td[contains
diag("Edit Email Template");
$templatename = ("template" . int(rand(100000)) . "mail");
$d->move_and_click('//*[@id="email_template_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="email_template_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Email Template")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $templatename);
$d->fill_element('//*[@id="from_email"]', 'xpath', 'standard@mail.test');
$d->fill_element('//*[@id="subject"]', 'xpath', 'testing much stuff');

@ -26,6 +26,7 @@ $c->create_rw_ruleset($rulesetname, $resellername);
diag("Try to create an empty Rewrite Rule Set");
$d->find_element('Create Rewrite Rule Set', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Rewrite Rule Set")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="reselleridtable"]/tbody/tr[1]/td[5]/input');
$d->find_element('//*[@id="save"]')->click();
@ -47,6 +48,7 @@ ok($d->find_element_by_xpath('//*[@id="rewrite_rule_set_table"]//tr[1]/td[contai
diag("Edit Rewrite Rule Set");
$rulesetname = ("rule" . int(rand(100000)) . "test");
$d->move_and_click('//*[@id="rewrite_rule_set_table"]/tbody/tr[1]//td//div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="rewrite_rule_set_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Rewrite Rule Set")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $rulesetname);
$d->fill_element('//*[@id="description"]', 'xpath', 'For very testing purposes');
$d->find_element('//*[@id="save"]')->click();
@ -69,6 +71,7 @@ sleep 1;
diag("Create a new empty Rule for Caller");
$d->find_element('Create Rewrite Rule', 'link_text')->click;
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Rule")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check error messages");
@ -100,6 +103,7 @@ ok($d->find_element_by_xpath('//*[@id="collapse_icaller"]/div/table//tr[1]//td[c
diag("Edit Rule for Caller");
$d->move_and_click('//*[@id="collapse_icaller"]//table//tr[1]//td//a[text()[contains(., "Edit")]]', 'xpath', '//*[@id="masthead"]//div/h2');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Rule")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="description"]', 'xpath', 'International to E.164');
$d->find_element('//*[@id="save"]')->click();
@ -112,6 +116,7 @@ ok($d->find_element_by_xpath('//*[@id="collapse_icaller"]/div/table//tr[1]//td[c
diag("Create a new Rule for Callee");
$d->find_element('Create Rewrite Rule', 'link_text')->click;
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Rule")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="match_pattern"]', 'xpath', '^(00|\+)([1-9][0-9]+)$');
$d->fill_element('//*[@id="replace_pattern"]', 'xpath', '\2');
$d->fill_element('//*[@id="description"]', 'xpath', 'Not International to E.164');
@ -127,6 +132,7 @@ ok($d->find_element_by_xpath('//*[@id="collapse_icallee"]/div/table//tr[1]//td[c
diag("Edit Rule for Callee");
$d->move_and_click('//*[@id="collapse_icallee"]//table//tr[1]//td//a[text()[contains(., "Edit")]]', 'xpath', '//*[@id="masthead"]//div/h2');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Rule")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="description"]', 'xpath', 'International to E.164');
$d->find_element('//*[@id="save"]')->click();
@ -140,6 +146,7 @@ ok($d->find_element_by_xpath('//*[@id="collapse_icallee"]/div/table//tr[1]//td[c
diag("Testing if rules can be reordered");
diag("Create a new Rule for Caller");
$d->find_element('Create Rewrite Rule', 'link_text')->click;
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Rule")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="match_pattern"]', 'xpath', '^(00|\+)([1-9][0-9]+)$');
$d->fill_element('//*[@id="replace_pattern"]', 'xpath', '\1');
$d->fill_element('//*[@id="description"]', 'xpath', 'International to E.164');
@ -169,6 +176,7 @@ ok($d->find_element_by_css('#rewrite_rule_set_table tr > td.dataTables_empty', '
$d->fill_element('//*[@id="rewrite_rule_set_table_filter"]/label/input', 'xpath', $rulesetname);
ok($d->find_element_by_xpath('//*[@id="rewrite_rule_set_table"]//tr[1]/td[contains(text(), "' . $rulesetname . '")]'), 'Ruleset was found');
$d->move_and_click('//*[@id="rewrite_rule_set_table"]/tbody/tr[1]//td//div//a[contains(text(), "Clone")]', 'xpath', '//*[@id="rewrite_rule_set_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create cloned Rewrite Rule")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $rulesetclonename);
$d->fill_element('//*[@id="description"]', 'xpath', 'Im a clone, beep boop');
$d->find_element('//*[@id="clone"]')->click();
@ -210,7 +218,7 @@ diag("Add Ruleset to Domain");
$d->find_element('//*[@id="toggle-accordions"]')->click();
$d->scroll_to_element($d->find_element('Number Manipulations', 'link_text'));
$d->move_and_click('//table/tbody/tr/td[contains(text(), "rewrite_rule_set")]/../td/div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Number Manipulations")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit Window has been opened');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->move_and_click('//*[@id="rewrite_rule_set"]', 'xpath', '//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]');
$d->find_element('//*[@id="rewrite_rule_set"]/option[contains(text(), "' . $rulesetname . '")]')->click();
$d->find_element('//*[@id="save"]')->click();

@ -28,6 +28,7 @@ $d->find_element('Sound Sets', 'link_text')->click();
diag("Try to create an empty Sound Set");
$d->find_element('Create Sound Set', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Sound Set")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="reselleridtable"]//tr[1]//td//input');
$d->find_element('//*[@id="save"]')->click();
@ -59,6 +60,7 @@ ok($d->find_element_by_xpath('//*[@id="sound_set_table"]//tr[1]/td[contains(text
diag("Edit Sound Set");
$soundsetname = ("sound" . int(rand(100000)) . "set");
$d->move_and_click('//*[@id="sound_set_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="sound_set_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Sound Set")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $soundsetname);
$d->fill_element('//*[@id="description"]', 'xpath', 'very nice desc');
$d->find_element('//*[@id="save"]')->click();
@ -80,6 +82,7 @@ $d->move_and_click('//*[@id="sound_set_table"]//tr[1]//td//a[contains(text(), "F
diag("Edit loop setting for 'conference_first'");
$d->find_element('//*[@id="toggle-accordions"]')->click();
$d->move_and_click('//table//tr//td[contains(text(), "conference_first")]/..//td//a[contains(text(), "Upload")]', 'xpath', '//*[@id="sound_groups"]//div/a[contains(text(), "conference")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit conference_first")]'), 'Edit window has been opened');
$d->select_if_unselected('//*[@id="loopplay"]');
$d->find_element('//*[@id="save"]')->click();
@ -90,6 +93,7 @@ ok($d->find_element_by_xpath('//table//tr//td[contains(text(), "conference_first
diag("Load default Files");
$d->find_element('Load Default Files', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Default Files")]'), 'Edit window has been opened');
$d->find_element('//*[@id="save"]')->click();
diag("Check in 'conference' if settings are correct");
@ -102,6 +106,7 @@ ok($d->find_element_by_xpath('//table//tr//td[contains(text(), "conference_greet
diag("Load default Files again and override everything");
$d->find_element('Load Default Files', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Default Files")]'), 'Edit window has been opened');
$d->select_if_unselected('//*[@id="replace_existing"]');
$d->find_element('//*[@id="save"]')->click();
@ -115,6 +120,7 @@ ok($d->find_element_by_xpath('//table//tr//td[contains(text(), "conference_greet
diag("Load default Files again and loop them");
$d->find_element('Load Default Files', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Default Files")]'), 'Edit window has been opened');
$d->select_if_unselected('//*[@id="loopplay"]');
$d->select_if_unselected('//*[@id="replace_existing"]');
$d->find_element('//*[@id="save"]')->click();

@ -47,6 +47,7 @@ diag("Try to add an empty Subscriber");
$d->find_element('//*[@id="toggle-accordions"]')->click();
$d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[contains(text(), "Subscribers")]'));
$d->find_element('Create Subscriber', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Subscriber")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="domainidtable"]/tbody/tr[1]/td[4]/input');
$d->find_element('//*[@id="save"]')->click();
@ -93,6 +94,7 @@ $d->find_element("Subscriber Profiles", 'link_text')->click();
diag("Try to create a Subscriber Profile Set");
$d->find_element('Create Subscriber Profile Set', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Subscriber Profile Set")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="reselleridtable_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#reselleridtable tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="reselleridtable_filter"]/label/input', 'xpath', $resellername);
@ -118,6 +120,7 @@ $d->move_and_click('//*[@id="subscriber_profile_sets_table"]/tbody/tr[1]/td/div/
diag("Try to create a Subscriber Profile");
$d->find_element('Create Subscriber Profile', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Subscriber Profile")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $profilename);
$d->fill_element('//*[@id="description"]', 'xpath', 'This is a description. It describes things');
$d->scroll_to_element($d->find_element('//*[@id="attribute.ncos"]'));
@ -156,6 +159,7 @@ $d->scroll_to_element($d->find_element('//*[@id="subscriber_data"]//div//a[conta
$d->find_element('Edit', 'link_text')->click();
diag("Add Subscriber to profile");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Subscriber Master Data")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="profile_setidtable_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#profile_setidtable tr > td.dataTables_empty'), 'Garbage Text was not found');
$d->fill_element('//*[@id="profile_setidtable_filter"]/label/input', 'xpath', $setname);
@ -181,6 +185,7 @@ ok($d->find_element_by_xpath('//*[@id="subscribers_table"]//tr/td[contains(text(
diag("Lock Subscriber");
$d->find_element("Edit", 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Subscriber Master Data")]'), 'Edit window has been opened');
$d->find_element('//*[@id="lock"]/option[contains(text(), "global")]')->click();
$d->find_element('//*[@id="status"]/option[contains(text(), "locked")]')->click();
$d->find_element('//*[@id="save"]')->click();
@ -200,6 +205,7 @@ $d->find_element('//*[@id="toggle-accordions"]')->click();
$d->scroll_to_element($d->find_element('//*[@id="subscriber_data"]//div//a[contains(text(), "Master Data")]'));
ok($d->find_element_by_xpath('//*[@id="subscribers_table"]//tr/td[contains(text(), "Status")]/../td[contains(text(), "locked")]'), 'Status is correct');
$d->find_element("Edit", 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Subscriber Master Data")]'), 'Edit window has been opened');
$d->find_element('//*[@id="lock"]')->click();
$d->find_element('//*[@id="lock"]/option[contains(text(), "none")]')->click();
$d->find_element('//*[@id="status"]')->click();
@ -219,7 +225,7 @@ $d->scroll_to_element($d->find_element('//table//tr/td[contains(text(), "languag
$d->move_and_click('//table//tr/td[contains(text(), "language")]/..//td//a[contains(text(), "Edit")]', 'xpath', '//table//tr/td[contains(text(), "conference_pin")]/..//td//a[contains(text(), "Edit")]');
diag("Change Language to German");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit Window has been opened');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->move_and_click('//*[@id="language"]', 'xpath', '//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]');
$d->find_element('//*[@id="language"]/option[contains(text(), "German")]')->click();
$d->find_element('//*[@id="save"]')->click();
@ -235,6 +241,7 @@ $d->scroll_to_element($d->find_element('//table//tr/td[contains(text(), "record_
$d->move_and_click('//table//tr/td[contains(text(), "record_call")]/..//td//a[contains(text(), "Edit")]', 'xpath', '//table//tr/td[contains(text(), "nat_sipping")]/..//td//a[contains(text(), "Edit")]');
diag("Enable Call Recording");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->select_if_unselected('//*[@id="record_call"]');
$d->find_element('//*[@id="save"]')->click();
@ -313,6 +320,7 @@ $d->scroll_to_element($d->find_element('Call Blockings', 'link_text'));
diag("Edit 'block_in_mode'");
$d->move_and_click('//table//tr/td[contains(text(), "block_in_mode")]/../td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Call Blockings")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->find_element('//*[@id="block_in_mode"]')->click();
$d->find_element('//*[@id="save"]')->click();
@ -324,6 +332,7 @@ ok($d->find_element_by_xpath('//table//tr/td[contains(text(), "block_in_mode")]/
diag("Edit 'block_in_list'");
$d->move_and_click('//table//tr/td[contains(text(), "block_in_list")]/../td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Call Blockings")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="block_in_list"]', 'xpath', '1337');
$d->find_element('//*[@id="add"]')->click();
$d->fill_element('//*[@id="block_in_list"]', 'xpath', '42');
@ -339,6 +348,7 @@ ok($d->find_element_by_xpath('//table//tr/td[contains(text(), "block_in_list")]/
diag("Disable Entry");
$d->move_and_click('//table//tr/td[contains(text(), "block_in_list")]/../td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Call Blockings")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->find_element('//*[@id="mod_edit"]//div//input[@value="1337"]/../a[2]')->click();
$d->find_element('//*[@id="mod_close"]')->click();
@ -349,6 +359,7 @@ ok($d->find_element_by_xpath('//table//tr/td[contains(text(), "block_in_list")]/
diag("Edit 'block_in_clir'");
$d->move_and_click('//table//tr/td[contains(text(), "block_in_clir")]/../td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Call Blockings")]');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Preference")]'), 'Edit window has been opened');
$d->find_element('//*[@id="block_in_clir"]')->click();
$d->find_element('//*[@id="save"]')->click();

@ -29,6 +29,7 @@ $d->find_element('Time Sets', 'link_text')->click();
diag("Try to create an empty Time Set");
$d->find_element('Create Time Set Entry', 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Time Set")]'), 'Edit window has been opened');
$d->unselect_if_selected('//*[@id="reselleridtable"]/tbody/tr[1]/td[5]/input', 'xpath');
$d->find_element('//*[@id="save"]')->click();
@ -58,6 +59,7 @@ ok($d->find_element_by_xpath('//*[@id="timeset_table"]//tr[1]/td[contains(text()
diag("Edit Time Set");
$timesetname = ("time" . int(rand(100000)) . "set");
$d->move_and_click('//*[@id="timeset_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="timeset_table_filter"]/label/input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Edit Time Set")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="name"]', 'xpath', $timesetname);
$d->find_element('//*[@id="save"]')->click();
@ -78,6 +80,7 @@ diag("Try to create a new Event");
$d->find_element("Create Event", 'link_text')->click();
diag("Fill in invalid values");
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Time Set Event")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="comment"]', 'xpath', 'testing invalid content');
$d->fill_element('//*[@id="startdate_datetimepicker"]', 'xpath', 'invalid');
$d->fill_element('//*[@id="starttime_datetimepicker"]', 'xpath', 'stuff');
@ -113,6 +116,7 @@ ok($d->find_element_by_xpath('//*[@id="event_table"]//tr[1]/td[contains(text(),
diag("Edit Event");
$d->move_and_click('//*[@id="event_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="event_table_filter"]//input');
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create Time Set Event")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="comment"]', 'xpath', 'Very important event');
$d->fill_element('//*[@id="startdate_datetimepicker"]', 'xpath', '2020-06-01');
$d->fill_element('//*[@id="starttime_datetimepicker"]', 'xpath', '12:00:00');
@ -133,6 +137,7 @@ $d->find_element('Peerings', 'link_text')->click();
diag("Create a Peering Group and add Time Set to Peering Group");
$d->find_element("Create Peering Group", 'link_text')->click();
ok($d->find_element_by_xpath('//*[@id="mod_edit"]/div/h3[contains(text(), "Create SIP Peering Group")]'), 'Edit window has been opened');
$d->fill_element('//*[@id="contractidtable_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#contractidtable tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="contractidtable_filter"]/label/input', 'xpath', 'default-system@default.invalid');

Loading…
Cancel
Save