File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 2424
2525USE_ULTRAFAST_GRID = True
2626USE_EXECUTION_CLOUD = False
27- HEADLESS = False
2827
2928
3029# --------------------------------------------------------------------------------
@@ -41,6 +40,17 @@ def api_key():
4140 return os .getenv ('APPLITOOLS_API_KEY' )
4241
4342
43+ @pytest .fixture (scope = 'session' )
44+ def headless ():
45+ """
46+ Reads the headless mode setting from an environment variable.
47+ Uses headless mode for Continuous Integration (CI) execution.
48+ Uses headed mode for local development.
49+ """
50+ h = os .getenv ('HEADLESS' , default = 'false' )
51+ return h .lower () == 'true'
52+
53+
4454@pytest .fixture (scope = 'session' )
4555def runner ():
4656 """
@@ -114,14 +124,14 @@ def configuration(api_key: str, batch_info: BatchInfo):
114124# --------------------------------------------------------------------------------
115125
116126@pytest .fixture (scope = 'function' )
117- def webdriver ():
127+ def webdriver (headless : bool ):
118128 """
119129 Creates a WebDriver object for Chrome.
120130 After the test function finishes execution, quits the browser.
121131 """
122132
123133 options = ChromeOptions ()
124- options .headless = HEADLESS
134+ options .headless = headless
125135
126136 if USE_EXECUTION_CLOUD :
127137 driver = Remote (
You can’t perform that action at this time.
0 commit comments