From 4245f601408d68a0d8dcfb3aad622f69330e95f0 Mon Sep 17 00:00:00 2001 From: Nico Schedel Date: Fri, 20 Sep 2019 10:39:11 +0200 Subject: [PATCH] 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 --- t/selenium/controller_subscriber.t | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/t/selenium/controller_subscriber.t b/t/selenium/controller_subscriber.t index fd920b624c..824a8230b8 100644 --- a/t/selenium/controller_subscriber.t +++ b/t/selenium/controller_subscriber.t @@ -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');