duplicate browsers to simulate multiple gamers in test envs now handle headless firefox in pipeline correctly
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
from django.conf import settings as django_settings
|
from django.conf import settings as django_settings
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
@@ -132,7 +134,10 @@ class RoleSelectTest(FunctionalTest):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Friend's browser
|
# Friend's browser
|
||||||
self.browser2 = webdriver.Firefox()
|
options2 = webdriver.FirefoxOptions()
|
||||||
|
if os.environ.get("HEADLESS"):
|
||||||
|
options2.add_argument("--headless")
|
||||||
|
self.browser2 = webdriver.Firefox(options=options2)
|
||||||
try:
|
try:
|
||||||
self.browser2.get(self.live_server_url + "/404_no_such_url/")
|
self.browser2.get(self.live_server_url + "/404_no_such_url/")
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@@ -510,7 +515,10 @@ class RoleSelectChannelsTest(ChannelsFunctionalTest):
|
|||||||
def _make_browser2(self, email):
|
def _make_browser2(self, email):
|
||||||
"""Spin up a second Firefox, authenticate email, return the browser."""
|
"""Spin up a second Firefox, authenticate email, return the browser."""
|
||||||
session_key = create_pre_authenticated_session(email)
|
session_key = create_pre_authenticated_session(email)
|
||||||
b = webdriver.Firefox()
|
options = webdriver.FirefoxOptions()
|
||||||
|
if os.environ.get("HEADLESS"):
|
||||||
|
options.add_argument("--headless")
|
||||||
|
b = webdriver.Firefox(options=options)
|
||||||
b.get(self.live_server_url + "/404_no_such_url/")
|
b.get(self.live_server_url + "/404_no_such_url/")
|
||||||
b.add_cookie(dict(
|
b.add_cookie(dict(
|
||||||
name=django_settings.SESSION_COOKIE_NAME,
|
name=django_settings.SESSION_COOKIE_NAME,
|
||||||
|
|||||||
Reference in New Issue
Block a user