From 6f0596e09b77d437eb2870e47a382c00a9ef1d8c Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Sat, 31 Mar 2018 00:19:12 +0300 Subject: [PATCH] 1 attempt to fix jenkins reports --- test/end-to-end/tests/basetestcase.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/end-to-end/tests/basetestcase.py b/test/end-to-end/tests/basetestcase.py index 92e30cc..dca667a 100644 --- a/test/end-to-end/tests/basetestcase.py +++ b/test/end-to-end/tests/basetestcase.py @@ -60,12 +60,12 @@ class BaseTestCase: # cls.executor_sauce_lab = 'http://%s:%s@ondemand.saucelabs.com:80/wd/hub' % ( environ.get('SAUCE_USERNAME'), environ.get('SAUCE_ACCESS_KEY')) - drivers = [] + cls.drivers = [] if cls.environment == 'local': for caps in cls.capabilities_dev, cls.capabilities_org: driver = webdriver.Chrome(chrome_options=caps) - drivers.append(driver) + cls.drivers.append(driver) if cls.environment == 'sauce': for caps in cls.capabilities_dev, cls.capabilities_org: @@ -74,18 +74,16 @@ class BaseTestCase: new_caps.update(remote) driver = webdriver.Remote(cls.executor_sauce_lab, desired_capabilities=new_caps) - drivers.append(driver) + cls.drivers.append(driver) - for driver in drivers: - cls.print_sauce_lab_info(cls, driver) - - cls.driver_dev = drivers[0] - cls.driver_org = drivers[1] + cls.driver_dev = cls.drivers[0] + cls.driver_org = cls.drivers[1] - for driver in drivers: + for driver in cls.drivers: driver.implicitly_wait(10) + ################################################################################################################### ######### Actions for each driver before class ################################################################################################################### @@ -140,8 +138,10 @@ class BaseTestCase: cls.github_dev.delete_fork() try: - cls.driver_dev.quit() - cls.driver_org.quit() + for driver in cls.drivers: + cls.print_sauce_lab_info(cls, driver) + driver.quit() + except WebDriverException: pass