Skip to content

Commit 39fe74e

Browse files
Made headless setting a hard-coded variable
1 parent e418521 commit 39fe74e

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

tests/conftest.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818

1919
# --------------------------------------------------------------------------------
2020
# Runner Settings
21+
# These could be set by environment variables or other input mechanisms.
22+
# They are hard-coded here to keep the example project simple.
2123
# --------------------------------------------------------------------------------
2224

2325
USE_ULTRAFAST_GRID = True
2426
USE_EXECUTION_CLOUD = False
27+
HEADLESS = False
2528

2629

2730
# --------------------------------------------------------------------------------
@@ -38,17 +41,6 @@ def api_key():
3841
return os.getenv('APPLITOOLS_API_KEY')
3942

4043

41-
@pytest.fixture(scope='session')
42-
def headless():
43-
"""
44-
Reads the headless mode setting from an environment variable.
45-
Uses headless mode for Continuous Integration (CI) execution.
46-
Uses headed mode for local development.
47-
"""
48-
h = os.getenv('HEADLESS', default='false')
49-
return h.lower() == 'true'
50-
51-
5244
@pytest.fixture(scope='session')
5345
def runner():
5446
"""
@@ -120,14 +112,14 @@ def configuration(api_key: str, batch_info: BatchInfo):
120112
# --------------------------------------------------------------------------------
121113

122114
@pytest.fixture(scope='function')
123-
def webdriver(headless: bool):
115+
def webdriver():
124116
"""
125117
Creates a WebDriver object for Chrome.
126118
After the test function finishes execution, quits the browser.
127119
"""
128120

129121
options = ChromeOptions()
130-
options.headless = headless
122+
options.headless = HEADLESS
131123

132124
if USE_EXECUTION_CLOUD:
133125
driver = Remote(

0 commit comments

Comments
 (0)