seleniumbase 4.43.2__py3-none-any.whl → 4.44.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1530,7 +1530,7 @@ def save_page_source(driver, name, folder=None):
1530
1530
  rendered_source = log_helper.get_html_source_with_base_href(
1531
1531
  driver, page_source
1532
1532
  )
1533
- html_file = open(html_file_path, "w+", "utf-8")
1533
+ html_file = open(html_file_path, mode="w+", encoding="utf-8")
1534
1534
  html_file.write(rendered_source)
1535
1535
  html_file.close()
1536
1536
 
@@ -239,6 +239,7 @@ def Driver(
239
239
  from seleniumbase import config as sb_config
240
240
  from seleniumbase.config import settings
241
241
  from seleniumbase.core import browser_launcher
242
+ from seleniumbase.core import detect_b_ver
242
243
  from seleniumbase.fixtures import constants
243
244
  from seleniumbase.fixtures import shared_utils
244
245
 
@@ -271,10 +272,37 @@ def Driver(
271
272
  )
272
273
  elif existing_runner:
273
274
  sb_config._context_of_runner = True
275
+ sb_config._browser_shortcut = None
276
+ sb_config._cdp_browser = None
277
+ sb_config._cdp_bin_loc = None
274
278
  browser_changes = 0
275
279
  browser_set = None
276
280
  browser_text = None
277
281
  browser_list = []
282
+ # Check if binary-location in options
283
+ bin_loc_in_options = False
284
+ if (
285
+ binary_location
286
+ and len(str(binary_location)) > 5
287
+ and os.path.exists(str(binary_location))
288
+ ):
289
+ bin_loc_in_options = True
290
+ else:
291
+ for arg in sys_argv:
292
+ if arg in ["--binary-location", "--binary_location", "--bl"]:
293
+ bin_loc_in_options = True
294
+ if (
295
+ browser
296
+ and browser in constants.ChromiumSubs.chromium_subs
297
+ and not bin_loc_in_options
298
+ ):
299
+ bin_loc = detect_b_ver.get_binary_location(browser)
300
+ if bin_loc and os.path.exists(bin_loc):
301
+ if browser in bin_loc.lower().split("/")[-1].split("\\")[-1]:
302
+ sb_config._cdp_browser = browser
303
+ sb_config._cdp_bin_loc = bin_loc
304
+ binary_location = bin_loc
305
+ bin_loc_in_options = True
278
306
  # As a shortcut, you can use "--edge" instead of "--browser=edge", etc,
279
307
  # but you can only specify one default browser for tests. (Default: chrome)
280
308
  if "--browser=chrome" in sys_argv or "--browser chrome" in sys_argv:
@@ -301,6 +329,46 @@ def Driver(
301
329
  browser_changes += 1
302
330
  browser_set = "remote"
303
331
  browser_list.append("--browser=remote")
332
+ if "--browser=opera" in sys_argv or "--browser opera" in sys_argv:
333
+ if not bin_loc_in_options:
334
+ bin_loc = detect_b_ver.get_binary_location("opera")
335
+ if os.path.exists(bin_loc):
336
+ browser_changes += 1
337
+ browser_set = "opera"
338
+ sb_config._browser_shortcut = "opera"
339
+ sb_config._cdp_browser = "opera"
340
+ sb_config._cdp_bin_loc = bin_loc
341
+ browser_list.append("--browser=opera")
342
+ if "--browser=brave" in sys_argv or "--browser brave" in sys_argv:
343
+ if not bin_loc_in_options:
344
+ bin_loc = detect_b_ver.get_binary_location("brave")
345
+ if os.path.exists(bin_loc):
346
+ browser_changes += 1
347
+ browser_set = "brave"
348
+ sb_config._browser_shortcut = "brave"
349
+ sb_config._cdp_browser = "brave"
350
+ sb_config._cdp_bin_loc = bin_loc
351
+ browser_list.append("--browser=brave")
352
+ if "--browser=comet" in sys_argv or "--browser comet" in sys_argv:
353
+ if not bin_loc_in_options:
354
+ bin_loc = detect_b_ver.get_binary_location("comet")
355
+ if os.path.exists(bin_loc):
356
+ browser_changes += 1
357
+ browser_set = "comet"
358
+ sb_config._browser_shortcut = "comet"
359
+ sb_config._cdp_browser = "comet"
360
+ sb_config._cdp_bin_loc = bin_loc
361
+ browser_list.append("--browser=comet")
362
+ if "--browser=atlas" in sys_argv or "--browser atlas" in sys_argv:
363
+ if not bin_loc_in_options:
364
+ bin_loc = detect_b_ver.get_binary_location("atlas")
365
+ if os.path.exists(bin_loc):
366
+ browser_changes += 1
367
+ browser_set = "atlas"
368
+ sb_config._browser_shortcut = "atlas"
369
+ sb_config._cdp_browser = "atlas"
370
+ sb_config._cdp_bin_loc = bin_loc
371
+ browser_list.append("--browser=atlas")
304
372
  browser_text = browser_set
305
373
  if "--chrome" in sys_argv and not browser_set == "chrome":
306
374
  browser_changes += 1
@@ -322,6 +390,46 @@ def Driver(
322
390
  browser_changes += 1
323
391
  browser_text = "safari"
324
392
  browser_list.append("--safari")
393
+ if "--opera" in sys_argv and not browser_set == "opera":
394
+ if not bin_loc_in_options:
395
+ bin_loc = detect_b_ver.get_binary_location("opera")
396
+ if os.path.exists(bin_loc):
397
+ browser_changes += 1
398
+ browser_text = "opera"
399
+ sb_config._browser_shortcut = "opera"
400
+ sb_config._cdp_browser = "opera"
401
+ sb_config._cdp_bin_loc = bin_loc
402
+ browser_list.append("--opera")
403
+ if "--brave" in sys_argv and not browser_set == "brave":
404
+ if not bin_loc_in_options:
405
+ bin_loc = detect_b_ver.get_binary_location("brave")
406
+ if os.path.exists(bin_loc):
407
+ browser_changes += 1
408
+ browser_text = "brave"
409
+ sb_config._browser_shortcut = "brave"
410
+ sb_config._cdp_browser = "brave"
411
+ sb_config._cdp_bin_loc = bin_loc
412
+ browser_list.append("--brave")
413
+ if "--comet" in sys_argv and not browser_set == "comet":
414
+ if not bin_loc_in_options:
415
+ bin_loc = detect_b_ver.get_binary_location("comet")
416
+ if os.path.exists(bin_loc):
417
+ browser_changes += 1
418
+ browser_text = "comet"
419
+ sb_config._browser_shortcut = "comet"
420
+ sb_config._cdp_browser = "comet"
421
+ sb_config._cdp_bin_loc = bin_loc
422
+ browser_list.append("--comet")
423
+ if "--atlas" in sys_argv and not browser_set == "atlas":
424
+ if not bin_loc_in_options:
425
+ bin_loc = detect_b_ver.get_binary_location("atlas")
426
+ if os.path.exists(bin_loc):
427
+ browser_changes += 1
428
+ browser_text = "atlas"
429
+ sb_config._browser_shortcut = "atlas"
430
+ sb_config._cdp_browser = "atlas"
431
+ sb_config._cdp_bin_loc = bin_loc
432
+ browser_list.append("--atlas")
325
433
  if browser_changes > 1:
326
434
  message = "\n\n TOO MANY browser types were entered!"
327
435
  message += "\n There were %s found:\n > %s" % (
@@ -345,6 +453,8 @@ def Driver(
345
453
  "Browser: {%s} is not a valid browser option. "
346
454
  "Valid options = {%s}" % (browser, valid_browsers)
347
455
  )
456
+ if sb_config._browser_shortcut:
457
+ browser = sb_config._browser_shortcut
348
458
  if headless is None:
349
459
  if "--headless" in sys_argv:
350
460
  headless = True
@@ -534,6 +644,8 @@ def Driver(
534
644
  count += 1
535
645
  user_agent = agent
536
646
  found_bl = None
647
+ if hasattr(sb_config, "_cdp_bin_loc") and sb_config._cdp_bin_loc:
648
+ binary_location = sb_config._cdp_bin_loc
537
649
  if binary_location is None and "--binary-location" in arg_join:
538
650
  count = 0
539
651
  for arg in sys_argv:
@@ -839,6 +951,10 @@ def Driver(
839
951
  driver_version = None
840
952
  break
841
953
  count += 1
954
+ if browser in constants.ChromiumSubs.chromium_subs:
955
+ if not binary_location:
956
+ browser = "chrome" # Still uses chromedriver
957
+ sb_config._browser_shortcut = browser
842
958
  browser_name = browser
843
959
 
844
960
  # Launch a web browser
@@ -7,6 +7,7 @@ import time
7
7
  from contextlib import suppress
8
8
  from seleniumbase import config as sb_config
9
9
  from seleniumbase.config import settings
10
+ from seleniumbase.core import detect_b_ver
10
11
  from seleniumbase.core import log_helper
11
12
  from seleniumbase.fixtures import constants
12
13
  from seleniumbase.fixtures import shared_utils
@@ -28,6 +29,10 @@ def pytest_addoption(parser):
28
29
  --edge (Shortcut for "--browser=edge".)
29
30
  --firefox (Shortcut for "--browser=firefox".)
30
31
  --safari (Shortcut for "--browser=safari".)
32
+ --opera (Shortcut for "--browser=opera".)
33
+ --brave (Shortcut for "--browser=brave".)
34
+ --comet (Shortcut for "--browser=comet".)
35
+ --atlas (Shortcut for "--browser=atlas".)
31
36
  --cft (Shortcut for using `Chrome for Testing`)
32
37
  --chs (Shortcut for using `Chrome-Headless-Shell`)
33
38
  --settings-file=FILE (Override default SeleniumBase settings.)
@@ -186,6 +191,34 @@ def pytest_addoption(parser):
186
191
  default=False,
187
192
  help="""Shortcut for --browser=safari""",
188
193
  )
194
+ parser.addoption(
195
+ "--opera",
196
+ action="store_true",
197
+ dest="use_opera",
198
+ default=False,
199
+ help="""Shortcut for --browser=opera""",
200
+ )
201
+ parser.addoption(
202
+ "--brave",
203
+ action="store_true",
204
+ dest="use_brave",
205
+ default=False,
206
+ help="""Shortcut for --browser=brave""",
207
+ )
208
+ parser.addoption(
209
+ "--comet",
210
+ action="store_true",
211
+ dest="use_comet",
212
+ default=False,
213
+ help="""Shortcut for --browser=comet""",
214
+ )
215
+ parser.addoption(
216
+ "--atlas",
217
+ action="store_true",
218
+ dest="use_atlas",
219
+ default=False,
220
+ help="""Shortcut for --browser=atlas""",
221
+ )
189
222
  parser.addoption(
190
223
  "--cft",
191
224
  action="store_true",
@@ -1388,8 +1421,14 @@ def pytest_addoption(parser):
1388
1421
 
1389
1422
  arg_join = " ".join(sys_argv)
1390
1423
  sb_config._browser_shortcut = None
1424
+ sb_config._cdp_browser = None
1425
+ sb_config._cdp_bin_loc = None
1391
1426
  sb_config._vd_list = []
1392
-
1427
+ # Check if binary-location in options
1428
+ bin_loc_in_options = False
1429
+ for arg in sys_argv:
1430
+ if arg in ["--binary-location", "--binary_location", "--bl"]:
1431
+ bin_loc_in_options = True
1393
1432
  # SeleniumBase does not support pytest-timeout due to hanging browsers.
1394
1433
  for arg in sys_argv:
1395
1434
  if "--timeout=" in arg:
@@ -1465,6 +1504,46 @@ def pytest_addoption(parser):
1465
1504
  browser_changes += 1
1466
1505
  browser_set = "remote"
1467
1506
  browser_list.append("--browser=remote")
1507
+ if "--browser=opera" in sys_argv or "--browser opera" in sys_argv:
1508
+ if not bin_loc_in_options:
1509
+ bin_loc = detect_b_ver.get_binary_location("opera")
1510
+ if os.path.exists(bin_loc):
1511
+ browser_changes += 1
1512
+ browser_set = "opera"
1513
+ sb_config._browser_shortcut = "opera"
1514
+ sb_config._cdp_browser = "opera"
1515
+ sb_config._cdp_bin_loc = bin_loc
1516
+ browser_list.append("--browser=opera")
1517
+ if "--browser=brave" in sys_argv or "--browser brave" in sys_argv:
1518
+ if not bin_loc_in_options:
1519
+ bin_loc = detect_b_ver.get_binary_location("brave")
1520
+ if os.path.exists(bin_loc):
1521
+ browser_changes += 1
1522
+ browser_set = "brave"
1523
+ sb_config._browser_shortcut = "brave"
1524
+ sb_config._cdp_browser = "brave"
1525
+ sb_config._cdp_bin_loc = bin_loc
1526
+ browser_list.append("--browser=brave")
1527
+ if "--browser=comet" in sys_argv or "--browser comet" in sys_argv:
1528
+ if not bin_loc_in_options:
1529
+ bin_loc = detect_b_ver.get_binary_location("comet")
1530
+ if os.path.exists(bin_loc):
1531
+ browser_changes += 1
1532
+ browser_set = "comet"
1533
+ sb_config._browser_shortcut = "comet"
1534
+ sb_config._cdp_browser = "comet"
1535
+ sb_config._cdp_bin_loc = bin_loc
1536
+ browser_list.append("--browser=comet")
1537
+ if "--browser=atlas" in sys_argv or "--browser atlas" in sys_argv:
1538
+ if not bin_loc_in_options:
1539
+ bin_loc = detect_b_ver.get_binary_location("atlas")
1540
+ if os.path.exists(bin_loc):
1541
+ browser_changes += 1
1542
+ browser_set = "atlas"
1543
+ sb_config._browser_shortcut = "atlas"
1544
+ sb_config._cdp_browser = "atlas"
1545
+ sb_config._cdp_bin_loc = bin_loc
1546
+ browser_list.append("--browser=atlas")
1468
1547
  browser_text = browser_set
1469
1548
  if "--chrome" in sys_argv and not browser_set == "chrome":
1470
1549
  browser_changes += 1
@@ -1491,6 +1570,46 @@ def pytest_addoption(parser):
1491
1570
  browser_text = "safari"
1492
1571
  sb_config._browser_shortcut = "safari"
1493
1572
  browser_list.append("--safari")
1573
+ if "--opera" in sys_argv and not browser_set == "opera":
1574
+ if not bin_loc_in_options:
1575
+ bin_loc = detect_b_ver.get_binary_location("opera")
1576
+ if os.path.exists(bin_loc):
1577
+ browser_changes += 1
1578
+ browser_text = "opera"
1579
+ sb_config._browser_shortcut = "opera"
1580
+ sb_config._cdp_browser = "opera"
1581
+ sb_config._cdp_bin_loc = bin_loc
1582
+ browser_list.append("--opera")
1583
+ if "--brave" in sys_argv and not browser_set == "brave":
1584
+ if not bin_loc_in_options:
1585
+ bin_loc = detect_b_ver.get_binary_location("brave")
1586
+ if os.path.exists(bin_loc):
1587
+ browser_changes += 1
1588
+ browser_text = "brave"
1589
+ sb_config._browser_shortcut = "brave"
1590
+ sb_config._cdp_browser = "brave"
1591
+ sb_config._cdp_bin_loc = bin_loc
1592
+ browser_list.append("--brave")
1593
+ if "--comet" in sys_argv and not browser_set == "comet":
1594
+ if not bin_loc_in_options:
1595
+ bin_loc = detect_b_ver.get_binary_location("comet")
1596
+ if os.path.exists(bin_loc):
1597
+ browser_changes += 1
1598
+ browser_text = "comet"
1599
+ sb_config._browser_shortcut = "comet"
1600
+ sb_config._cdp_browser = "comet"
1601
+ sb_config._cdp_bin_loc = bin_loc
1602
+ browser_list.append("--comet")
1603
+ if "--atlas" in sys_argv and not browser_set == "atlas":
1604
+ if not bin_loc_in_options:
1605
+ bin_loc = detect_b_ver.get_binary_location("atlas")
1606
+ if os.path.exists(bin_loc):
1607
+ browser_changes += 1
1608
+ browser_text = "atlas"
1609
+ sb_config._browser_shortcut = "atlas"
1610
+ sb_config._cdp_browser = "atlas"
1611
+ sb_config._cdp_bin_loc = bin_loc
1612
+ browser_list.append("--atlas")
1494
1613
  if browser_changes > 1:
1495
1614
  message = "\n TOO MANY browser types were entered!"
1496
1615
  message += "\n There were %s found:\n > %s" % (
@@ -1525,7 +1644,7 @@ def pytest_addoption(parser):
1525
1644
  undetectable = True
1526
1645
  if (
1527
1646
  browser_changes == 1
1528
- and browser_text not in ["chrome"]
1647
+ and browser_text not in ["chrome", "opera", "brave", "comet", "atlas"]
1529
1648
  and undetectable
1530
1649
  ):
1531
1650
  message = (
@@ -1557,6 +1676,23 @@ def pytest_configure(config):
1557
1676
  sb_config.browser = config.getoption("browser")
1558
1677
  if sb_config._browser_shortcut:
1559
1678
  sb_config.browser = sb_config._browser_shortcut
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"
1560
1696
  sb_config.account = config.getoption("account")
1561
1697
  sb_config.data = config.getoption("data")
1562
1698
  sb_config.var1 = config.getoption("var1")
@@ -1591,6 +1727,37 @@ def pytest_configure(config):
1591
1727
  sb_config.extension_dir = config.getoption("extension_dir")
1592
1728
  sb_config.disable_features = config.getoption("disable_features")
1593
1729
  sb_config.binary_location = config.getoption("binary_location")
1730
+ if hasattr(sb_config, "_cdp_bin_loc") and sb_config._cdp_bin_loc:
1731
+ 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
1594
1761
  if config.getoption("use_cft") and not sb_config.binary_location:
1595
1762
  sb_config.binary_location = "cft"
1596
1763
  elif config.getoption("use_chs") and not sb_config.binary_location:
@@ -1603,6 +1770,10 @@ def pytest_configure(config):
1603
1770
  sb_config.headless = True
1604
1771
  sb_config.headless1 = False
1605
1772
  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
1606
1777
  sb_config.driver_version = config.getoption("driver_version")
1607
1778
  sb_config.page_load_strategy = config.getoption("page_load_strategy")
1608
1779
  sb_config.with_testing_base = config.getoption("with_testing_base")
@@ -267,6 +267,7 @@ def SB(
267
267
  import traceback
268
268
  from seleniumbase import config as sb_config
269
269
  from seleniumbase.config import settings
270
+ from seleniumbase.core import detect_b_ver
270
271
  from seleniumbase.fixtures import constants
271
272
  from seleniumbase.fixtures import shared_utils
272
273
 
@@ -334,10 +335,37 @@ def SB(
334
335
  raise_test_failure = True # Exit on first error or failed test.
335
336
  else:
336
337
  raise_test_failure = False
338
+ sb_config._browser_shortcut = None
339
+ sb_config._cdp_browser = None
340
+ sb_config._cdp_bin_loc = None
337
341
  browser_changes = 0
338
342
  browser_set = None
339
343
  browser_text = None
340
344
  browser_list = []
345
+ # Check if binary-location in options
346
+ bin_loc_in_options = False
347
+ if (
348
+ binary_location
349
+ and len(str(binary_location)) > 5
350
+ and os.path.exists(str(binary_location))
351
+ ):
352
+ bin_loc_in_options = True
353
+ else:
354
+ for arg in sys_argv:
355
+ if arg in ["--binary-location", "--binary_location", "--bl"]:
356
+ bin_loc_in_options = True
357
+ if (
358
+ browser
359
+ and browser in constants.ChromiumSubs.chromium_subs
360
+ and not bin_loc_in_options
361
+ ):
362
+ bin_loc = detect_b_ver.get_binary_location(browser)
363
+ if bin_loc and os.path.exists(bin_loc):
364
+ if browser in bin_loc.lower().split("/")[-1].split("\\")[-1]:
365
+ sb_config._cdp_browser = browser
366
+ sb_config._cdp_bin_loc = bin_loc
367
+ binary_location = bin_loc
368
+ bin_loc_in_options = True
341
369
  # As a shortcut, you can use "--edge" instead of "--browser=edge", etc,
342
370
  # but you can only specify one default browser for tests. (Default: chrome)
343
371
  if "--browser=chrome" in sys_argv or "--browser chrome" in sys_argv:
@@ -364,6 +392,46 @@ def SB(
364
392
  browser_changes += 1
365
393
  browser_set = "remote"
366
394
  browser_list.append("--browser=remote")
395
+ if "--browser=opera" in sys_argv or "--browser opera" in sys_argv:
396
+ if not bin_loc_in_options:
397
+ bin_loc = detect_b_ver.get_binary_location("opera")
398
+ if os.path.exists(bin_loc):
399
+ browser_changes += 1
400
+ browser_set = "opera"
401
+ sb_config._browser_shortcut = "opera"
402
+ sb_config._cdp_browser = "opera"
403
+ sb_config._cdp_bin_loc = bin_loc
404
+ browser_list.append("--browser=opera")
405
+ if "--browser=brave" in sys_argv or "--browser brave" in sys_argv:
406
+ if not bin_loc_in_options:
407
+ bin_loc = detect_b_ver.get_binary_location("brave")
408
+ if os.path.exists(bin_loc):
409
+ browser_changes += 1
410
+ browser_set = "brave"
411
+ sb_config._browser_shortcut = "brave"
412
+ sb_config._cdp_browser = "brave"
413
+ sb_config._cdp_bin_loc = bin_loc
414
+ browser_list.append("--browser=brave")
415
+ if "--browser=comet" in sys_argv or "--browser comet" in sys_argv:
416
+ if not bin_loc_in_options:
417
+ bin_loc = detect_b_ver.get_binary_location("comet")
418
+ if os.path.exists(bin_loc):
419
+ browser_changes += 1
420
+ browser_set = "comet"
421
+ sb_config._browser_shortcut = "comet"
422
+ sb_config._cdp_browser = "comet"
423
+ sb_config._cdp_bin_loc = bin_loc
424
+ browser_list.append("--browser=comet")
425
+ if "--browser=atlas" in sys_argv or "--browser atlas" in sys_argv:
426
+ if not bin_loc_in_options:
427
+ bin_loc = detect_b_ver.get_binary_location("atlas")
428
+ if os.path.exists(bin_loc):
429
+ browser_changes += 1
430
+ browser_set = "atlas"
431
+ sb_config._browser_shortcut = "atlas"
432
+ sb_config._cdp_browser = "atlas"
433
+ sb_config._cdp_bin_loc = bin_loc
434
+ browser_list.append("--browser=atlas")
367
435
  browser_text = browser_set
368
436
  if "--chrome" in sys_argv and not browser_set == "chrome":
369
437
  browser_changes += 1
@@ -390,6 +458,46 @@ def SB(
390
458
  browser_text = "safari"
391
459
  sb_config._browser_shortcut = "safari"
392
460
  browser_list.append("--safari")
461
+ if "--opera" in sys_argv and not browser_set == "opera":
462
+ if not bin_loc_in_options:
463
+ bin_loc = detect_b_ver.get_binary_location("opera")
464
+ if os.path.exists(bin_loc):
465
+ browser_changes += 1
466
+ browser_text = "opera"
467
+ sb_config._browser_shortcut = "opera"
468
+ sb_config._cdp_browser = "opera"
469
+ sb_config._cdp_bin_loc = bin_loc
470
+ browser_list.append("--opera")
471
+ if "--brave" in sys_argv and not browser_set == "brave":
472
+ if not bin_loc_in_options:
473
+ bin_loc = detect_b_ver.get_binary_location("brave")
474
+ if os.path.exists(bin_loc):
475
+ browser_changes += 1
476
+ browser_text = "brave"
477
+ sb_config._browser_shortcut = "brave"
478
+ sb_config._cdp_browser = "brave"
479
+ sb_config._cdp_bin_loc = bin_loc
480
+ browser_list.append("--brave")
481
+ if "--comet" in sys_argv and not browser_set == "comet":
482
+ if not bin_loc_in_options:
483
+ bin_loc = detect_b_ver.get_binary_location("comet")
484
+ if os.path.exists(bin_loc):
485
+ browser_changes += 1
486
+ browser_text = "comet"
487
+ sb_config._browser_shortcut = "comet"
488
+ sb_config._cdp_browser = "comet"
489
+ sb_config._cdp_bin_loc = bin_loc
490
+ browser_list.append("--comet")
491
+ if "--atlas" in sys_argv and not browser_set == "atlas":
492
+ if not bin_loc_in_options:
493
+ bin_loc = detect_b_ver.get_binary_location("atlas")
494
+ if os.path.exists(bin_loc):
495
+ browser_changes += 1
496
+ browser_text = "atlas"
497
+ sb_config._browser_shortcut = "atlas"
498
+ sb_config._cdp_browser = "atlas"
499
+ sb_config._cdp_bin_loc = bin_loc
500
+ browser_list.append("--atlas")
393
501
  if browser_changes > 1:
394
502
  message = "\n\n TOO MANY browser types were entered!"
395
503
  message += "\n There were %s found:\n > %s" % (
@@ -692,7 +800,10 @@ def SB(
692
800
  uc_cdp_events = True
693
801
  else:
694
802
  uc_cdp_events = False
695
- if undetectable and browser != "chrome":
803
+ if (
804
+ undetectable
805
+ and browser not in ["chrome", "opera", "brave", "comet", "atlas"]
806
+ ):
696
807
  message = (
697
808
  '\n Undetected-Chromedriver Mode ONLY supports Chrome!'
698
809
  '\n ("uc=True" / "undetectable=True" / "--uc")'
@@ -1019,6 +1130,8 @@ def SB(
1019
1130
 
1020
1131
  sb_config.with_testing_base = with_testing_base
1021
1132
  sb_config.browser = browser
1133
+ if sb_config._browser_shortcut:
1134
+ sb_config.browser = sb_config._browser_shortcut
1022
1135
  if not hasattr(sb_config, "is_behave"):
1023
1136
  sb_config.is_behave = False
1024
1137
  if not hasattr(sb_config, "is_pytest"):
@@ -1082,6 +1195,8 @@ def SB(
1082
1195
  sb_config.save_screenshot = save_screenshot
1083
1196
  sb_config.no_screenshot = no_screenshot
1084
1197
  sb_config.binary_location = binary_location
1198
+ if hasattr(sb_config, "_cdp_bin_loc") and sb_config._cdp_bin_loc:
1199
+ sb_config.binary_location = sb_config._cdp_bin_loc
1085
1200
  sb_config.driver_version = driver_version
1086
1201
  sb_config.page_load_strategy = page_load_strategy
1087
1202
  sb_config.timeout_multiplier = timeout_multiplier
@@ -1125,6 +1240,10 @@ def SB(
1125
1240
  sb_config.interval = interval
1126
1241
  sb_config.cap_file = cap_file
1127
1242
  sb_config.cap_string = cap_string
1243
+ if sb_config.browser in constants.ChromiumSubs.chromium_subs:
1244
+ if not sb_config.binary_location:
1245
+ sb_config.browser = "chrome" # Still uses chromedriver
1246
+ sb_config._browser_shortcut = sb_config.browser
1128
1247
 
1129
1248
  sb = BaseCase()
1130
1249
  sb.with_testing_base = sb_config.with_testing_base