Skip to content

Commit 40baf45

Browse files
authored
Merge pull request #1618 from seleniumbase/new-debugger-and-more-2
New Debugger and More
2 parents 842deb6 + 556b449 commit 40baf45

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+5059
-5067
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ pytest my_first_test.py --demo
451451
452452
```python
453453
import time; time.sleep(5) # Makes the test wait and do nothing for 5 seconds.
454-
import ipdb; ipdb.set_trace() # Enter debugging mode. n = next, c = continue, s = step.
454+
import pdb; pdb.set_trace() # Enter debugging mode. n = next, c = continue, s = step.
455455
import pytest; pytest.set_trace() # Enter debugging mode. n = next, c = continue, s = step.
456456
```
457457
@@ -461,7 +461,7 @@ import pytest; pytest.set_trace() # Enter debugging mode. n = next, c = continu
461461
pytest my_first_test.py --pdb
462462
```
463463
464-
(**``ipdb``** console commands: ``n``, ``c``, ``s`` => ``next``, ``continue``, ``step``).
464+
(**``pdb``** console commands: ``n``, ``c``, ``s`` => ``next``, ``continue``, ``step``).
465465
466466
<a id="pytest_options"></a>
467467
🔵 Here are some useful command-line options that come with <code>pytest</code>:

examples/boilerplates/samples/google_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class GoogleTests(BaseCase):
88
def test_google_dot_com(self):
99
self.open("https://google.com/ncr")
1010
self.sleep(0.1)
11-
self.save_screenshot_to_logs() # In "./latest_logs/" folder.
11+
self.save_screenshot_to_logs() # ("./latest_logs" folder)
1212
self.type(HomePage.search_box, "github.com")
1313
self.assert_element(HomePage.search_button)
1414
self.assert_element(HomePage.feeling_lucky_button)

examples/github_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33

44
class GitHubTests(BaseCase):
55
def test_github(self):
6-
if self.headless:
6+
if self.headless or self.page_load_strategy == "none":
77
self.open_if_not_url("about:blank")
8-
print("\n This test is not for Headless Mode.")
9-
self.skip('Do not use "--headless" with this test.')
8+
message = "Unsupported mode for this test."
9+
print("\n " + message)
10+
self.skip(message)
1011
self.open("https://github.com/search?q=SeleniumBase")
1112
self.slow_click('a[href="/seleniumbase/SeleniumBase"]')
1213
self.click_if_visible('[data-action="click:signup-prompt#dismiss"]')

examples/master_qa/pytest.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[pytest]
22

3-
# Display console output, disable cacheprovider, and have the ipdb debugger replace pdb:
4-
addopts = --capture=no -p no:cacheprovider --pdbcls=IPython.terminal.debugger:TerminalPdb
3+
# Display console output, disable cacheprovider:
4+
addopts = --capture=no -p no:cacheprovider
55

66
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
77
filterwarnings =

examples/migration/raw_selenium/pytest.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[pytest]
22

3-
# Display console output, disable cacheprovider, and have the ipdb debugger replace pdb:
4-
addopts = --capture=no -p no:cacheprovider --pdbcls=IPython.terminal.debugger:TerminalPdb
3+
# Display console output, disable cacheprovider:
4+
addopts = --capture=no -p no:cacheprovider
55

66
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
77
filterwarnings =

examples/my_first_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_swag_labs(self):
6969
# * Wait for the element to be interactive
7070
# * Clear the text field
7171
# * Type in the new text
72-
# * Press Enter/Submit if the text ends in "\n"
72+
# * Press Enter/Return if the text ends in "\n": {element.submit()}
7373
#
7474
# 4. Duplicate method names may exist for the same method:
7575
# (This makes it easier to switch over from other test frameworks.)

examples/nth_child_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ class NthChildSelectorTests(BaseCase):
55
def test_locate_rows_with_colors(self):
66
self.open("https://xkcd.com/color/rgb/")
77
tbody = "center > table tbody"
8-
if not (self.headless or self.xvfb):
8+
if not (self.headless or self.headless2 or self.xvfb):
99
self.demo_mode = True
1010
self.demo_sleep = 0.5
1111
self.message_duration = 2.0
1212
else:
13-
self.message_duration = 0.2
13+
self.demo_mode = False
14+
self.message_duration = 0.1
1415
self.highlight(tbody)
1516
self.post_message("Part 1: Assert text in given row.")
1617
self.assert_text("teal", tbody + " tr:nth-child(2)")

examples/offline_examples/demo_page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html>
22
<head>
33
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4-
<meta name="viewport" content="width=device-width, initial-scale=0.5">
4+
<meta name="viewport" content="width=device-width, initial-scale=0.41, shrink-to-fit=no">
55
<title>Web Testing Page</title>
66
<style>
77
html {
@@ -263,7 +263,7 @@
263263
<body>
264264
<!-- Tested with SeleniumBase - https://seleniumbase.io -->
265265
<form id="myForm">
266-
<table id="myTable" style="width: 780px; padding: 10px;">
266+
<table id="myTable" style="width: 804px; padding: 10px;">
267267
<tbody id="tbodyId">
268268
<tr>
269269
<td>

examples/pytest.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[pytest]
22

3-
# Display console output, disable cacheprovider, and have the ipdb debugger replace pdb:
4-
addopts = --capture=no -p no:cacheprovider --pdbcls=IPython.terminal.debugger:TerminalPdb
3+
# Display console output, disable cacheprovider:
4+
addopts = --capture=no -p no:cacheprovider
55

66
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
77
filterwarnings =

examples/setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
exclude=recordings,temp
44
ignore=W503
55

6-
[ipdb]
7-
context=5
8-
96
[nosetests]
107
# nocapture=1 (Display print statements from output)
118
# (Undo this by using: "--nologcapture")

0 commit comments

Comments
 (0)