Skip to content

Commit 7e6ffa6

Browse files
committed
Attempt to fix unrelated test failure on Linux
1 parent 8f4be04 commit 7e6ffa6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/security_and_privacy/test_https_enabled_private_browsing.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from time import sleep
2+
13
import pytest
24
from selenium.webdriver import Firefox
35
from selenium.webdriver.support.wait import WebDriverWait
@@ -25,8 +27,16 @@ def test_https_first_mode_in_private_browsing(driver: Firefox):
2527
prefs.select_https_only_setting(prefs.HTTPS_ONLY_STATUS.HTTPS_ONLY_PRIVATE)
2628
hamburger = PanelUi(driver)
2729
hamburger.open_private_window()
28-
nav = Navigation(driver)
29-
nav.switch_to_new_window()
30+
31+
# nav = Navigation(driver)
32+
# nav.switch_to_new_window()
33+
34+
# Using this instead of switch_to_new_window, suspect that may be unstable
35+
# on Linux CI machines. (slow to actually fully load the new Window)
36+
non_private_window = driver.current_window_handle
37+
original_window_idx = driver.window_handles.index(non_private_window)
38+
private_window = driver.window_handles[1 - original_window_idx]
39+
driver.switch_to.window(private_window)
3040
driver.get(HTTP_SITE)
3141

3242
# Wait for the URL to be redirected to HTTPS

0 commit comments

Comments
 (0)