Skip to content

Commit b4d6106

Browse files
committed
adding the full screenshot spinup and quit to the actual nested loop
1 parent aa00278 commit b4d6106

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

ci/ci.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@
1313
client = docker.from_env()
1414
session = boto3.session.Session()
1515

16-
# Selenium webdriver options
17-
chrome_options = webdriver.ChromeOptions()
18-
chrome_options.add_argument('--no-sandbox')
19-
chrome_options.add_argument('--headless')
20-
chrome_options.add_argument('--disable-gpu')
21-
chrome_options.add_argument('--window-size=1920x1080')
22-
driver = webdriver.Chrome(chrome_options=chrome_options)
23-
driver.set_page_load_timeout(10)
24-
2516
# Global Vars
2617
global report_tests
2718
global report_containers
@@ -199,10 +190,20 @@ def container_test(tag):
199190
endpoint = proto + webauth + '@' + ip + ':' + port + webpath
200191
print('Taking screenshot of ' + tag + ' at ' + endpoint)
201192
try:
193+
# Selenium webdriver options
194+
chrome_options = webdriver.ChromeOptions()
195+
chrome_options.add_argument('--no-sandbox')
196+
chrome_options.add_argument('--headless')
197+
chrome_options.add_argument('--disable-gpu')
198+
chrome_options.add_argument('--window-size=1920x1080')
199+
driver = webdriver.Chrome(chrome_options=chrome_options)
200+
driver.set_page_load_timeout(10)
202201
requests.get(endpoint, timeout=3)
203202
driver.get(endpoint)
204203
driver.get_screenshot_as_file(outdir + tag + '.png')
205204
report_tests.append(['Screenshot ' + tag,'PASS'])
205+
# Quit selenium webdriver
206+
driver.quit()
206207
except (requests.Timeout, requests.ConnectionError, KeyError) as e:
207208
report_tests.append(['Screenshot ' + tag,'FAIL CONNECTION ERROR'])
208209
except ErrorInResponseException as error:
@@ -315,8 +316,6 @@ def report_upload():
315316
# Run through all the tags
316317
for tag in tags:
317318
container_test(tag)
318-
# Quit selenium webdriver
319-
driver.quit()
320319
report_render()
321320
badge_render()
322321
report_upload()

0 commit comments

Comments
 (0)