Skip to content

Commit 70806d5

Browse files
committed
Update UC Mode compatibility
1 parent d0b34aa commit 70806d5

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

seleniumbase/behave/behave_sb.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,16 @@ def get_configured_sb(context):
889889
# If the port is "443", the protocol is "https"
890890
if str(sb.port) == "443":
891891
sb.protocol = "https"
892+
if (
893+
(sb.enable_ws is None and sb.disable_ws is None)
894+
or (sb.disable_ws is not None and not sb.disable_ws)
895+
or (sb.enable_ws is not None and sb.enable_ws)
896+
):
897+
sb.enable_ws = True
898+
sb.disable_ws = False
899+
else:
900+
sb.enable_ws = False
901+
sb.disable_ws = True
892902
if sb.window_size:
893903
window_size = sb.window_size
894904
if window_size.count(",") != 1:

seleniumbase/fixtures/base_case.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16071,7 +16071,10 @@ def tearDown(self):
1607116071
try:
1607216072
self.driver.window_handles
1607316073
except Exception:
16074-
self.driver.connect()
16074+
try:
16075+
self.driver.connect()
16076+
except Exception:
16077+
pass
1607516078
self.__slow_mode_pause_if_active()
1607616079
has_exception = self.__has_exception()
1607716080
sb_config._has_exception = has_exception

0 commit comments

Comments
 (0)