seleniumbase 4.34.17__tar.gz → 4.35.1__tar.gz

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.
Files changed (156) hide show
  1. {seleniumbase-4.34.17/seleniumbase.egg-info → seleniumbase-4.35.1}/PKG-INFO +3 -3
  2. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/README.md +1 -1
  3. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/requirements.txt +1 -1
  4. seleniumbase-4.35.1/seleniumbase/__version__.py +2 -0
  5. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/sb_mkdir.py +3 -0
  6. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/browser_launcher.py +20 -1
  7. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/sb_cdp.py +75 -55
  8. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/fixtures/base_case.py +11 -8
  9. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/fixtures/js_utils.py +2 -0
  10. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/plugins/driver_manager.py +2 -2
  11. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/plugins/pytest_plugin.py +3 -0
  12. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/plugins/sb_manager.py +1 -1
  13. {seleniumbase-4.34.17 → seleniumbase-4.35.1/seleniumbase.egg-info}/PKG-INFO +3 -3
  14. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase.egg-info/requires.txt +1 -1
  15. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/setup.py +1 -1
  16. seleniumbase-4.34.17/seleniumbase/__version__.py +0 -2
  17. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/.gitignore +0 -0
  18. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/LICENSE +0 -0
  19. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/MANIFEST.in +0 -0
  20. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/install.sh +0 -0
  21. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/pyproject.toml +0 -0
  22. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/pytest.ini +0 -0
  23. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/sbase/__init__.py +0 -0
  24. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/sbase/__main__.py +0 -0
  25. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/sbase/steps.py +0 -0
  26. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/__init__.py +0 -0
  27. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/__main__.py +0 -0
  28. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/behave/__init__.py +0 -0
  29. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/behave/behave_helper.py +0 -0
  30. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/behave/behave_sb.py +0 -0
  31. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/behave/steps.py +0 -0
  32. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/common/__init__.py +0 -0
  33. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/common/decorators.py +0 -0
  34. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/common/encryption.py +0 -0
  35. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/common/exceptions.py +0 -0
  36. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/common/obfuscate.py +0 -0
  37. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/common/unobfuscate.py +0 -0
  38. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/config/__init__.py +0 -0
  39. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/config/ad_block_list.py +0 -0
  40. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/config/proxy_list.py +0 -0
  41. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/config/settings.py +0 -0
  42. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/__init__.py +0 -0
  43. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/logo_helper.py +0 -0
  44. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/rich_helper.py +0 -0
  45. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/run.py +0 -0
  46. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/sb_behave_gui.py +0 -0
  47. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/sb_caseplans.py +0 -0
  48. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/sb_commander.py +0 -0
  49. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/sb_install.py +0 -0
  50. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/sb_mkchart.py +0 -0
  51. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/sb_mkfile.py +0 -0
  52. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/sb_mkpres.py +0 -0
  53. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/sb_mkrec.py +0 -0
  54. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/sb_objectify.py +0 -0
  55. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/sb_print.py +0 -0
  56. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/console_scripts/sb_recorder.py +0 -0
  57. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/__init__.py +0 -0
  58. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/application_manager.py +0 -0
  59. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/capabilities_parser.py +0 -0
  60. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/colored_traceback.py +0 -0
  61. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/create_db_tables.sql +0 -0
  62. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/detect_b_ver.py +0 -0
  63. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/download_helper.py +0 -0
  64. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/encoded_images.py +0 -0
  65. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/jqc_helper.py +0 -0
  66. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/log_helper.py +0 -0
  67. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/mysql.py +0 -0
  68. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/proxy_helper.py +0 -0
  69. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/recorder_helper.py +0 -0
  70. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/report_helper.py +0 -0
  71. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/s3_manager.py +0 -0
  72. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/sb_driver.py +0 -0
  73. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/session_helper.py +0 -0
  74. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/settings_parser.py +0 -0
  75. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/style_sheet.py +0 -0
  76. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/testcase_manager.py +0 -0
  77. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/tour_helper.py +0 -0
  78. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/core/visual_helper.py +0 -0
  79. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/drivers/__init__.py +0 -0
  80. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/extensions/__init__.py +0 -0
  81. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/extensions/ad_block.zip +0 -0
  82. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/extensions/disable_csp.zip +0 -0
  83. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/extensions/recorder.zip +0 -0
  84. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/extensions/sbase_ext.zip +0 -0
  85. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/fixtures/__init__.py +0 -0
  86. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/fixtures/constants.py +0 -0
  87. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/fixtures/css_to_xpath.py +0 -0
  88. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/fixtures/errors.py +0 -0
  89. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/fixtures/page_actions.py +0 -0
  90. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/fixtures/page_utils.py +0 -0
  91. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/fixtures/shared_utils.py +0 -0
  92. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/fixtures/unittest_helper.py +0 -0
  93. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/fixtures/words.py +0 -0
  94. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/fixtures/xpath_to_css.py +0 -0
  95. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/js_code/__init__.py +0 -0
  96. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/js_code/active_css_js.py +0 -0
  97. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/js_code/live_js.py +0 -0
  98. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/js_code/recorder_js.py +0 -0
  99. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/masterqa/__init__.py +0 -0
  100. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/masterqa/master_qa.py +0 -0
  101. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/plugins/__init__.py +0 -0
  102. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/plugins/base_plugin.py +0 -0
  103. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/plugins/basic_test_info.py +0 -0
  104. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/plugins/db_reporting_plugin.py +0 -0
  105. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/plugins/page_source.py +0 -0
  106. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/plugins/s3_logging_plugin.py +0 -0
  107. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/plugins/screen_shots.py +0 -0
  108. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/plugins/selenium_plugin.py +0 -0
  109. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/resources/__init__.py +0 -0
  110. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/translate/__init__.py +0 -0
  111. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/translate/chinese.py +0 -0
  112. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/translate/dutch.py +0 -0
  113. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/translate/french.py +0 -0
  114. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/translate/italian.py +0 -0
  115. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/translate/japanese.py +0 -0
  116. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/translate/korean.py +0 -0
  117. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/translate/master_dict.py +0 -0
  118. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/translate/portuguese.py +0 -0
  119. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/translate/russian.py +0 -0
  120. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/translate/spanish.py +0 -0
  121. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/translate/translator.py +0 -0
  122. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/__init__.py +0 -0
  123. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/cdp.py +0 -0
  124. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/cdp_driver/__init__.py +0 -0
  125. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/cdp_driver/_contradict.py +0 -0
  126. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/cdp_driver/browser.py +0 -0
  127. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/cdp_driver/cdp_util.py +0 -0
  128. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/cdp_driver/config.py +0 -0
  129. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/cdp_driver/connection.py +0 -0
  130. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/cdp_driver/element.py +0 -0
  131. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/cdp_driver/tab.py +0 -0
  132. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/dprocess.py +0 -0
  133. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/options.py +0 -0
  134. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/patcher.py +0 -0
  135. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/reactor.py +0 -0
  136. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/undetected/webelement.py +0 -0
  137. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/__init__.py +0 -0
  138. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_grid/__init__.py +0 -0
  139. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_grid/download_selenium_server.py +0 -0
  140. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_grid/font_color +0 -0
  141. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_grid/grid-hub +0 -0
  142. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_grid/grid-node +0 -0
  143. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_grid/grid_hub.py +0 -0
  144. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_grid/grid_node.py +0 -0
  145. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_grid/register-grid-node.bat +0 -0
  146. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_grid/register-grid-node.sh +0 -0
  147. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_grid/start-grid-hub.bat +0 -0
  148. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_grid/start-grid-hub.sh +0 -0
  149. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_ide/__init__.py +0 -0
  150. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase/utilities/selenium_ide/convert_ide.py +0 -0
  151. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase.egg-info/SOURCES.txt +0 -0
  152. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase.egg-info/dependency_links.txt +0 -0
  153. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase.egg-info/entry_points.txt +0 -0
  154. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/seleniumbase.egg-info/top_level.txt +0 -0
  155. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/setup.cfg +0 -0
  156. {seleniumbase-4.34.17 → seleniumbase-4.35.1}/virtualenv_install.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: seleniumbase
3
- Version: 4.34.17
3
+ Version: 4.35.1
4
4
  Summary: A complete web automation framework for end-to-end testing.
5
5
  Home-page: https://github.com/seleniumbase/SeleniumBase
6
6
  Author: Michael Mintz
@@ -104,7 +104,7 @@ Requires-Dist: trio-websocket==0.12.1
104
104
  Requires-Dist: wsproto==1.2.0
105
105
  Requires-Dist: websocket-client==1.8.0
106
106
  Requires-Dist: selenium==4.27.1; python_version < "3.9"
107
- Requires-Dist: selenium==4.28.1; python_version >= "3.9"
107
+ Requires-Dist: selenium==4.29.0; python_version >= "3.9"
108
108
  Requires-Dist: cssselect==1.2.0
109
109
  Requires-Dist: sortedcontainers==2.4.0
110
110
  Requires-Dist: execnet==2.1.1
@@ -265,7 +265,7 @@ Dynamic: summary
265
265
  ```python
266
266
  from seleniumbase import SB
267
267
 
268
- with SB(test=True) as sb:
268
+ with SB(test=True, uc=True) as sb:
269
269
  sb.open("https://google.com/ncr")
270
270
  sb.type('[title="Search"]', "SeleniumBase GitHub page\n")
271
271
  sb.click('[href*="github.com/seleniumbase/"]')
@@ -71,7 +71,7 @@
71
71
  ```python
72
72
  from seleniumbase import SB
73
73
 
74
- with SB(test=True) as sb:
74
+ with SB(test=True, uc=True) as sb:
75
75
  sb.open("https://google.com/ncr")
76
76
  sb.type('[title="Search"]', "SeleniumBase GitHub page\n")
77
77
  sb.click('[href*="github.com/seleniumbase/"]')
@@ -43,7 +43,7 @@ trio-websocket==0.12.1
43
43
  wsproto==1.2.0
44
44
  websocket-client==1.8.0
45
45
  selenium==4.27.1;python_version<"3.9"
46
- selenium==4.28.1;python_version>="3.9"
46
+ selenium==4.29.0;python_version>="3.9"
47
47
  cssselect==1.2.0
48
48
  sortedcontainers==2.4.0
49
49
  execnet==2.1.1
@@ -0,0 +1,2 @@
1
+ # seleniumbase package
2
+ __version__ = "4.35.1"
@@ -631,10 +631,13 @@ def main():
631
631
  data = []
632
632
  data.append("from seleniumbase import BaseCase")
633
633
  data.append("from .google_objects import HomePage, ResultsPage")
634
+ data.append('BaseCase.main(__name__, __file__, "--uc")')
634
635
  data.append("")
635
636
  data.append("")
636
637
  data.append("class GoogleTests(BaseCase):")
637
638
  data.append(" def test_google_dot_com(self):")
639
+ data.append(" if not self.undetectable:")
640
+ data.append(" self.get_new_driver(undetectable=True)")
638
641
  data.append(' self.open("https://google.com/ncr")')
639
642
  data.append(' self.assert_title_contains("Google")')
640
643
  data.append(" self.sleep(0.05)")
@@ -723,6 +723,8 @@ def uc_open_with_cdp_mode(driver, url=None):
723
723
  cdp.wait_for_text = CDPM.wait_for_text
724
724
  cdp.wait_for_text_not_visible = CDPM.wait_for_text_not_visible
725
725
  cdp.wait_for_element_visible = CDPM.wait_for_element_visible
726
+ cdp.wait_for_element_not_visible = CDPM.wait_for_element_not_visible
727
+ cdp.wait_for_element_absent = CDPM.wait_for_element_absent
726
728
  cdp.assert_element = CDPM.assert_element
727
729
  cdp.assert_element_visible = CDPM.assert_element_visible
728
730
  cdp.assert_element_present = CDPM.assert_element_present
@@ -1628,9 +1630,19 @@ def _uc_gui_handle_captcha_(driver, frame="iframe", ctype=None):
1628
1630
  ):
1629
1631
  driver.uc_open_with_disconnect(driver.current_url, 3.8)
1630
1632
  with suppress(Exception):
1633
+ if "--debug" in sys.argv:
1634
+ if sb_config._saved_cf_tab_count == 1:
1635
+ print(' <DEBUG> pyautogui.press("\\t")')
1636
+ else:
1637
+ print(
1638
+ ' <DEBUG> pyautogui.press("\\t") * %s'
1639
+ % sb_config._saved_cf_tab_count
1640
+ )
1631
1641
  for i in range(sb_config._saved_cf_tab_count):
1632
1642
  pyautogui.press("\t")
1633
1643
  time.sleep(0.027)
1644
+ if "--debug" in sys.argv:
1645
+ print(' <DEBUG> pyautogui.press(" ")')
1634
1646
  pyautogui.press(" ")
1635
1647
  else:
1636
1648
  driver.disconnect()
@@ -2310,7 +2322,14 @@ def _set_chrome_options(
2310
2322
  and not enable_3d_apis
2311
2323
  ):
2312
2324
  chrome_options.add_argument("--disable-gpu")
2313
- if not IS_LINUX and is_using_uc(undetectable, browser_name):
2325
+ if (
2326
+ (not IS_LINUX and is_using_uc(undetectable, browser_name))
2327
+ or (
2328
+ IS_MAC
2329
+ and binary_location
2330
+ and "chrome-headless-shell" in binary_location
2331
+ )
2332
+ ):
2314
2333
  chrome_options.add_argument("--disable-dev-shm-usage")
2315
2334
  chrome_options.add_argument("--disable-application-cache")
2316
2335
  if IS_LINUX:
@@ -288,7 +288,7 @@ class CDPMethods():
288
288
  return updated_elements
289
289
 
290
290
  def select(self, selector, timeout=None):
291
- """Similar to find_element(), but without text-based search."""
291
+ """Similar to find_element()."""
292
292
  if not timeout:
293
293
  timeout = settings.SMALL_TIMEOUT
294
294
  self.__add_light_pause()
@@ -297,12 +297,25 @@ class CDPMethods():
297
297
  tag_name = selector.split(":contains(")[0].split(" ")[-1]
298
298
  text = selector.split(":contains(")[1].split(")")[0][1:-1]
299
299
  with suppress(Exception):
300
+ new_timeout = timeout
301
+ if new_timeout < 1:
302
+ new_timeout = 1
300
303
  self.loop.run_until_complete(
301
- self.page.select(tag_name, timeout=5)
304
+ self.page.select(tag_name, timeout=new_timeout)
302
305
  )
303
- self.loop.run_until_complete(self.page.find(text, timeout=5))
304
- element = self.find_elements_by_text(text, tag_name=tag_name)[0]
305
- return self.__add_sync_methods(element)
306
+ self.loop.run_until_complete(
307
+ self.page.find(text, timeout=new_timeout)
308
+ )
309
+ elements = self.find_elements_by_text(text, tag_name=tag_name)
310
+ if not elements:
311
+ plural = "s"
312
+ if timeout == 1:
313
+ plural = ""
314
+ msg = "\n Element {%s} was not found after %s second%s!"
315
+ message = msg % (selector, timeout, plural)
316
+ raise Exception(message)
317
+ element = self.__add_sync_methods(elements[0])
318
+ return element
306
319
  failure = False
307
320
  try:
308
321
  element = self.loop.run_until_complete(
@@ -313,11 +326,8 @@ class CDPMethods():
313
326
  plural = "s"
314
327
  if timeout == 1:
315
328
  plural = ""
316
- message = "\n Element {%s} was not found after %s second%s!" % (
317
- selector,
318
- timeout,
319
- plural,
320
- )
329
+ msg = "\n Element {%s} was not found after %s second%s!"
330
+ message = msg % (selector, timeout, plural)
321
331
  if failure:
322
332
  raise Exception(message)
323
333
  element = self.__add_sync_methods(element)
@@ -497,7 +507,7 @@ class CDPMethods():
497
507
  element.send_keys("\r\n")
498
508
  time.sleep(0.044)
499
509
  self.__slow_mode_pause_if_set()
500
- return self.loop.run_until_complete(self.page.wait())
510
+ return self.loop.run_until_complete(self.page.sleep(0.025))
501
511
 
502
512
  def __query_selector(self, element, selector):
503
513
  selector = self.__convert_to_css_if_xpath(selector)
@@ -864,7 +874,7 @@ class CDPMethods():
864
874
  text = text[:-1] + "\r\n"
865
875
  element.send_keys(text)
866
876
  self.__slow_mode_pause_if_set()
867
- self.loop.run_until_complete(self.page.wait())
877
+ self.loop.run_until_complete(self.page.sleep(0.025))
868
878
 
869
879
  def press_keys(self, selector, text, timeout=None):
870
880
  """Similar to send_keys(), but presses keys at human speed."""
@@ -884,7 +894,7 @@ class CDPMethods():
884
894
  element.send_keys("\r\n")
885
895
  time.sleep(0.044)
886
896
  self.__slow_mode_pause_if_set()
887
- self.loop.run_until_complete(self.page.wait())
897
+ self.loop.run_until_complete(self.page.sleep(0.025))
888
898
 
889
899
  def type(self, selector, text, timeout=None):
890
900
  """Similar to send_keys(), but clears the text field first."""
@@ -899,7 +909,7 @@ class CDPMethods():
899
909
  text = text[:-1] + "\r\n"
900
910
  element.send_keys(text)
901
911
  self.__slow_mode_pause_if_set()
902
- self.loop.run_until_complete(self.page.wait())
912
+ self.loop.run_until_complete(self.page.sleep(0.025))
903
913
 
904
914
  def set_value(self, selector, text, timeout=None):
905
915
  """Similar to send_keys(), but clears the text field first."""
@@ -937,7 +947,7 @@ class CDPMethods():
937
947
  self.__add_light_pause()
938
948
  self.send_keys(selector, "\n")
939
949
  self.__slow_mode_pause_if_set()
940
- self.loop.run_until_complete(self.page.wait())
950
+ self.loop.run_until_complete(self.page.sleep(0.025))
941
951
 
942
952
  def evaluate(self, expression):
943
953
  """Run a JavaScript expression and return the result."""
@@ -1377,7 +1387,7 @@ class CDPMethods():
1377
1387
  pyautogui.press(key)
1378
1388
  time.sleep(0.044)
1379
1389
  self.__slow_mode_pause_if_set()
1380
- self.loop.run_until_complete(self.page.wait())
1390
+ self.loop.run_until_complete(self.page.sleep(0.025))
1381
1391
 
1382
1392
  def gui_press_keys(self, keys):
1383
1393
  self.__install_pyautogui_if_missing()
@@ -1392,7 +1402,7 @@ class CDPMethods():
1392
1402
  pyautogui.press(key)
1393
1403
  time.sleep(0.044)
1394
1404
  self.__slow_mode_pause_if_set()
1395
- self.loop.run_until_complete(self.page.wait())
1405
+ self.loop.run_until_complete(self.page.sleep(0.025))
1396
1406
 
1397
1407
  def gui_write(self, text):
1398
1408
  self.__install_pyautogui_if_missing()
@@ -1405,7 +1415,7 @@ class CDPMethods():
1405
1415
  self.__make_sure_pyautogui_lock_is_writable()
1406
1416
  pyautogui.write(text)
1407
1417
  self.__slow_mode_pause_if_set()
1408
- self.loop.run_until_complete(self.page.wait())
1418
+ self.loop.run_until_complete(self.page.sleep(0.025))
1409
1419
 
1410
1420
  def __gui_click_x_y(self, x, y, timeframe=0.25, uc_lock=False):
1411
1421
  self.__install_pyautogui_if_missing()
@@ -1820,37 +1830,8 @@ class CDPMethods():
1820
1830
  time.sleep(0.1)
1821
1831
  raise Exception("Element {%s} was not visible!" % selector)
1822
1832
 
1823
- def assert_element(self, selector, timeout=None):
1824
- """Same as assert_element_visible()"""
1825
- self.assert_element_visible(selector, timeout=timeout)
1826
- return True
1827
-
1828
- def assert_element_visible(self, selector, timeout=None):
1829
- """Same as assert_element()"""
1830
- if not timeout:
1831
- timeout = settings.SMALL_TIMEOUT
1832
- try:
1833
- self.select(selector, timeout=timeout)
1834
- except Exception:
1835
- raise Exception("Element {%s} was not found!" % selector)
1836
- for i in range(30):
1837
- if self.is_element_visible(selector):
1838
- return True
1839
- time.sleep(0.1)
1840
- raise Exception("Element {%s} was not visible!" % selector)
1841
-
1842
- def assert_element_present(self, selector, timeout=None):
1843
- """Assert element is present in the DOM. (Visibility NOT required)"""
1844
- if not timeout:
1845
- timeout = settings.SMALL_TIMEOUT
1846
- try:
1847
- self.select(selector, timeout=timeout)
1848
- except Exception:
1849
- raise Exception("Element {%s} was not found!" % selector)
1850
- return True
1851
-
1852
- def assert_element_absent(self, selector, timeout=None):
1853
- """Assert element is not present in the DOM."""
1833
+ def wait_for_element_not_visible(self, selector, timeout=None):
1834
+ """Wait for element to not be visible on page. (May still be in DOM)"""
1854
1835
  if not timeout:
1855
1836
  timeout = settings.SMALL_TIMEOUT
1856
1837
  start_ms = time.time() * 1000.0
@@ -1858,6 +1839,8 @@ class CDPMethods():
1858
1839
  for i in range(int(timeout * 10)):
1859
1840
  if not self.is_element_present(selector):
1860
1841
  return True
1842
+ elif not self.is_element_visible(selector):
1843
+ return True
1861
1844
  now_ms = time.time() * 1000.0
1862
1845
  if now_ms >= stop_ms:
1863
1846
  break
@@ -1866,12 +1849,12 @@ class CDPMethods():
1866
1849
  if timeout == 1:
1867
1850
  plural = ""
1868
1851
  raise Exception(
1869
- "Element {%s} was still present after %s second%s!"
1852
+ "Element {%s} was still visible after %s second%s!"
1870
1853
  % (selector, timeout, plural)
1871
1854
  )
1872
1855
 
1873
- def assert_element_not_visible(self, selector, timeout=None):
1874
- """Assert element is not visible on page. (May still be in DOM)"""
1856
+ def wait_for_element_absent(self, selector, timeout=None):
1857
+ """Wait for element to not be present in the DOM."""
1875
1858
  if not timeout:
1876
1859
  timeout = settings.SMALL_TIMEOUT
1877
1860
  start_ms = time.time() * 1000.0
@@ -1879,8 +1862,6 @@ class CDPMethods():
1879
1862
  for i in range(int(timeout * 10)):
1880
1863
  if not self.is_element_present(selector):
1881
1864
  return True
1882
- elif not self.is_element_visible(selector):
1883
- return True
1884
1865
  now_ms = time.time() * 1000.0
1885
1866
  if now_ms >= stop_ms:
1886
1867
  break
@@ -1889,10 +1870,49 @@ class CDPMethods():
1889
1870
  if timeout == 1:
1890
1871
  plural = ""
1891
1872
  raise Exception(
1892
- "Element {%s} was still visible after %s second%s!"
1873
+ "Element {%s} was still present after %s second%s!"
1893
1874
  % (selector, timeout, plural)
1894
1875
  )
1895
1876
 
1877
+ def assert_element(self, selector, timeout=None):
1878
+ """Same as assert_element_visible()"""
1879
+ self.assert_element_visible(selector, timeout=timeout)
1880
+ return True
1881
+
1882
+ def assert_element_visible(self, selector, timeout=None):
1883
+ """Same as assert_element()"""
1884
+ if not timeout:
1885
+ timeout = settings.SMALL_TIMEOUT
1886
+ try:
1887
+ self.select(selector, timeout=timeout)
1888
+ except Exception:
1889
+ raise Exception("Element {%s} was not found!" % selector)
1890
+ for i in range(30):
1891
+ if self.is_element_visible(selector):
1892
+ return True
1893
+ time.sleep(0.1)
1894
+ raise Exception("Element {%s} was not visible!" % selector)
1895
+
1896
+ def assert_element_present(self, selector, timeout=None):
1897
+ """Assert element is present in the DOM. (Visibility NOT required)"""
1898
+ if not timeout:
1899
+ timeout = settings.SMALL_TIMEOUT
1900
+ try:
1901
+ self.select(selector, timeout=timeout)
1902
+ except Exception:
1903
+ raise Exception("Element {%s} was not found!" % selector)
1904
+ return True
1905
+
1906
+ def assert_element_absent(self, selector, timeout=None):
1907
+ """Assert element is not present in the DOM."""
1908
+ self.wait_for_element_absent(selector, timeout=timeout)
1909
+ return True
1910
+
1911
+ def assert_element_not_visible(self, selector, timeout=None):
1912
+ """Assert element is not visible on page. (May still be in DOM)"""
1913
+ self.wait_for_element_not_visible(selector, timeout=timeout)
1914
+ return True
1915
+
1896
1916
  def assert_element_attribute(self, selector, attribute, value=None):
1897
1917
  attributes = self.get_element_attributes(selector)
1898
1918
  if attribute not in attributes:
@@ -9124,7 +9124,7 @@ class BaseCase(unittest.TestCase):
9124
9124
  original_selector = selector
9125
9125
  selector, by = self.__recalculate_selector(selector, by)
9126
9126
  if self.__is_cdp_swap_needed():
9127
- self.cdp.assert_element_absent(selector)
9127
+ self.cdp.wait_for_element_absent(selector, timeout=timeout)
9128
9128
  return True
9129
9129
  return page_actions.wait_for_element_absent(
9130
9130
  self.driver,
@@ -9585,7 +9585,7 @@ class BaseCase(unittest.TestCase):
9585
9585
  self.assert_elements_present(selector, by=by, timeout=timeout)
9586
9586
  return True
9587
9587
  if self.__is_cdp_swap_needed():
9588
- self.cdp.assert_element_present(selector)
9588
+ self.cdp.assert_element_present(selector, timeout=timeout)
9589
9589
  return True
9590
9590
  if self.__is_shadow_selector(selector):
9591
9591
  self.__assert_shadow_element_present(selector)
@@ -9662,7 +9662,7 @@ class BaseCase(unittest.TestCase):
9662
9662
  if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
9663
9663
  timeout = self.__get_new_timeout(timeout)
9664
9664
  if self.__is_cdp_swap_needed():
9665
- self.cdp.assert_element(selector)
9665
+ self.cdp.assert_element(selector, timeout=timeout)
9666
9666
  return True
9667
9667
  if isinstance(selector, list):
9668
9668
  self.assert_elements(selector, by=by, timeout=timeout)
@@ -9955,7 +9955,7 @@ class BaseCase(unittest.TestCase):
9955
9955
  messenger_post, selector, by
9956
9956
  )
9957
9957
  elif self.__is_cdp_swap_needed():
9958
- self.cdp.assert_text(text, selector)
9958
+ self.cdp.assert_text(text, selector, timeout=timeout)
9959
9959
  return True
9960
9960
  elif not self.is_connected():
9961
9961
  self.connect()
@@ -10005,7 +10005,7 @@ class BaseCase(unittest.TestCase):
10005
10005
  original_selector = selector
10006
10006
  selector, by = self.__recalculate_selector(selector, by)
10007
10007
  if self.__is_cdp_swap_needed():
10008
- self.cdp.assert_exact_text(text, selector)
10008
+ self.cdp.assert_exact_text(text, selector, timeout=timeout)
10009
10009
  return True
10010
10010
  if self.__is_shadow_selector(selector):
10011
10011
  self.__assert_exact_shadow_text_visible(text, selector, timeout)
@@ -10245,6 +10245,9 @@ class BaseCase(unittest.TestCase):
10245
10245
  timeout = self.__get_new_timeout(timeout)
10246
10246
  original_selector = selector
10247
10247
  selector, by = self.__recalculate_selector(selector, by)
10248
+ if self.__is_cdp_swap_needed():
10249
+ self.cdp.wait_for_element_absent(selector, timeout=timeout)
10250
+ return True
10248
10251
  return page_actions.wait_for_element_absent(
10249
10252
  self.driver,
10250
10253
  selector,
@@ -10267,7 +10270,7 @@ class BaseCase(unittest.TestCase):
10267
10270
  if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
10268
10271
  timeout = self.__get_new_timeout(timeout)
10269
10272
  if self.__is_cdp_swap_needed():
10270
- self.cdp.assert_element_absent(selector)
10273
+ self.cdp.assert_element_absent(selector, timeout=timeout)
10271
10274
  return True
10272
10275
  self.wait_for_element_absent(selector, by=by, timeout=timeout)
10273
10276
  return True
@@ -10288,7 +10291,7 @@ class BaseCase(unittest.TestCase):
10288
10291
  original_selector = selector
10289
10292
  selector, by = self.__recalculate_selector(selector, by)
10290
10293
  if self.__is_cdp_swap_needed():
10291
- self.cdp.assert_element_not_visible(selector)
10294
+ self.cdp.wait_for_element_not_visible(selector, timeout=timeout)
10292
10295
  return True
10293
10296
  return page_actions.wait_for_element_not_visible(
10294
10297
  self.driver,
@@ -10310,7 +10313,7 @@ class BaseCase(unittest.TestCase):
10310
10313
  if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
10311
10314
  timeout = self.__get_new_timeout(timeout)
10312
10315
  if self.__is_cdp_swap_needed():
10313
- self.cdp.assert_element_not_visible(selector)
10316
+ self.cdp.assert_element_not_visible(selector, timeout=timeout)
10314
10317
  return True
10315
10318
  self.wait_for_element_not_visible(selector, by=by, timeout=timeout)
10316
10319
  if self.recorder_mode and self.__current_url_is_recordable():
@@ -950,6 +950,8 @@ def post_message(driver, message, msg_dur=None, style="info"):
950
950
  set_messenger_theme(driver)
951
951
  try:
952
952
  execute_script(driver, messenger_script)
953
+ except TypeError:
954
+ pass
953
955
  except Exception:
954
956
  time.sleep(0.17)
955
957
  activate_messenger(driver)
@@ -10,7 +10,7 @@ Example -->
10
10
  ```python
11
11
  from seleniumbase import DriverContext
12
12
 
13
- with DriverContext() as driver:
13
+ with DriverContext(uc=True) as driver:
14
14
  driver.get("https://google.com/ncr")
15
15
  ```
16
16
 
@@ -30,7 +30,7 @@ Example -->
30
30
  ```python
31
31
  from seleniumbase import Driver
32
32
 
33
- driver = Driver()
33
+ driver = Driver(uc=True)
34
34
  driver.get("https://google.com/ncr")
35
35
  ```
36
36
 
@@ -2496,6 +2496,9 @@ def pytest_unconfigure(config):
2496
2496
  """This runs after all tests have completed with pytest."""
2497
2497
  if "--co" in sys_argv or "--collect-only" in sys_argv:
2498
2498
  return
2499
+ reporter = config.pluginmanager.get_plugin("terminalreporter")
2500
+ if not hasattr(reporter, "_sessionstarttime"):
2501
+ return
2499
2502
  if hasattr(sb_config, "_multithreaded") and sb_config._multithreaded:
2500
2503
  import fasteners
2501
2504
 
@@ -10,7 +10,7 @@ Example -->
10
10
  ```python
11
11
  from seleniumbase import SB
12
12
 
13
- with SB() as sb: # Many args! Eg. SB(browser="edge")
13
+ with SB(uc=True) as sb: # Many args! Eg. SB(browser="edge")
14
14
  sb.open("https://google.com/ncr")
15
15
  sb.type('[name="q"]', "SeleniumBase on GitHub\n")
16
16
  sb.click('a[href*="github.com/seleniumbase"]')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: seleniumbase
3
- Version: 4.34.17
3
+ Version: 4.35.1
4
4
  Summary: A complete web automation framework for end-to-end testing.
5
5
  Home-page: https://github.com/seleniumbase/SeleniumBase
6
6
  Author: Michael Mintz
@@ -104,7 +104,7 @@ Requires-Dist: trio-websocket==0.12.1
104
104
  Requires-Dist: wsproto==1.2.0
105
105
  Requires-Dist: websocket-client==1.8.0
106
106
  Requires-Dist: selenium==4.27.1; python_version < "3.9"
107
- Requires-Dist: selenium==4.28.1; python_version >= "3.9"
107
+ Requires-Dist: selenium==4.29.0; python_version >= "3.9"
108
108
  Requires-Dist: cssselect==1.2.0
109
109
  Requires-Dist: sortedcontainers==2.4.0
110
110
  Requires-Dist: execnet==2.1.1
@@ -265,7 +265,7 @@ Dynamic: summary
265
265
  ```python
266
266
  from seleniumbase import SB
267
267
 
268
- with SB(test=True) as sb:
268
+ with SB(test=True, uc=True) as sb:
269
269
  sb.open("https://google.com/ncr")
270
270
  sb.type('[title="Search"]', "SeleniumBase GitHub page\n")
271
271
  sb.click('[href*="github.com/seleniumbase/"]')
@@ -75,7 +75,7 @@ websockets>=15.0
75
75
  filelock>=3.17.0
76
76
  MarkupSafe>=3.0.2
77
77
  trio==0.29.0
78
- selenium==4.28.1
78
+ selenium==4.29.0
79
79
  pytest-rerunfailures==15.0
80
80
 
81
81
  [allure]
@@ -192,7 +192,7 @@ setup(
192
192
  'wsproto==1.2.0',
193
193
  'websocket-client==1.8.0',
194
194
  'selenium==4.27.1;python_version<"3.9"',
195
- 'selenium==4.28.1;python_version>="3.9"',
195
+ 'selenium==4.29.0;python_version>="3.9"',
196
196
  'cssselect==1.2.0',
197
197
  "sortedcontainers==2.4.0",
198
198
  'execnet==2.1.1',
@@ -1,2 +0,0 @@
1
- # seleniumbase package
2
- __version__ = "4.34.17"
File without changes
File without changes
File without changes
File without changes
File without changes