From f65b85b64b901360847e027f3757b8acf70d56be Mon Sep 17 00:00:00 2001 From: Nico Schedel Date: Fri, 19 Jun 2020 12:55:31 +0200 Subject: [PATCH] TT#70901 selenium: fix customer creation on pro machines with cloudpbx enabled Some pro machines that are used for running tests have cloudpbx enabled and when trying to create a customer on those it will fail, because it wont select the product at all. this patch will select basic sip account as product if cloudpbx is enabled Change-Id: I15abe159e1be116ac6247ba471e1f26b48f50842 --- t/selenium/functions/Collections.py | 11 +++++++++++ t/selenium/testrun.py | 2 ++ 2 files changed, 13 insertions(+) diff --git a/t/selenium/functions/Collections.py b/t/selenium/functions/Collections.py index 524d22f6..e1c6bfa0 100644 --- a/t/selenium/functions/Collections.py +++ b/t/selenium/functions/Collections.py @@ -52,6 +52,17 @@ def create_customer(driver, name=None): driver, '//*[@id="contactidtable"]//tr[1]//td/input') driver.find_element_by_xpath( '//*[@id="contactidtable"]//tr[1]//td/input').click() + try: + driver.implicitly_wait(2) + Functions.scroll_to_element(driver, '//*[@id="productidtable_filter"]/label/input') + Functions.fill_element(driver, '//*[@id="productidtable_filter"]/label/input', 'thisshouldnotexist') + driver.find_element_by_css_selector('#productidtable tr > td.dataTables_empty') + Functions.fill_element(driver, '//*[@id="productidtable_filter"]/label/input', 'Basic') + driver.find_element_by_xpath('//*[@id="productidtable"]//tr[1]//td/input').click() + driver.implicitly_wait(10) + except Exception as e: + driver.implicitly_wait(10) + del e Functions.scroll_to_element( driver, '//*[@id="billing_profileidtable"]//tr[1]//td/input') driver.find_element_by_xpath( diff --git a/t/selenium/testrun.py b/t/selenium/testrun.py index a64a20a5..6c966d4a 100644 --- a/t/selenium/testrun.py +++ b/t/selenium/testrun.py @@ -46,6 +46,8 @@ def preparation(): driver.quit() except Exception: driver.save_screenshot('/results/preperation.png') + driver.quit() + raise Exception def cleanup():