File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -940,6 +940,9 @@ def get_driver(
940
940
headless = True
941
941
if uc_subprocess and not undetectable :
942
942
undetectable = True
943
+ if undetectable and mobile_emulator :
944
+ mobile_emulator = False
945
+ user_agent = None
943
946
proxy_auth = False
944
947
proxy_user = None
945
948
proxy_pass = None
Original file line number Diff line number Diff line change @@ -1294,6 +1294,17 @@ def pytest_addoption(parser):
1294
1294
'\n (Your browser choice was: "%s")\n ' % browser_list [0 ]
1295
1295
)
1296
1296
raise Exception (message )
1297
+ if undetectable and "--wire" in sys_argv :
1298
+ raise Exception (
1299
+ "\n \n SeleniumBase doesn't support mixing --uc with --wire mode!"
1300
+ "\n If you need both, override get_new_driver() from BaseCase:"
1301
+ "\n https://seleniumbase.io/help_docs/syntax_formats/#sb_sf_09\n "
1302
+ )
1303
+ if undetectable and "--mobile" in sys_argv :
1304
+ raise Exception (
1305
+ "\n \n SeleniumBase doesn't support mixing --uc with --mobile"
1306
+ '\n UC has: "unrecognized chrome option: mobileEmulation"!\n '
1307
+ )
1297
1308
1298
1309
1299
1310
def pytest_configure (config ):
Original file line number Diff line number Diff line change @@ -980,6 +980,26 @@ def beforeTest(self, test):
980
980
)
981
981
self .options .headless = True
982
982
test .test .headless = True
983
+ if self .options .use_wire and self .options .undetectable :
984
+ print (
985
+ "\n "
986
+ "SeleniumBase doesn't support mixing --uc with --wire mode.\n "
987
+ "If you need both, override get_new_driver() from BaseCase:\n "
988
+ "https://seleniumbase.io/help_docs/syntax_formats/#sb_sf_09\n "
989
+ "(Only UC Mode without Wire Mode will be used for this run)\n "
990
+ )
991
+ self .options .use_wire = False
992
+ test .test .use_wire = False
993
+ if self .options .mobile_emulator and self .options .undetectable :
994
+ print (
995
+ "\n "
996
+ "SeleniumBase doesn't support mixing --uc with --mobile.\n "
997
+ "(Only UC Mode without Mobile will be used for this run)\n "
998
+ )
999
+ self .options .mobile_emulator = False
1000
+ test .test .mobile_emulator = False
1001
+ self .options .user_agent = None
1002
+ test .test .user_agent = None
983
1003
# Recorder Mode can still optimize scripts in --headless2 mode.
984
1004
if self .options .recorder_mode and self .options .headless :
985
1005
self .options .headless = False
You can’t perform that action at this time.
0 commit comments