seleniumbase 4.30.8__py3-none-any.whl → 4.31.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.
- sbase/__init__.py +1 -0
- seleniumbase/__init__.py +2 -3
- seleniumbase/__version__.py +1 -1
- seleniumbase/behave/behave_sb.py +47 -9
- seleniumbase/config/settings.py +4 -0
- 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 +138 -103
- seleniumbase/core/mysql.py +1 -4
- seleniumbase/core/recorder_helper.py +24 -5
- seleniumbase/core/sb_driver.py +2 -3
- seleniumbase/core/settings_parser.py +4 -0
- seleniumbase/fixtures/base_case.py +307 -492
- seleniumbase/fixtures/js_utils.py +19 -52
- seleniumbase/fixtures/page_actions.py +3 -6
- seleniumbase/fixtures/page_utils.py +20 -58
- seleniumbase/plugins/base_plugin.py +2 -3
- seleniumbase/plugins/driver_manager.py +169 -3
- seleniumbase/plugins/pytest_plugin.py +34 -21
- seleniumbase/plugins/sb_manager.py +170 -3
- seleniumbase/plugins/selenium_plugin.py +52 -6
- 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.0.dist-info}/METADATA +108 -123
- {seleniumbase-4.30.8.dist-info → seleniumbase-4.31.0.dist-info}/RECORD +34 -45
- {seleniumbase-4.30.8.dist-info → seleniumbase-4.31.0.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.0.dist-info}/LICENSE +0 -0
- {seleniumbase-4.30.8.dist-info → seleniumbase-4.31.0.dist-info}/entry_points.txt +0 -0
- {seleniumbase-4.30.8.dist-info → seleniumbase-4.31.0.dist-info}/top_level.txt +0 -0
sbase/__init__.py
CHANGED
seleniumbase/__init__.py
CHANGED
@@ -10,7 +10,7 @@ from selenium import webdriver
|
|
10
10
|
from seleniumbase.__version__ import __version__
|
11
11
|
from seleniumbase.common import decorators # noqa
|
12
12
|
from seleniumbase.common import encryption # noqa
|
13
|
-
from seleniumbase.core import colored_traceback
|
13
|
+
from seleniumbase.core import colored_traceback # noqa
|
14
14
|
from seleniumbase.core.browser_launcher import get_driver # noqa
|
15
15
|
from seleniumbase.fixtures import js_utils # noqa
|
16
16
|
from seleniumbase.fixtures import page_actions # noqa
|
@@ -36,8 +36,7 @@ if sys.version_info[0] < 3 and "pdbp" in locals():
|
|
36
36
|
pdb.DefaultConfig.sticky_by_default = True
|
37
37
|
colored_traceback.add_hook()
|
38
38
|
os.environ["SE_AVOID_STATS"] = "true" # Disable Selenium Manager stats
|
39
|
-
|
40
|
-
webdriver.TouchActions = None # Lifeline for past selenium-wire versions
|
39
|
+
webdriver.TouchActions = None # Lifeline for past selenium-wire versions
|
41
40
|
if sys.version_info >= (3, 10):
|
42
41
|
collections.Callable = collections.abc.Callable # Lifeline for nosetests
|
43
42
|
del collections # Undo "import collections" / Simplify "dir(seleniumbase)"
|
seleniumbase/__version__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# seleniumbase package
|
2
|
-
__version__ = "4.
|
2
|
+
__version__ = "4.31.0"
|
seleniumbase/behave/behave_sb.py
CHANGED
@@ -48,6 +48,7 @@ behave -D agent="User Agent String" -D demo
|
|
48
48
|
-D headless2 (Use the new headless mode, which supports extensions.)
|
49
49
|
-D headed (Run tests in headed/GUI mode on Linux OS, where not default.)
|
50
50
|
-D xvfb (Run tests using the Xvfb virtual display server on Linux OS.)
|
51
|
+
-D xvfb-metrics=STRING (Set Xvfb display size on Linux: "Width,Height".)
|
51
52
|
-D locale=LOCALE_CODE (Set the Language Locale Code for the web browser.)
|
52
53
|
-D pdb (Activate Post Mortem Debug Mode if a test fails.)
|
53
54
|
-D interval=SECONDS (The autoplay interval for presentations & tour steps)
|
@@ -90,6 +91,7 @@ behave -D agent="User Agent String" -D demo
|
|
90
91
|
-D rcs | -D reuse-class-session (Reuse session for tests in class/feature)
|
91
92
|
-D crumbs (Delete all cookies between tests reusing a session.)
|
92
93
|
-D disable-beforeunload (Disable the "beforeunload" event on Chrome.)
|
94
|
+
-D window-position=X,Y (Set the browser's starting window position.)
|
93
95
|
-D window-size=WIDTH,HEIGHT (Set the browser's starting window size.)
|
94
96
|
-D maximize (Start tests with the browser window maximized.)
|
95
97
|
-D screenshot (Save a screenshot at the end of each test.)
|
@@ -104,6 +106,7 @@ import colorama
|
|
104
106
|
import os
|
105
107
|
import re
|
106
108
|
import sys
|
109
|
+
from contextlib import suppress
|
107
110
|
from seleniumbase import config as sb_config
|
108
111
|
from seleniumbase.config import settings
|
109
112
|
from seleniumbase.core import download_helper
|
@@ -145,6 +148,7 @@ def get_configured_sb(context):
|
|
145
148
|
sb.headless_active = False
|
146
149
|
sb.headed = False
|
147
150
|
sb.xvfb = False
|
151
|
+
sb.xvfb_metrics = None
|
148
152
|
sb.start_page = None
|
149
153
|
sb.locale_code = None
|
150
154
|
sb.pdb_option = False
|
@@ -193,6 +197,7 @@ def get_configured_sb(context):
|
|
193
197
|
sb._disable_beforeunload = False
|
194
198
|
sb.visual_baseline = False
|
195
199
|
sb.use_wire = False
|
200
|
+
sb.window_position = None
|
196
201
|
sb.window_size = None
|
197
202
|
sb.maximize_option = False
|
198
203
|
sb.is_context_manager = False
|
@@ -302,6 +307,13 @@ def get_configured_sb(context):
|
|
302
307
|
if low_key == "xvfb":
|
303
308
|
sb.xvfb = True
|
304
309
|
continue
|
310
|
+
# Handle: -D xvfb-metrics=STR / xvfb_metrics=STR
|
311
|
+
if low_key in ["xvfb-metrics", "xvfb_metrics"]:
|
312
|
+
xvfb_metrics = userdata[key]
|
313
|
+
if xvfb_metrics == "true":
|
314
|
+
xvfb_metrics = sb.xvfb_metrics # revert to default
|
315
|
+
sb.xvfb_metrics = xvfb_metrics
|
316
|
+
continue
|
305
317
|
# Handle: -D start-page=URL / start_page=URL / url=URL
|
306
318
|
if low_key in ["start-page", "start_page", "url"]:
|
307
319
|
start_page = userdata[key]
|
@@ -601,6 +613,13 @@ def get_configured_sb(context):
|
|
601
613
|
if low_key == "wire":
|
602
614
|
sb.use_wire = True
|
603
615
|
continue
|
616
|
+
# Handle: -D window-position=X,Y / window_position=X,Y
|
617
|
+
if low_key in ["window-position", "window_position"]:
|
618
|
+
window_position = userdata[key]
|
619
|
+
if window_position == "true":
|
620
|
+
window_position = sb.window_position # revert to default
|
621
|
+
sb.window_position = window_position
|
622
|
+
continue
|
604
623
|
# Handle: -D window-size=Width,Height / window_size=Width,Height
|
605
624
|
if low_key in ["window-size", "window_size"]:
|
606
625
|
window_size = userdata[key]
|
@@ -904,6 +923,29 @@ def get_configured_sb(context):
|
|
904
923
|
else:
|
905
924
|
sb.enable_ws = False
|
906
925
|
sb.disable_ws = True
|
926
|
+
if sb.window_position:
|
927
|
+
window_position = sb.window_position
|
928
|
+
if window_position.count(",") != 1:
|
929
|
+
message = (
|
930
|
+
'\n\n window_position expects an "x,y" string!'
|
931
|
+
'\n (Your input was: "%s")\n' % window_position
|
932
|
+
)
|
933
|
+
raise Exception(message)
|
934
|
+
window_position = window_position.replace(" ", "")
|
935
|
+
win_x = None
|
936
|
+
win_y = None
|
937
|
+
try:
|
938
|
+
win_x = int(window_position.split(",")[0])
|
939
|
+
win_y = int(window_position.split(",")[1])
|
940
|
+
except Exception:
|
941
|
+
message = (
|
942
|
+
'\n\n Expecting integer values for "x,y"!'
|
943
|
+
'\n (window_position input was: "%s")\n'
|
944
|
+
% window_position
|
945
|
+
)
|
946
|
+
raise Exception(message)
|
947
|
+
settings.WINDOW_START_X = win_x
|
948
|
+
settings.WINDOW_START_Y = win_y
|
907
949
|
if sb.window_size:
|
908
950
|
window_size = sb.window_size
|
909
951
|
if window_size.count(",") != 1:
|
@@ -938,9 +980,11 @@ def get_configured_sb(context):
|
|
938
980
|
sb_config.is_pytest = False
|
939
981
|
sb_config.is_nosetest = False
|
940
982
|
sb_config.is_context_manager = False
|
983
|
+
sb_config.window_position = sb.window_position
|
941
984
|
sb_config.window_size = sb.window_size
|
942
985
|
sb_config.maximize_option = sb.maximize_option
|
943
986
|
sb_config.xvfb = sb.xvfb
|
987
|
+
sb_config.xvfb_metrics = sb.xvfb_metrics
|
944
988
|
sb_config.reuse_class_session = sb._reuse_class_session
|
945
989
|
sb_config.save_screenshot = sb.save_screenshot_after_test
|
946
990
|
sb_config.no_screenshot = sb.no_screenshot_after_test
|
@@ -1162,12 +1206,10 @@ def behave_dashboard_prepare():
|
|
1162
1206
|
sb_config.item_count_untested = sb_config.item_count
|
1163
1207
|
dash_path = os.path.join(os.getcwd(), "dashboard.html")
|
1164
1208
|
star_len = len("Dashboard: ") + len(dash_path)
|
1165
|
-
|
1209
|
+
with suppress(Exception):
|
1166
1210
|
terminal_size = os.get_terminal_size().columns
|
1167
1211
|
if terminal_size > 30 and star_len > terminal_size:
|
1168
1212
|
star_len = terminal_size
|
1169
|
-
except Exception:
|
1170
|
-
pass
|
1171
1213
|
stars = "*" * star_len
|
1172
1214
|
c1 = ""
|
1173
1215
|
cr = ""
|
@@ -1263,7 +1305,7 @@ def _perform_behave_unconfigure_():
|
|
1263
1305
|
|
1264
1306
|
|
1265
1307
|
def do_final_driver_cleanup_as_needed():
|
1266
|
-
|
1308
|
+
with suppress(Exception):
|
1267
1309
|
if hasattr(sb_config, "last_driver") and sb_config.last_driver:
|
1268
1310
|
if (
|
1269
1311
|
not is_windows
|
@@ -1271,8 +1313,6 @@ def do_final_driver_cleanup_as_needed():
|
|
1271
1313
|
or sb_config.last_driver.service.process
|
1272
1314
|
):
|
1273
1315
|
sb_config.last_driver.quit()
|
1274
|
-
except Exception:
|
1275
|
-
pass
|
1276
1316
|
|
1277
1317
|
|
1278
1318
|
def _perform_behave_terminal_summary_():
|
@@ -1281,12 +1321,10 @@ def _perform_behave_terminal_summary_():
|
|
1281
1321
|
)
|
1282
1322
|
dash_path = os.path.join(os.getcwd(), "dashboard.html")
|
1283
1323
|
equals_len = len("Dashboard: ") + len(dash_path)
|
1284
|
-
|
1324
|
+
with suppress(Exception):
|
1285
1325
|
terminal_size = os.get_terminal_size().columns
|
1286
1326
|
if terminal_size > 30 and equals_len > terminal_size:
|
1287
1327
|
equals_len = terminal_size
|
1288
|
-
except Exception:
|
1289
|
-
pass
|
1290
1328
|
equals = "=" * (equals_len + 2)
|
1291
1329
|
c2 = ""
|
1292
1330
|
cr = ""
|
seleniumbase/config/settings.py
CHANGED
@@ -110,6 +110,10 @@ DISABLE_CSP_ON_CHROME = False
|
|
110
110
|
# (This applies when using --proxy=[PROXY_STRING] for using a proxy server.)
|
111
111
|
RAISE_INVALID_PROXY_STRING_EXCEPTION = True
|
112
112
|
|
113
|
+
# Default browser coordinates when opening new windows for tests.
|
114
|
+
WINDOW_START_X = 20
|
115
|
+
WINDOW_START_Y = 54
|
116
|
+
|
113
117
|
# Default browser resolutions when opening new windows for tests.
|
114
118
|
# (Headless resolutions take priority, and include all browsers.)
|
115
119
|
# (Firefox starts maximized by default when running in GUI Mode.)
|
@@ -16,16 +16,16 @@ Output:
|
|
16
16
|
import colorama
|
17
17
|
import subprocess
|
18
18
|
import sys
|
19
|
+
import tkinter as tk
|
20
|
+
from seleniumbase.fixtures import shared_utils
|
21
|
+
from tkinter.scrolledtext import ScrolledText
|
19
22
|
|
20
|
-
if sys.version_info <= (3,
|
23
|
+
if sys.version_info <= (3, 8):
|
21
24
|
current_version = ".".join(str(ver) for ver in sys.version_info[:3])
|
22
25
|
raise Exception(
|
23
|
-
"\n* SBase Commander requires Python 3.
|
26
|
+
"\n* SBase Commander requires Python 3.8 or newer!"
|
24
27
|
"\n** You are currently using Python %s" % current_version
|
25
28
|
)
|
26
|
-
from seleniumbase.fixtures import shared_utils
|
27
|
-
import tkinter as tk # noqa: E402
|
28
|
-
from tkinter.scrolledtext import ScrolledText # noqa: E402
|
29
29
|
|
30
30
|
|
31
31
|
def set_colors(use_colors):
|
@@ -20,17 +20,17 @@ import colorama
|
|
20
20
|
import os
|
21
21
|
import subprocess
|
22
22
|
import sys
|
23
|
+
import tkinter as tk
|
24
|
+
from seleniumbase.fixtures import shared_utils
|
25
|
+
from tkinter import messagebox
|
26
|
+
from tkinter.scrolledtext import ScrolledText
|
23
27
|
|
24
|
-
if sys.version_info <= (3,
|
28
|
+
if sys.version_info <= (3, 8):
|
25
29
|
current_version = ".".join(str(ver) for ver in sys.version_info[:3])
|
26
30
|
raise Exception(
|
27
|
-
"\n* SBase Case Plans Generator requires Python 3.
|
31
|
+
"\n* SBase Case Plans Generator requires Python 3.8 or newer!"
|
28
32
|
"\n** You are currently using Python %s" % current_version
|
29
33
|
)
|
30
|
-
from seleniumbase.fixtures import shared_utils
|
31
|
-
import tkinter as tk # noqa: E402
|
32
|
-
from tkinter import messagebox # noqa: E402
|
33
|
-
from tkinter.scrolledtext import ScrolledText # noqa: E402
|
34
34
|
|
35
35
|
|
36
36
|
def set_colors(use_colors):
|
@@ -21,16 +21,16 @@ import colorama
|
|
21
21
|
import os
|
22
22
|
import subprocess
|
23
23
|
import sys
|
24
|
+
import tkinter as tk
|
25
|
+
from seleniumbase.fixtures import shared_utils
|
26
|
+
from tkinter.scrolledtext import ScrolledText
|
24
27
|
|
25
|
-
if sys.version_info <= (3,
|
28
|
+
if sys.version_info <= (3, 8):
|
26
29
|
current_version = ".".join(str(ver) for ver in sys.version_info[:3])
|
27
30
|
raise Exception(
|
28
|
-
"\n* SBase Commander requires Python 3.
|
31
|
+
"\n* SBase Commander requires Python 3.8 or newer!"
|
29
32
|
"\n** You are currently using Python %s" % current_version
|
30
33
|
)
|
31
|
-
from seleniumbase.fixtures import shared_utils
|
32
|
-
import tkinter as tk # noqa: E402
|
33
|
-
from tkinter.scrolledtext import ScrolledText # noqa: E402
|
34
34
|
|
35
35
|
|
36
36
|
def set_colors(use_colors):
|
@@ -578,10 +578,18 @@ def main(override=None, intel_for_uc=None, force_uc=None):
|
|
578
578
|
else:
|
579
579
|
invalid_run_command()
|
580
580
|
if IS_MAC:
|
581
|
-
|
581
|
+
if IS_ARM_MAC:
|
582
|
+
file_name = "geckodriver-%s-macos-aarch64.tar.gz" % use_version
|
583
|
+
else:
|
584
|
+
file_name = "geckodriver-%s-macos.tar.gz" % use_version
|
582
585
|
elif IS_LINUX:
|
583
586
|
if "64" in ARCH:
|
584
|
-
|
587
|
+
if "aarch64" in platform.processor():
|
588
|
+
file_name = (
|
589
|
+
"geckodriver-%s-linux-aarch64.tar.gz" % use_version
|
590
|
+
)
|
591
|
+
else:
|
592
|
+
file_name = "geckodriver-%s-linux64.tar.gz" % use_version
|
585
593
|
else:
|
586
594
|
file_name = "geckodriver-%s-linux32.tar.gz" % use_version
|
587
595
|
elif IS_WINDOWS:
|
@@ -18,23 +18,23 @@ import colorama
|
|
18
18
|
import os
|
19
19
|
import subprocess
|
20
20
|
import sys
|
21
|
+
import tkinter as tk
|
21
22
|
from seleniumbase import config as sb_config
|
22
23
|
from seleniumbase.fixtures import page_utils
|
23
24
|
from seleniumbase.fixtures import shared_utils
|
25
|
+
from tkinter import messagebox
|
24
26
|
|
25
27
|
sb_config.rec_subprocess_p = None
|
26
28
|
sb_config.rec_subprocess_used = False
|
27
29
|
sys_executable = sys.executable
|
28
30
|
if " " in sys_executable:
|
29
31
|
sys_executable = "python"
|
30
|
-
if sys.version_info <= (3,
|
32
|
+
if sys.version_info <= (3, 8):
|
31
33
|
current_version = ".".join(str(ver) for ver in sys.version_info[:3])
|
32
34
|
raise Exception(
|
33
|
-
"\n* Recorder Desktop requires Python 3.
|
35
|
+
"\n* Recorder Desktop requires Python 3.8 or newer!"
|
34
36
|
"\n*** You are currently using Python %s" % current_version
|
35
37
|
)
|
36
|
-
import tkinter as tk # noqa: E402
|
37
|
-
from tkinter import messagebox # noqa: E402
|
38
38
|
|
39
39
|
|
40
40
|
def set_colors(use_colors):
|