From 767170faaeee85d64a815c2627b807f55a3752f2 Mon Sep 17 00:00:00 2001 From: Artur Barseghyan Date: Mon, 11 Jul 2022 11:53:29 +0200 Subject: [PATCH] Log errors --- src/fobi/tests/test_browser_build_dynamic_forms.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fobi/tests/test_browser_build_dynamic_forms.py b/src/fobi/tests/test_browser_build_dynamic_forms.py index edee65e1..63d33df4 100644 --- a/src/fobi/tests/test_browser_build_dynamic_forms.py +++ b/src/fobi/tests/test_browser_build_dynamic_forms.py @@ -1,5 +1,7 @@ +import os import logging import unittest +from datetime import datetime # from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.wait import WebDriverWait @@ -7,6 +9,7 @@ from selenium.webdriver.common.action_chains import ActionChains from fobi.models import FormEntry +from django.conf import settings from django.urls import reverse from . import constants @@ -600,6 +603,10 @@ class FobiBrowserBuldDynamicFormsTest(BaseFobiBrowserBuldDynamicFormsTest): # the class based views than the correspondent function based views. # find out why and fix. As temporary workaround, we're waiting # twice as long as the normal timeout. + _now = datetime.now().strftime('%Y-%m-%d_%H-%M-%S') + _file = os.path.join(settings.STATIC_ROOT, 'screenshot-%s.png' % _now) + logger.exception(f"!!!!!!!!!! file: {_file}") + self.driver.get_screenshot_as_file(_file) WebDriverWait(self.driver, timeout=TIMEOUT*2).until( lambda driver: driver.find_element_by_xpath( """//div[contains(text(), 'Form {0} was submitted """