1 attempt to fix jenkins reports

This commit is contained in:
Churikova Tetiana 2018-03-31 00:19:12 +03:00 committed by Tetiana Churikova
parent 588779c434
commit 6f0596e09b
1 changed files with 11 additions and 11 deletions

View File

@ -60,12 +60,12 @@ class BaseTestCase:
# #
cls.executor_sauce_lab = 'http://%s:%s@ondemand.saucelabs.com:80/wd/hub' % ( cls.executor_sauce_lab = 'http://%s:%s@ondemand.saucelabs.com:80/wd/hub' % (
environ.get('SAUCE_USERNAME'), environ.get('SAUCE_ACCESS_KEY')) environ.get('SAUCE_USERNAME'), environ.get('SAUCE_ACCESS_KEY'))
drivers = [] cls.drivers = []
if cls.environment == 'local': if cls.environment == 'local':
for caps in cls.capabilities_dev, cls.capabilities_org: for caps in cls.capabilities_dev, cls.capabilities_org:
driver = webdriver.Chrome(chrome_options=caps) driver = webdriver.Chrome(chrome_options=caps)
drivers.append(driver) cls.drivers.append(driver)
if cls.environment == 'sauce': if cls.environment == 'sauce':
for caps in cls.capabilities_dev, cls.capabilities_org: for caps in cls.capabilities_dev, cls.capabilities_org:
@ -74,18 +74,16 @@ class BaseTestCase:
new_caps.update(remote) new_caps.update(remote)
driver = webdriver.Remote(cls.executor_sauce_lab, driver = webdriver.Remote(cls.executor_sauce_lab,
desired_capabilities=new_caps) desired_capabilities=new_caps)
drivers.append(driver) cls.drivers.append(driver)
for driver in drivers: cls.driver_dev = cls.drivers[0]
cls.print_sauce_lab_info(cls, driver) cls.driver_org = cls.drivers[1]
cls.driver_dev = drivers[0]
cls.driver_org = drivers[1]
for driver in drivers: for driver in cls.drivers:
driver.implicitly_wait(10) driver.implicitly_wait(10)
################################################################################################################### ###################################################################################################################
######### Actions for each driver before class ######### Actions for each driver before class
################################################################################################################### ###################################################################################################################
@ -140,8 +138,10 @@ class BaseTestCase:
cls.github_dev.delete_fork() cls.github_dev.delete_fork()
try: try:
cls.driver_dev.quit() for driver in cls.drivers:
cls.driver_org.quit() cls.print_sauce_lab_info(cls, driver)
driver.quit()
except WebDriverException: except WebDriverException:
pass pass