Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions py/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ def fin():
if driver_instance is None:
if driver_class == "Firefox":
options = get_options(driver_class, request.config)
# There are issues with window size/position when running Firefox
# under Wayland, so we use XWayland instead.
os.environ["MOZ_ENABLE_WAYLAND"] = "0"
if platform.system() == "Linux":
# There are issues with window size/position when running Firefox
# under Wayland, so we use XWayland instead.
os.environ["MOZ_ENABLE_WAYLAND"] = "0"
if driver_class == "Chrome":
options = get_options(driver_class, request.config)
if driver_class == "Edge":
Expand All @@ -174,9 +175,6 @@ def fin():
options = get_options("Firefox", request.config) or webdriver.FirefoxOptions()
options.set_capability("moz:firefoxOptions", {})
options.enable_downloads = True
# There are issues with window size/position when running Firefox
# under Wayland, so we use XWayland instead.
os.environ["MOZ_ENABLE_WAYLAND"] = "0"
if driver_path is not None:
kwargs["service"] = get_service(driver_class, driver_path)
if options is not None:
Expand Down Expand Up @@ -315,6 +313,11 @@ def wait_for_server(url, timeout):
"is using port {}, continuing...".format(_port)
)
except Exception:
remote_env = os.environ.copy()
if platform.system() == "Linux":
# There are issues with window size/position when running Firefox
# under Wayland, so we use XWayland instead.
remote_env["MOZ_ENABLE_WAYLAND"] = "0"
print("Starting the Selenium server")
process = subprocess.Popen(
[
Expand All @@ -328,7 +331,8 @@ def wait_for_server(url, timeout):
"true",
"--enable-managed-downloads",
"true",
]
],
env=remote_env,
)
print(f"Selenium server running as process: {process.pid}")
assert wait_for_server(url, 10), f"Timed out waiting for Selenium server at {url}"
Expand Down
1 change: 1 addition & 0 deletions py/test/selenium/webdriver/common/api_example_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def test_is_element_displayed(driver, pages):

@pytest.mark.xfail_edge
@pytest.mark.xfail_firefox(reason="https://github.com/mozilla/geckodriver/issues/2224")
@pytest.mark.xfail_remote(reason="https://github.com/mozilla/geckodriver/issues/2224")
@pytest.mark.xfail_safari
def test_move_window_position(driver, pages):
pages.load("blank.html")
Expand Down
2 changes: 2 additions & 0 deletions py/test/selenium/webdriver/common/window_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def test_should_get_the_position_of_the_current_window(driver):
@pytest.mark.xfail_chrome
@pytest.mark.xfail_edge
@pytest.mark.xfail_firefox(reason="https://github.com/mozilla/geckodriver/issues/2224")
@pytest.mark.xfail_remote(reason="https://github.com/mozilla/geckodriver/issues/2224")
def test_should_set_the_position_of_the_current_window(driver):
position = driver.get_window_position()

Expand Down Expand Up @@ -94,6 +95,7 @@ def test_should_get_the_rect_of_the_current_window(driver):

@pytest.mark.xfail_edge
@pytest.mark.xfail_firefox(reason="https://github.com/mozilla/geckodriver/issues/2224")
@pytest.mark.xfail_remote(reason="https://github.com/mozilla/geckodriver/issues/2224")
@pytest.mark.xfail_safari(raises=WebDriverException, reason="Get Window Rect command not implemented")
def test_should_set_the_rect_of_the_current_window(driver):
rect = driver.get_window_rect()
Expand Down
Loading