mirror of
https://github.com/Hopiu/django-fobi.git
synced 2026-05-10 22:03:09 +00:00
* Django 4.1 support. * Fix `NullBooleanField` DRF deprecation. * Soft pin `importlib.metadata` * Obtain `chromedriver-py` using `get-chromedriver-py`. * Fix `selenium` deprecation errors. * Use testing email backend. * Install some linux deps in GitHub CI.
57 lines
1.7 KiB
Python
57 lines
1.7 KiB
Python
import logging
|
|
|
|
from selenium.webdriver.common.by import By
|
|
from selenium.webdriver.support.wait import WebDriverWait
|
|
|
|
import factories
|
|
|
|
from .base import BaseFobiBrowserBuldDynamicFormsTest
|
|
|
|
__title__ = "fobi.tests.test_feincms_integration"
|
|
__author__ = "Artur Barseghyan <artur.barseghyan@gmail.com>"
|
|
__copyright__ = "2014-2022 Artur Barseghyan"
|
|
__license__ = "GPL 2.0/LGPL 2.1"
|
|
__all__ = ("FeinCMSIntegrationTest",)
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
TIMEOUT = 4
|
|
LONG_TIMEOUT = 8
|
|
WAIT = False
|
|
WAIT_FOR = 0
|
|
|
|
|
|
class FeinCMSIntegrationTest(BaseFobiBrowserBuldDynamicFormsTest):
|
|
"""FeinCMS integration tests."""
|
|
|
|
def setUp(self):
|
|
super(FeinCMSIntegrationTest, self).setUp()
|
|
|
|
self.fobi_form_page = factories.FobiFormPageFactory()
|
|
self.fobi_form_page_url = "{0}{1}".format(
|
|
self._get_live_server_url(), self.fobi_form_page.get_absolute_url()
|
|
)
|
|
|
|
def test_fobi_form_widget_public_form(self):
|
|
"""Test fobi form widget."""
|
|
self.driver.get(self.fobi_form_page_url)
|
|
# Wait until the edit widget form opens
|
|
WebDriverWait(self.driver, timeout=TIMEOUT).until(
|
|
lambda driver: driver.find_element(
|
|
By.XPATH,
|
|
'//body[contains(@class, "theme-bootstrap3")]'
|
|
)
|
|
)
|
|
# TODO:
|
|
|
|
# def test_fobi_form_widget_private_form(self):
|
|
# """Test fobi form widget."""
|
|
# self.driver.get(self.fobi_form_page_url)
|
|
# # Wait until the edit widget form opens
|
|
# WebDriverWait(self.driver, timeout=TIMEOUT).until(
|
|
# lambda driver: driver.find_element(
|
|
# By.XPATH,
|
|
# '//body[contains(@class, "theme-bootstrap3")]'
|
|
# )
|
|
# )
|
|
# # TODO:
|