Skip to content

Commit 700b4d9

Browse files
authored
Merge pull request #1626 from seleniumbase/improved-debugging
Improved debugging, and more
2 parents a836524 + 4276780 commit 700b4d9

28 files changed

+74
-57
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def test_mfa_login(sb):
162162
from seleniumbase import SB
163163

164164
with SB() as sb: # By default, browser="chrome" if not set.
165-
sb.open("https://seleniumbase.github.io/realworld/login")
165+
sb.open("https://seleniumbase.io/realworld/login")
166166
sb.type("#username", "demo_user")
167167
sb.type("#password", "secret_pass")
168168
sb.enter_mfa_code("#totpcode", "GAXG2MTEOR3DMMDG") # 6-digit
@@ -547,10 +547,8 @@ pytest my_first_test.py --pdb
547547
--disable-ws # (Disable Web Security on Chromium-based browsers.)
548548
--enable-ws # (Enable Web Security on Chromium-based browsers.)
549549
--enable-sync # (Enable "Chrome Sync" on websites.)
550-
--use-auto-ext # (Use Chrome's automation extension.)
551550
--uc | --undetected # (Use undetected-chromedriver to evade bot-detection.)
552-
--uc-sub | --uc-subprocess # (Use undetected-chromedriver as a subprocess.)
553-
--remote-debug # (Enable Chrome's Remote Debugger on http://localhost:9222)
551+
--remote-debug # (Sync to Chrome Remote Debugger chrome://inspect/#devices)
554552
--final-debug # (Enter Debug Mode after each test ends. Don't use with CI!)
555553
--dashboard # (Enable the SeleniumBase Dashboard. Saved at: dashboard.html)
556554
--dash-title=STRING # (Set the title shown for the generated dashboard.)

examples/raw_sb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from seleniumbase import SB
33

44
with SB() as sb: # By default, browser="chrome" if not set.
5-
sb.open("https://seleniumbase.github.io/realworld/login")
5+
sb.open("https://seleniumbase.io/realworld/login")
66
sb.type("#username", "demo_user")
77
sb.type("#password", "secret_pass")
88
sb.enter_mfa_code("#totpcode", "GAXG2MTEOR3DMMDG") # 6-digit

examples/test_mfa_login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def test_mfa_login(self):
1010
self.assert_text("Welcome!", "h1")
1111
self.highlight("img#image1") # A fancier assert_element() call
1212
self.click('a:contains("This Page")') # Use :contains() on any tag
13-
self.save_screenshot_to_logs() # In "./latest_logs/" folder.
13+
self.save_screenshot_to_logs() # ("./latest_logs" folder for test)
1414
self.click_link("Sign out") # Link must be "a" tag. Not "button".
1515
self.assert_element('a:contains("Sign in")')
1616
self.assert_exact_text("You have been signed out!", "#top_message")

help_docs/customizing_test_runs.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,8 @@ pytest my_first_test.py --settings-file=custom_settings.py
163163
--disable-ws # (Disable Web Security on Chromium-based browsers.)
164164
--enable-ws # (Enable Web Security on Chromium-based browsers.)
165165
--enable-sync # (Enable "Chrome Sync" on websites.)
166-
--use-auto-ext # (Use Chrome's automation extension.)
167166
--uc | --undetected # (Use undetected-chromedriver to evade bot-detection.)
168-
--uc-sub | --uc-subprocess # (Use undetected-chromedriver as a subprocess.)
169-
--remote-debug # (Enable Chrome's Remote Debugger on http://localhost:9222)
167+
--remote-debug # (Sync to Chrome Remote Debugger chrome://inspect/#devices)
170168
--final-debug # (Enter Debug Mode after each test ends. Don't use with CI!)
171169
--dashboard # (Enable the SeleniumBase Dashboard. Saved at: dashboard.html)
172170
--dash-title=STRING # (Set the title shown for the generated dashboard.)

help_docs/how_it_works.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class TestMFALogin(BaseCase):
3434
self.assert_text("Welcome!", "h1")
3535
self.highlight("img#image1") # A fancier assert_element() call
3636
self.click('a:contains("This Page")') # Use :contains() on any tag
37-
self.save_screenshot_to_logs() # In "./latest_logs/" folder.
37+
self.save_screenshot_to_logs() # ("./latest_logs" folder for test)
3838
self.click_link("Sign out") # Link must be "a" tag. Not "button".
3939
self.assert_element('a:contains("Sign in")')
4040
self.assert_exact_text("You have been signed out!", "#top_message")

help_docs/recorder_mode.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ pytest new_test.py --rec -q -s --url=wikipedia.org
2828

2929
>>>>>>>>>>>>>>>>>> PDB set_trace >>>>>>>>>>>>>>>>>
3030

31-
-> import pdb; pdb.set_trace()
3231
> PATH_TO_YOUR_CURRENT_DIRECTORY/new_test.py(9)
33-
....
32+
.
3433
5 def test_recording(self):
35-
6 if self.recorder_ext and not self.xvfb:
36-
7 # When you are done recording actions,
37-
8 # type "c" and press [ENTER] to continue
34+
6 if self.recorder_ext:
35+
7 # When done recording actions,
36+
8 # type "c", and press [Enter].
3837
9 -> import pdb; pdb.set_trace()
3938
return None
4039
(Pdb+) c

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ idna==2.10;python_version<"3.6"
3030
idna==3.4;python_version>="3.6"
3131
chardet==3.0.4;python_version<"3.6"
3232
chardet==4.0.0;python_version>="3.6" and python_version<"3.7"
33-
chardet==5.0.0;python_version>="3.7"
33+
chardet==5.1.0;python_version>="3.7"
3434
charset-normalizer==2.0.12;python_version>="3.6" and python_version<"3.7"
3535
charset-normalizer==2.1.1;python_version>="3.7"
3636
urllib3==1.26.12;python_version<"3.7"
@@ -49,7 +49,7 @@ websockets==10.4;python_version>="3.7"
4949
pyopenssl==22.1.0;python_version>="3.7"
5050
wsproto==1.2.0;python_version>="3.7"
5151
selenium==3.141.0;python_version<"3.7"
52-
selenium==4.6.1;python_version>="3.7"
52+
selenium==4.7.0;python_version>="3.7"
5353
msedge-selenium-tools==3.141.3;python_version<"3.7"
5454
more-itertools==5.0.0;python_version<"3.6"
5555
more-itertools==8.14.0;python_version>="3.6" and python_version<"3.7"
@@ -99,7 +99,7 @@ pyreadline==2.1;platform_system=="Windows" and python_version<"3.6"
9999
pyreadline3==3.4.1;platform_system=="Windows" and python_version>="3.6"
100100
pyrepl==0.9.0
101101
tabcompleter==1.0.0
102-
pdbp==1.1.0
102+
pdbp==1.2.2
103103
colorama==0.4.6;python_version<"3.6"
104104
colorama==0.4.5;python_version>="3.6" and python_version<"3.7"
105105
colorama==0.4.6;python_version>="3.7"

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.9.3"
2+
__version__ = "4.9.4"

seleniumbase/behave/behave_sb.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@
7171
-D disable-ws (Disable Web Security on Chromium-based browsers.)
7272
-D enable-ws (Enable Web Security on Chromium-based browsers.)
7373
-D enable-sync (Enable "Chrome Sync".)
74-
-D use-auto-ext (Use Chrome's automation extension.)
7574
-D uc | -D undetected (Use undetected-chromedriver to evade bot-detection)
76-
-D uc-sub | -D uc-subprocess (Use undetected-chromedriver as a subprocess)
77-
-D remote-debug (Enable Chrome's Remote Debugger on http://localhost:9222)
75+
-D remote-debug (Sync to Chrome Remote Debugger chrome://inspect/#devices)
7876
-D dashboard (Enable the SeleniumBase Dashboard. Saved at: dashboard.html)
7977
-D dash-title=STRING (Set the title shown for the generated dashboard.)
8078
-D enable-3d-apis (Enables WebGL and 3D APIs.)
@@ -662,8 +660,8 @@ def get_configured_sb(context):
662660
if low_key in ["external-pdf", "external_pdf"]:
663661
sb.external_pdf = True
664662
continue
665-
# Handle: -D remote-debug / remote_debug
666-
if low_key in ["remote-debug", "remote_debug"]:
663+
# Handle: -D remote-debug / remote_debug / remote-debugger
664+
if low_key in ["remote-debug", "remote_debug", "remote-debugger"]:
667665
sb.remote_debug = True
668666
continue
669667
# Handle: -D settings=FILE / settings-file=FILE / settings_file=FILE

seleniumbase/console_scripts/ReadMe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ that are available when using SeleniumBase.
120120
--crumbs (Clear all cookies between tests reusing a session.)
121121
--maximize (Start tests with the web browser window maximized.)
122122
--dashboard (Enable SeleniumBase\'s Dashboard at dashboard.html)
123+
--uc (Enable undetected-chromedriver to evade bot-detection.)
123124
--incognito (Enable Chromium\'s Incognito mode.)
124125
--guest (Enable Chromium\'s Guest mode.)
125126
-m=MARKER (Run tests with the specified pytest marker.)
@@ -136,6 +137,7 @@ that are available when using SeleniumBase.
136137
| return / r: Run until method returns. j: Jump to line. |
137138
| where / w: Show stack spot. u: Up stack. d: Down stack. |
138139
| longlist / ll: See code. dir(): List namespace objects. |
140+
--final-debug (Enter Final Debug Mode after each test ends.)
139141
--recorder (Record browser actions to generate test scripts.)
140142
--save-screenshot (Save a screenshot at the end of each test.)
141143
--archive-logs (Archive old log files instead of deleting them.)
@@ -149,6 +151,7 @@ that are available when using SeleniumBase.
149151
--env=ENV (Set the test env. Access with "self.env" in tests.)
150152
--data=DATA (Extra test data. Access with "self.data" in tests.)
151153
--disable-csp (Disable the Content Security Policy of websites.)
154+
--remote-debug (Sync to Ch-R-Debugger chrome://inspect/#devices)
152155
--server=SERVER (The Selenium Grid server/IP used for tests.)
153156
--port=PORT (The Selenium Grid port used by the test server.)
154157
--proxy=SERVER:PORT (Connect to a proxy server:port for tests.)
@@ -179,6 +182,7 @@ that are available when using SeleniumBase.
179182
-D crumbs (Clear all cookies between tests reusing a session.)
180183
-D maximize (Start tests with the web browser window maximized.)
181184
-D dashboard (Enable SeleniumBase\'s Dashboard at dashboard.html)
185+
-D uc (Enable undetected-chromedriver to evade bot-detection.)
182186
-D incognito (Enable Chromium\'s Incognito mode.)
183187
-D guest (Enable Chromium\'s Guest mode.)
184188
--no-snippets / -q (Quiet mode. Don\'t print snippets.)
@@ -203,6 +207,7 @@ that are available when using SeleniumBase.
203207
-D env=ENV (Set the test env. Access with "self.env" in tests.)
204208
-D data=DATA (Extra test data. Access with "self.data" in tests.)
205209
-D disable-csp (Disable the Content Security Policy of websites.)
210+
-D remote-debug (Sync to Ch-R-Debugger chrome://inspect/#devices)
206211
-D server=SERVER (The Selenium Grid server/IP used for tests.)
207212
-D port=PORT (The Selenium Grid port used by the test server.)
208213
-D proxy=SERVER:PORT (Connect to a proxy server:port for tests.)

0 commit comments

Comments
 (0)