Skip to content

Commit 3fea436

Browse files
authored
Merge branch 'trunk' into py-autoflake-formatting
2 parents 0134992 + f8ad18b commit 3fea436

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

py/conftest.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ def fin():
155155
if driver_instance is None:
156156
if driver_class == "Firefox":
157157
options = get_options(driver_class, request.config)
158-
# There are issues with window size/position when running Firefox
159-
# under Wayland, so we use XWayland instead.
160-
os.environ["MOZ_ENABLE_WAYLAND"] = "0"
158+
if platform.system() == "Linux":
159+
# There are issues with window size/position when running Firefox
160+
# under Wayland, so we use XWayland instead.
161+
os.environ["MOZ_ENABLE_WAYLAND"] = "0"
161162
if driver_class == "Chrome":
162163
options = get_options(driver_class, request.config)
163164
if driver_class == "Edge":
@@ -170,9 +171,6 @@ def fin():
170171
options = get_options("Firefox", request.config) or webdriver.FirefoxOptions()
171172
options.set_capability("moz:firefoxOptions", {})
172173
options.enable_downloads = True
173-
# There are issues with window size/position when running Firefox
174-
# under Wayland, so we use XWayland instead.
175-
os.environ["MOZ_ENABLE_WAYLAND"] = "0"
176174
if driver_path is not None:
177175
kwargs["service"] = get_service(driver_class, driver_path)
178176
if options is not None:
@@ -310,6 +308,11 @@ def wait_for_server(url, timeout):
310308
"is using port {}, continuing...".format(_port)
311309
)
312310
except Exception:
311+
remote_env = os.environ.copy()
312+
if platform.system() == "Linux":
313+
# There are issues with window size/position when running Firefox
314+
# under Wayland, so we use XWayland instead.
315+
remote_env["MOZ_ENABLE_WAYLAND"] = "0"
313316
print("Starting the Selenium server")
314317
process = subprocess.Popen(
315318
[
@@ -323,7 +326,8 @@ def wait_for_server(url, timeout):
323326
"true",
324327
"--enable-managed-downloads",
325328
"true",
326-
]
329+
],
330+
env=remote_env,
327331
)
328332
print(f"Selenium server running as process: {process.pid}")
329333
assert wait_for_server(url, 10), f"Timed out waiting for Selenium server at {url}"

py/test/selenium/webdriver/common/api_example_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ def test_is_element_displayed(driver, pages):
239239

240240
@pytest.mark.xfail_edge
241241
@pytest.mark.xfail_firefox(reason="https://github.com/mozilla/geckodriver/issues/2224")
242+
@pytest.mark.xfail_remote(reason="https://github.com/mozilla/geckodriver/issues/2224")
242243
@pytest.mark.xfail_safari
243244
def test_move_window_position(driver, pages):
244245
pages.load("blank.html")

py/test/selenium/webdriver/common/window_tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def test_should_get_the_position_of_the_current_window(driver):
6767
@pytest.mark.xfail_chrome
6868
@pytest.mark.xfail_edge
6969
@pytest.mark.xfail_firefox(reason="https://github.com/mozilla/geckodriver/issues/2224")
70+
@pytest.mark.xfail_remote(reason="https://github.com/mozilla/geckodriver/issues/2224")
7071
def test_should_set_the_position_of_the_current_window(driver):
7172
position = driver.get_window_position()
7273

@@ -94,6 +95,7 @@ def test_should_get_the_rect_of_the_current_window(driver):
9495

9596
@pytest.mark.xfail_edge
9697
@pytest.mark.xfail_firefox(reason="https://github.com/mozilla/geckodriver/issues/2224")
98+
@pytest.mark.xfail_remote(reason="https://github.com/mozilla/geckodriver/issues/2224")
9799
@pytest.mark.xfail_safari(raises=WebDriverException, reason="Get Window Rect command not implemented")
98100
def test_should_set_the_rect_of_the_current_window(driver):
99101
rect = driver.get_window_rect()

0 commit comments

Comments
 (0)