Update test_workflow.py
This commit is contained in:
parent
f2d1273dc4
commit
0c197a6b9b
|
@ -50,29 +50,32 @@ def main():
|
||||||
#3##
|
#3##
|
||||||
|
|
||||||
driver = uc.Chrome(headless=True, browser_executable_path=browser_executable_path)
|
driver = uc.Chrome(headless=True, browser_executable_path=browser_executable_path)
|
||||||
logging.getLogger().setLevel(20)
|
logging.getLogger().setLevel(10)
|
||||||
driver.get('https://www.nowsecure.nl')
|
driver.get('https://www.nowsecure.nl')
|
||||||
|
|
||||||
logger.info('current url %s' % driver.current_url)
|
logger.info('current url %s' % driver.current_url)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
WebDriverWait(driver,10).until(EC.title_contains('moment'))
|
WebDriverWait(driver,15).until(EC.title_contains('moment'))
|
||||||
except TimeoutException:
|
except TimeoutException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
logger.info('current page source:\n%s' % driver.page_source)
|
||||||
|
|
||||||
logger.info('current url %s' % driver.current_url)
|
logger.info('current url %s' % driver.current_url)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
WebDriverWait(driver,10).until(EC.title_contains('nowSecure'))
|
WebDriverWait(driver,15).until(EC.title_contains('nowSecure'))
|
||||||
except TimeoutException:
|
logger.info('PASSED CLOUDFLARE!')
|
||||||
logging.getLogger().setLevel(20)
|
|
||||||
|
except TimeoutException:
|
||||||
|
logger.info('timeout')
|
||||||
print(driver.current_url)
|
print(driver.current_url)
|
||||||
else:
|
|
||||||
logger.info( "PASSED CLOUDFLARE! ")
|
|
||||||
|
|
||||||
|
logger.info('current page source:\n%s' % driver.page_source)
|
||||||
|
|
||||||
|
logging.getLogger().setLevel(20)
|
||||||
logger.info('trying to save a screenshot via imgur')
|
logger.info('trying to save a screenshot via imgur')
|
||||||
# driver.reconnect()
|
# driver.reconnect()
|
||||||
driver.save_screenshot('/tmp/screenshot.png')
|
driver.save_screenshot('/tmp/screenshot.png')
|
||||||
|
|
Loading…
Reference in New Issue