TT#56376 selenium: workaround for locking subscriber going into wrong menu

controller_subscriber.t:
- if you edit subscriber settings, you will get thown back to the
subscribers menu sometimes. this patch should work around that issue by
detecting if test gets thrown out of the subscriber settings and
re-entering it again.
- some string changes
Change-Id: I1dabcc8283f61d74e75845f63ee136e0c0a3b38c
changes/92/33692/1
Nico Schedel 6 years ago
parent 6f94991b55
commit 4245f60140

@ -183,10 +183,18 @@ $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();
diag('Check if subscriber got locked');
diag('Check if Subscriber got locked');
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), "Successfully updated subscriber", "Correct Alert was shown");
#ok($d->find_element_by_xpath('//div[text()[contains(., "Subscriber status is locked")]]'), 'Message "Subscriber status is locked" was shown');
#ok($d->find_element_by_xpath('//div[text()[contains(., "Subscriber is locked for global")]]'), 'Message "Subscriber is locked for global" was shown');
if($d->find_element_by_xpath('//*[@id="masthead"]/div/div/div/h2')->get_text() eq "Subscribers"){ #workaround for misbehaving ngcp panel randomly throwing test out of customer details
$d->fill_element('//*[@id="subscriber_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#subscriber_table tr > td.dataTables_empty'), 'Table is empty');
$d->fill_element('//*[@id="subscriber_table_filter"]/label/input', 'xpath', $username);
ok($d->wait_for_text('//*[@id="subscriber_table"]/tbody/tr/td[4]', $username), 'Found Subscriber');
$d->move_and_click('//*[@id="subscriber_table"]//tr[1]//td//a[contains(text(), "Details")]', 'xpath', '//*[@id="subscriber_table_filter"]/label/input');
}
if($d->find_element_by_xpath('//*[@id="subscriber_data"]//div//a[contains(text(), "Master Data")]/../../../div')->get_attribute('class', 1) eq 'accordion-group') {
$d->find_element('//*[@id="subscriber_data"]//div//a[contains(text(), "Master Data")]')->click();
}
ok($d->find_element_by_xpath('//*[@id="subscribers_table"]//tr//td[contains(text(), "Status")]/../td[contains(text(), "locked")]'), "Status is correct");
diag('Unlock Subscriber');

Loading…
Cancel
Save