@@ -1676,8 +1676,23 @@ def pytest_configure(config):
16761676 sb_config .browser = config .getoption ("browser" )
16771677 if sb_config ._browser_shortcut :
16781678 sb_config .browser = sb_config ._browser_shortcut
1679- if sb_config .browser in constants .ChromiumSubs .chromium_subs :
1680- sb_config .browser = "chrome" # Still uses chromedriver
1679+ elif sys_argv == ["-c" ]: # Multithreading messes with args
1680+ if config .getoption ("use_opera" ):
1681+ bin_loc = detect_b_ver .get_binary_location ("opera" )
1682+ if bin_loc and os .path .exists (bin_loc ):
1683+ sb_config .browser = "opera"
1684+ elif config .getoption ("use_brave" ):
1685+ bin_loc = detect_b_ver .get_binary_location ("brave" )
1686+ if bin_loc and os .path .exists (bin_loc ):
1687+ sb_config .browser = "brave"
1688+ elif config .getoption ("use_comet" ):
1689+ bin_loc = detect_b_ver .get_binary_location ("comet" )
1690+ if bin_loc and os .path .exists (bin_loc ):
1691+ sb_config .browser = "comet"
1692+ elif config .getoption ("use_atlas" ):
1693+ bin_loc = detect_b_ver .get_binary_location ("atlas" )
1694+ if bin_loc and os .path .exists (bin_loc ):
1695+ sb_config .browser = "atlas"
16811696 sb_config .account = config .getoption ("account" )
16821697 sb_config .data = config .getoption ("data" )
16831698 sb_config .var1 = config .getoption ("var1" )
@@ -1714,6 +1729,35 @@ def pytest_configure(config):
17141729 sb_config .binary_location = config .getoption ("binary_location" )
17151730 if hasattr (sb_config , "_cdp_bin_loc" ) and sb_config ._cdp_bin_loc :
17161731 sb_config .binary_location = sb_config ._cdp_bin_loc
1732+ elif not sb_config .binary_location :
1733+ if (
1734+ config .getoption ("use_opera" )
1735+ or sb_config ._browser_shortcut == "opera"
1736+ ):
1737+ bin_loc = detect_b_ver .get_binary_location ("opera" )
1738+ if bin_loc and os .path .exists (bin_loc ):
1739+ sb_config .binary_location = bin_loc
1740+ elif (
1741+ config .getoption ("use_brave" )
1742+ or sb_config ._browser_shortcut == "brave"
1743+ ):
1744+ bin_loc = detect_b_ver .get_binary_location ("brave" )
1745+ if bin_loc and os .path .exists (bin_loc ):
1746+ sb_config .binary_location = bin_loc
1747+ elif (
1748+ config .getoption ("use_comet" )
1749+ or sb_config ._browser_shortcut == "comet"
1750+ ):
1751+ bin_loc = detect_b_ver .get_binary_location ("comet" )
1752+ if bin_loc and os .path .exists (bin_loc ):
1753+ sb_config .binary_location = bin_loc
1754+ elif (
1755+ config .getoption ("use_atlas" )
1756+ or sb_config ._browser_shortcut == "atlas"
1757+ ):
1758+ bin_loc = detect_b_ver .get_binary_location ("atlas" )
1759+ if bin_loc and os .path .exists (bin_loc ):
1760+ sb_config .binary_location = bin_loc
17171761 if config .getoption ("use_cft" ) and not sb_config .binary_location :
17181762 sb_config .binary_location = "cft"
17191763 elif config .getoption ("use_chs" ) and not sb_config .binary_location :
@@ -1726,6 +1770,10 @@ def pytest_configure(config):
17261770 sb_config .headless = True
17271771 sb_config .headless1 = False
17281772 sb_config .headless2 = False
1773+ if sb_config .browser in constants .ChromiumSubs .chromium_subs :
1774+ if not sb_config .binary_location :
1775+ sb_config .browser = "chrome" # Still uses chromedriver
1776+ sb_config ._browser_shortcut = sb_config .browser
17291777 sb_config .driver_version = config .getoption ("driver_version" )
17301778 sb_config .page_load_strategy = config .getoption ("page_load_strategy" )
17311779 sb_config .with_testing_base = config .getoption ("with_testing_base" )
0 commit comments