Update test_workflow.py

This commit is contained in:
Leon 2023-06-03 02:39:06 +02:00 committed by GitHub
parent f2d1273dc4
commit 0c197a6b9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 8 deletions

View File

@ -50,29 +50,32 @@ def main():
#3##
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')
logger.info('current url %s' % driver.current_url)
try:
WebDriverWait(driver,10).until(EC.title_contains('moment'))
WebDriverWait(driver,15).until(EC.title_contains('moment'))
except TimeoutException:
pass
logger.info('current page source:\n%s' % driver.page_source)
logger.info('current url %s' % driver.current_url)
try:
WebDriverWait(driver,10).until(EC.title_contains('nowSecure'))
except TimeoutException:
logging.getLogger().setLevel(20)
WebDriverWait(driver,15).until(EC.title_contains('nowSecure'))
logger.info('PASSED CLOUDFLARE!')
except TimeoutException:
logger.info('timeout')
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')
# driver.reconnect()
driver.save_screenshot('/tmp/screenshot.png')