mirror of
https://github.com/Hopiu/django-fobi.git
synced 2026-05-23 19:55:49 +00:00
Log errors
This commit is contained in:
parent
359a05562f
commit
767170faae
1 changed files with 7 additions and 0 deletions
|
|
@ -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 """
|
||||
|
|
|
|||
Loading…
Reference in a new issue