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