seleniumbase 4.41.3__py3-none-any.whl → 4.45.10__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.
- sbase/steps.py +9 -0
- seleniumbase/__version__.py +1 -1
- seleniumbase/behave/behave_helper.py +2 -0
- seleniumbase/behave/behave_sb.py +21 -8
- seleniumbase/common/decorators.py +3 -1
- seleniumbase/console_scripts/run.py +1 -0
- seleniumbase/console_scripts/sb_caseplans.py +3 -4
- seleniumbase/console_scripts/sb_install.py +142 -11
- seleniumbase/console_scripts/sb_mkchart.py +1 -2
- seleniumbase/console_scripts/sb_mkdir.py +99 -29
- seleniumbase/console_scripts/sb_mkfile.py +1 -2
- seleniumbase/console_scripts/sb_mkpres.py +1 -2
- seleniumbase/console_scripts/sb_mkrec.py +26 -2
- seleniumbase/console_scripts/sb_objectify.py +4 -5
- seleniumbase/console_scripts/sb_print.py +1 -1
- seleniumbase/console_scripts/sb_recorder.py +40 -3
- seleniumbase/core/browser_launcher.py +474 -151
- seleniumbase/core/detect_b_ver.py +258 -16
- seleniumbase/core/log_helper.py +15 -21
- seleniumbase/core/mysql.py +1 -1
- seleniumbase/core/recorder_helper.py +3 -0
- seleniumbase/core/report_helper.py +9 -12
- seleniumbase/core/sb_cdp.py +734 -215
- seleniumbase/core/sb_driver.py +46 -5
- seleniumbase/core/session_helper.py +2 -4
- seleniumbase/core/tour_helper.py +1 -2
- seleniumbase/drivers/atlas_drivers/__init__.py +0 -0
- seleniumbase/drivers/brave_drivers/__init__.py +0 -0
- seleniumbase/drivers/chromium_drivers/__init__.py +0 -0
- seleniumbase/drivers/comet_drivers/__init__.py +0 -0
- seleniumbase/drivers/opera_drivers/__init__.py +0 -0
- seleniumbase/fixtures/base_case.py +448 -251
- seleniumbase/fixtures/constants.py +36 -9
- seleniumbase/fixtures/js_utils.py +77 -18
- seleniumbase/fixtures/page_actions.py +41 -13
- seleniumbase/fixtures/page_utils.py +19 -12
- seleniumbase/fixtures/shared_utils.py +64 -6
- seleniumbase/masterqa/master_qa.py +16 -2
- seleniumbase/plugins/base_plugin.py +8 -0
- seleniumbase/plugins/basic_test_info.py +2 -3
- seleniumbase/plugins/driver_manager.py +131 -5
- seleniumbase/plugins/page_source.py +2 -3
- seleniumbase/plugins/pytest_plugin.py +244 -79
- seleniumbase/plugins/sb_manager.py +143 -20
- seleniumbase/plugins/selenium_plugin.py +144 -12
- seleniumbase/translate/translator.py +2 -3
- seleniumbase/undetected/__init__.py +17 -13
- seleniumbase/undetected/cdp.py +1 -12
- seleniumbase/undetected/cdp_driver/browser.py +330 -129
- seleniumbase/undetected/cdp_driver/cdp_util.py +328 -61
- seleniumbase/undetected/cdp_driver/config.py +110 -14
- seleniumbase/undetected/cdp_driver/connection.py +18 -48
- seleniumbase/undetected/cdp_driver/element.py +105 -33
- seleniumbase/undetected/cdp_driver/tab.py +414 -39
- seleniumbase/utilities/selenium_grid/download_selenium_server.py +1 -1
- seleniumbase/utilities/selenium_grid/grid_hub.py +1 -2
- seleniumbase/utilities/selenium_grid/grid_node.py +2 -3
- seleniumbase/utilities/selenium_ide/convert_ide.py +2 -3
- {seleniumbase-4.41.3.dist-info → seleniumbase-4.45.10.dist-info}/METADATA +193 -166
- {seleniumbase-4.41.3.dist-info → seleniumbase-4.45.10.dist-info}/RECORD +64 -59
- {seleniumbase-4.41.3.dist-info → seleniumbase-4.45.10.dist-info}/licenses/LICENSE +1 -1
- {seleniumbase-4.41.3.dist-info → seleniumbase-4.45.10.dist-info}/WHEEL +0 -0
- {seleniumbase-4.41.3.dist-info → seleniumbase-4.45.10.dist-info}/entry_points.txt +0 -0
- {seleniumbase-4.41.3.dist-info → seleniumbase-4.45.10.dist-info}/top_level.txt +0 -0
seleniumbase/core/sb_driver.py
CHANGED
|
@@ -12,6 +12,10 @@ from seleniumbase.fixtures import shared_utils
|
|
|
12
12
|
class DriverMethods(WebDriver):
|
|
13
13
|
def __init__(self, driver):
|
|
14
14
|
self.driver = driver
|
|
15
|
+
if hasattr(driver, "session_id"):
|
|
16
|
+
self.session_id = driver.session_id
|
|
17
|
+
if hasattr(driver, "command_executor"):
|
|
18
|
+
self.command_executor = driver.command_executor
|
|
15
19
|
|
|
16
20
|
def __is_cdp_swap_needed(self):
|
|
17
21
|
"""If the driver is disconnected, use a CDP method when available."""
|
|
@@ -37,6 +41,36 @@ class DriverMethods(WebDriver):
|
|
|
37
41
|
value, by = page_utils.swap_selector_and_by_if_reversed(value, by)
|
|
38
42
|
return self.driver.default_find_elements(by=by, value=value)
|
|
39
43
|
|
|
44
|
+
def add_cookie(self, *args, **kwargs):
|
|
45
|
+
page_actions._reconnect_if_disconnected(self.driver)
|
|
46
|
+
self.driver.default_add_cookie(*args, **kwargs)
|
|
47
|
+
|
|
48
|
+
def get_cookie(self, *args, **kwargs):
|
|
49
|
+
page_actions._reconnect_if_disconnected(self.driver)
|
|
50
|
+
self.driver.default_get_cookie(*args, **kwargs)
|
|
51
|
+
|
|
52
|
+
def delete_cookie(self, *args, **kwargs):
|
|
53
|
+
page_actions._reconnect_if_disconnected(self.driver)
|
|
54
|
+
self.driver.default_delete_cookie(*args, **kwargs)
|
|
55
|
+
|
|
56
|
+
def back(self):
|
|
57
|
+
if self.__is_cdp_swap_needed():
|
|
58
|
+
self.driver.cdp.go_back()
|
|
59
|
+
return
|
|
60
|
+
self.driver.default_back()
|
|
61
|
+
|
|
62
|
+
def forward(self):
|
|
63
|
+
if self.__is_cdp_swap_needed():
|
|
64
|
+
self.driver.cdp.go_forward()
|
|
65
|
+
return
|
|
66
|
+
self.driver.default_forward()
|
|
67
|
+
|
|
68
|
+
def refresh(self, *args, **kwargs):
|
|
69
|
+
if self.__is_cdp_swap_needed():
|
|
70
|
+
self.driver.cdp.refresh(*args, **kwargs)
|
|
71
|
+
return
|
|
72
|
+
self.driver.default_refresh()
|
|
73
|
+
|
|
40
74
|
def locator(self, selector, by=None):
|
|
41
75
|
if not by:
|
|
42
76
|
by = "css selector"
|
|
@@ -137,6 +171,16 @@ class DriverMethods(WebDriver):
|
|
|
137
171
|
def wait_for_element_present(self, *args, **kwargs):
|
|
138
172
|
return page_actions.wait_for_selector(self.driver, *args, **kwargs)
|
|
139
173
|
|
|
174
|
+
def wait_for_element_absent(self, *args, **kwargs):
|
|
175
|
+
return page_actions.wait_for_element_absent(
|
|
176
|
+
self.driver, *args, **kwargs
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
def wait_for_element_not_visible(self, *args, **kwargs):
|
|
180
|
+
return page_actions.wait_for_element_not_visible(
|
|
181
|
+
self.driver, *args, **kwargs
|
|
182
|
+
)
|
|
183
|
+
|
|
140
184
|
def wait_for_selector(self, *args, **kwargs):
|
|
141
185
|
return page_actions.wait_for_selector(self.driver, *args, **kwargs)
|
|
142
186
|
|
|
@@ -278,11 +322,8 @@ class DriverMethods(WebDriver):
|
|
|
278
322
|
selector = kwargs["selector"]
|
|
279
323
|
else:
|
|
280
324
|
selector = args[0]
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
return
|
|
284
|
-
else:
|
|
285
|
-
self.driver.connect()
|
|
325
|
+
self.driver.cdp.highlight(selector)
|
|
326
|
+
return
|
|
286
327
|
if "scroll" in kwargs:
|
|
287
328
|
kwargs.pop("scroll")
|
|
288
329
|
w_args = kwargs.copy()
|
|
@@ -3,10 +3,8 @@ from seleniumbase import config as sb_config
|
|
|
3
3
|
|
|
4
4
|
def end_reused_class_session_as_needed():
|
|
5
5
|
if (
|
|
6
|
-
|
|
7
|
-
and sb_config
|
|
8
|
-
and hasattr(sb_config, "shared_driver")
|
|
9
|
-
and sb_config.shared_driver
|
|
6
|
+
getattr(sb_config, "reuse_class_session", None)
|
|
7
|
+
and getattr(sb_config, "shared_driver", None)
|
|
10
8
|
):
|
|
11
9
|
if (
|
|
12
10
|
hasattr(sb_config.shared_driver, "service")
|
seleniumbase/core/tour_helper.py
CHANGED
|
@@ -1134,10 +1134,9 @@ def export_tour(tour_steps, name=None, filename="my_tour.js", url=None):
|
|
|
1134
1134
|
os.makedirs(exported_tours_folder)
|
|
1135
1135
|
except Exception:
|
|
1136
1136
|
pass
|
|
1137
|
-
import codecs
|
|
1138
1137
|
|
|
1139
1138
|
file_path = exported_tours_folder + "/" + filename
|
|
1140
|
-
out_file =
|
|
1139
|
+
out_file = open(file_path, mode="w+", encoding="utf-8")
|
|
1141
1140
|
out_file.writelines(instructions)
|
|
1142
1141
|
out_file.close()
|
|
1143
1142
|
print("\n>>> [%s] was saved!\n" % file_path)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|