seleniumbase 4.30.8__py3-none-any.whl → 4.31.1__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/__init__.py +1 -0
- seleniumbase/__init__.py +2 -3
- seleniumbase/__version__.py +1 -1
- seleniumbase/behave/behave_sb.py +59 -11
- seleniumbase/config/settings.py +4 -0
- seleniumbase/console_scripts/logo_helper.py +47 -0
- seleniumbase/console_scripts/run.py +7 -4
- seleniumbase/console_scripts/sb_behave_gui.py +5 -5
- seleniumbase/console_scripts/sb_caseplans.py +6 -6
- seleniumbase/console_scripts/sb_commander.py +5 -5
- seleniumbase/console_scripts/sb_install.py +10 -2
- seleniumbase/console_scripts/sb_recorder.py +4 -4
- seleniumbase/core/browser_launcher.py +179 -108
- seleniumbase/core/mysql.py +1 -4
- seleniumbase/core/recorder_helper.py +24 -5
- seleniumbase/core/sb_driver.py +13 -3
- seleniumbase/core/settings_parser.py +4 -0
- seleniumbase/fixtures/base_case.py +324 -493
- seleniumbase/fixtures/js_utils.py +19 -52
- seleniumbase/fixtures/page_actions.py +3 -6
- seleniumbase/fixtures/page_utils.py +18 -53
- seleniumbase/plugins/base_plugin.py +2 -3
- seleniumbase/plugins/driver_manager.py +182 -5
- seleniumbase/plugins/pytest_plugin.py +51 -23
- seleniumbase/plugins/sb_manager.py +185 -5
- seleniumbase/plugins/selenium_plugin.py +71 -8
- seleniumbase/undetected/__init__.py +13 -38
- seleniumbase/undetected/dprocess.py +4 -6
- seleniumbase/undetected/options.py +3 -6
- seleniumbase/undetected/patcher.py +2 -3
- {seleniumbase-4.30.8.dist-info → seleniumbase-4.31.1.dist-info}/METADATA +111 -125
- {seleniumbase-4.30.8.dist-info → seleniumbase-4.31.1.dist-info}/RECORD +36 -47
- {seleniumbase-4.30.8.dist-info → seleniumbase-4.31.1.dist-info}/WHEEL +1 -1
- sbase/ReadMe.txt +0 -2
- seleniumbase/ReadMe.md +0 -25
- seleniumbase/common/ReadMe.md +0 -71
- seleniumbase/console_scripts/ReadMe.md +0 -734
- seleniumbase/drivers/ReadMe.md +0 -27
- seleniumbase/extensions/ReadMe.md +0 -12
- seleniumbase/masterqa/ReadMe.md +0 -61
- seleniumbase/resources/ReadMe.md +0 -31
- seleniumbase/resources/favicon.ico +0 -0
- seleniumbase/utilities/selenium_grid/ReadMe.md +0 -84
- seleniumbase/utilities/selenium_ide/ReadMe.md +0 -111
- {seleniumbase-4.30.8.dist-info → seleniumbase-4.31.1.dist-info}/LICENSE +0 -0
- {seleniumbase-4.30.8.dist-info → seleniumbase-4.31.1.dist-info}/entry_points.txt +0 -0
- {seleniumbase-4.30.8.dist-info → seleniumbase-4.31.1.dist-info}/top_level.txt +0 -0
seleniumbase/core/mysql.py
CHANGED
@@ -35,10 +35,7 @@ class DatabaseManager:
|
|
35
35
|
import cryptography # noqa: F401
|
36
36
|
import pymysql
|
37
37
|
except Exception:
|
38
|
-
|
39
|
-
shared_utils.pip_install("PyMySQL[rsa]", version="1.0.2")
|
40
|
-
else:
|
41
|
-
shared_utils.pip_install("PyMySQL[rsa]", version="1.1.0")
|
38
|
+
shared_utils.pip_install("PyMySQL[rsa]", version="1.1.1")
|
42
39
|
import pymysql
|
43
40
|
db_server = settings.DB_HOST
|
44
41
|
db_port = settings.DB_PORT
|
@@ -422,9 +422,14 @@ def generate_sbase_code(srt_actions):
|
|
422
422
|
):
|
423
423
|
import unicodedata
|
424
424
|
|
425
|
-
|
426
|
-
|
427
|
-
|
425
|
+
text_list = False
|
426
|
+
try:
|
427
|
+
action[1][0] = unicodedata.normalize("NFKC", action[1][0])
|
428
|
+
action[1][0] = action[1][0].replace("\n", "\\n")
|
429
|
+
action[1][0] = action[1][0].replace("\u00B6", "")
|
430
|
+
except Exception:
|
431
|
+
text_list = True
|
432
|
+
|
428
433
|
method = "assert_text"
|
429
434
|
if action[0] == "as_et":
|
430
435
|
method = "assert_exact_text"
|
@@ -437,7 +442,17 @@ def generate_sbase_code(srt_actions):
|
|
437
442
|
elif action[0] == "da_et":
|
438
443
|
method = "deferred_assert_exact_text"
|
439
444
|
if action[1][1] != "html":
|
440
|
-
if
|
445
|
+
if text_list and '"' not in action[1][1]:
|
446
|
+
sb_actions.append(
|
447
|
+
'self.%s(%s, "%s")'
|
448
|
+
% (method, action[1][0], action[1][1])
|
449
|
+
)
|
450
|
+
elif text_list and "'" not in action[1][1]:
|
451
|
+
sb_actions.append(
|
452
|
+
"self.%s(%s, '%s')"
|
453
|
+
% (method, action[1][0], action[1][1])
|
454
|
+
)
|
455
|
+
elif '"' not in action[1][0] and '"' not in action[1][1]:
|
441
456
|
sb_actions.append(
|
442
457
|
'self.%s("%s", "%s")'
|
443
458
|
% (method, action[1][0], action[1][1])
|
@@ -458,7 +473,11 @@ def generate_sbase_code(srt_actions):
|
|
458
473
|
% (method, action[1][0], action[1][1])
|
459
474
|
)
|
460
475
|
else:
|
461
|
-
if
|
476
|
+
if text_list:
|
477
|
+
sb_actions.append(
|
478
|
+
'self.%s(%s)' % (method, action[1][0])
|
479
|
+
)
|
480
|
+
elif '"' not in action[1][0]:
|
462
481
|
sb_actions.append(
|
463
482
|
'self.%s("%s")' % (method, action[1][0])
|
464
483
|
)
|
seleniumbase/core/sb_driver.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
"""Add new methods to extend the driver"""
|
2
|
+
from contextlib import suppress
|
2
3
|
from selenium.webdriver.remote.webelement import WebElement
|
3
4
|
from seleniumbase.fixtures import js_utils
|
4
5
|
from seleniumbase.fixtures import page_actions
|
@@ -36,10 +37,8 @@ class DriverMethods():
|
|
36
37
|
selector, by = page_utils.swap_selector_and_by_if_reversed(
|
37
38
|
selector, by
|
38
39
|
)
|
39
|
-
|
40
|
+
with suppress(Exception):
|
40
41
|
return self.driver.default_find_element(by=by, value=selector)
|
41
|
-
except Exception:
|
42
|
-
pass
|
43
42
|
raise Exception('No such Element: {%s} (by="%s")!' % (selector, by))
|
44
43
|
|
45
44
|
def get_attribute(self, selector, attribute, by="css selector"):
|
@@ -162,6 +161,17 @@ class DriverMethods():
|
|
162
161
|
self.driver, *args, **kwargs
|
163
162
|
)
|
164
163
|
|
164
|
+
def is_valid_url(self, url):
|
165
|
+
"""Return True if the url is a valid url."""
|
166
|
+
return page_utils.is_valid_url(url)
|
167
|
+
|
168
|
+
def is_alert_present(self):
|
169
|
+
try:
|
170
|
+
self.driver.switch_to.alert
|
171
|
+
return True
|
172
|
+
except Exception:
|
173
|
+
return False
|
174
|
+
|
165
175
|
def is_online(self):
|
166
176
|
return self.driver.execute_script("return navigator.onLine;")
|
167
177
|
|
@@ -113,6 +113,10 @@ def set_settings(settings_file):
|
|
113
113
|
settings.RAISE_INVALID_PROXY_STRING_EXCEPTION = override_settings[
|
114
114
|
key
|
115
115
|
]
|
116
|
+
elif key == "WINDOW_START_X":
|
117
|
+
settings.WINDOW_START_X = override_settings[key]
|
118
|
+
elif key == "WINDOW_START_Y":
|
119
|
+
settings.WINDOW_START_Y = override_settings[key]
|
116
120
|
elif key == "CHROME_START_WIDTH":
|
117
121
|
settings.CHROME_START_WIDTH = override_settings[key]
|
118
122
|
elif key == "CHROME_START_HEIGHT":
|