2022-09-24 20:11:01 +02:00
|
|
|
import pytest
|
|
|
|
from django.core.management import call_command
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
|
|
def _collectstatic():
|
|
|
|
call_command("collectstatic", interactive=False, verbosity=0)
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture()
|
|
|
|
def live_server(settings, live_server):
|
2023-04-29 22:41:14 +02:00
|
|
|
settings.STORAGES = {
|
|
|
|
"default": {
|
|
|
|
"BACKEND": "django.core.files.storage.FileSystemStorage",
|
|
|
|
},
|
|
|
|
"staticfiles": {
|
|
|
|
"BACKEND": "whitenoise.storage.CompressedStaticFilesStorage",
|
|
|
|
},
|
|
|
|
}
|
2022-09-24 20:11:01 +02:00
|
|
|
return live_server
|
|
|
|
|
|
|
|
|
2023-03-25 20:28:15 +01:00
|
|
|
@pytest.fixture()
|
|
|
|
def firefox_options(firefox_options):
|
2023-03-27 16:53:01 +02:00
|
|
|
firefox_options.add_argument("-headless")
|
2023-03-25 20:28:15 +01:00
|
|
|
return firefox_options
|
|
|
|
|
|
|
|
|
2022-09-24 20:11:01 +02:00
|
|
|
@pytest.fixture()
|
|
|
|
def selenium(selenium):
|
|
|
|
selenium.implicitly_wait(3)
|
2023-03-25 20:35:16 +01:00
|
|
|
selenium.set_window_size(3860, 2140)
|
2022-09-24 20:11:01 +02:00
|
|
|
return selenium
|