Add the "--proxy=STRING" option for manager formats

This commit is contained in:
Michael Mintz 2023-10-19 13:39:48 -04:00
parent ad9faec443
commit 40bdc0099e
2 changed files with 20 additions and 0 deletions

View File

@ -251,6 +251,16 @@ def Driver(
is_mobile = False
test_id = "direct_driver"
proxy_string = proxy
if proxy_string is None and "--proxy" in arg_join:
if "--proxy=" in arg_join:
proxy_string = arg_join.split("--proxy=")[1].split(" ")[0]
elif "--proxy " in arg_join:
proxy_string = arg_join.split("--proxy ")[1].split(" ")[0]
if proxy_string:
if proxy_string.startswith('"') and proxy_string.endswith('"'):
proxy_string = proxy_string[1:-1]
elif proxy_string.startswith("'") and proxy_string.endswith("'"):
proxy_string = proxy_string[1:-1]
user_agent = agent
recorder_mode = False
if recorder_ext:

View File

@ -312,6 +312,16 @@ def SB(
if is_mobile:
sb_config.mobile_emulator = True
proxy_string = proxy
if proxy_string is None and "--proxy" in arg_join:
if "--proxy=" in arg_join:
proxy_string = arg_join.split("--proxy=")[1].split(" ")[0]
elif "--proxy " in arg_join:
proxy_string = arg_join.split("--proxy ")[1].split(" ")[0]
if proxy_string:
if proxy_string.startswith('"') and proxy_string.endswith('"'):
proxy_string = proxy_string[1:-1]
elif proxy_string.startswith("'") and proxy_string.endswith("'"):
proxy_string = proxy_string[1:-1]
user_agent = agent
recorder_mode = False
if recorder_ext: