pytest-seleniumbase 4.22.3__py3-none-any.whl → 4.44.8__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.
Potentially problematic release.
This version of pytest-seleniumbase might be problematic. Click here for more details.
- {pytest_seleniumbase-4.22.3.dist-info → pytest_seleniumbase-4.44.8.dist-info}/METADATA +234 -211
- pytest_seleniumbase-4.44.8.dist-info/RECORD +4 -0
- {pytest_seleniumbase-4.22.3.dist-info → pytest_seleniumbase-4.44.8.dist-info}/WHEEL +1 -1
- pytest_seleniumbase-4.22.3.dist-info/RECORD +0 -4
- {pytest_seleniumbase-4.22.3.dist-info → pytest_seleniumbase-4.44.8.dist-info}/top_level.txt +0 -0
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pytest-seleniumbase
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.44.8
|
|
4
4
|
Summary: A complete web automation framework for end-to-end testing.
|
|
5
5
|
Home-page: https://github.com/seleniumbase/SeleniumBase
|
|
6
6
|
Author: Michael Mintz
|
|
7
7
|
Author-email: mdmintz@gmail.com
|
|
8
8
|
Maintainer: Michael Mintz
|
|
9
9
|
License: MIT
|
|
10
|
+
Project-URL: Homepage, https://github.com/seleniumbase/SeleniumBase
|
|
10
11
|
Project-URL: Changelog, https://github.com/seleniumbase/SeleniumBase/releases
|
|
11
12
|
Project-URL: Download, https://pypi.org/project/seleniumbase/#files
|
|
12
|
-
Project-URL: Gitter, https://gitter.im/seleniumbase/SeleniumBase
|
|
13
13
|
Project-URL: Blog, https://seleniumbase.com/
|
|
14
|
+
Project-URL: Discord, https://discord.gg/EdhQTn3EyE
|
|
14
15
|
Project-URL: PyPI, https://pypi.org/project/seleniumbase/
|
|
15
16
|
Project-URL: Source, https://github.com/seleniumbase/SeleniumBase
|
|
17
|
+
Project-URL: Repository, https://github.com/seleniumbase/SeleniumBase
|
|
16
18
|
Project-URL: Documentation, https://seleniumbase.io/
|
|
17
19
|
Platform: Windows
|
|
18
20
|
Platform: Linux
|
|
@@ -25,74 +27,91 @@ Classifier: Environment :: Web Environment
|
|
|
25
27
|
Classifier: Framework :: Pytest
|
|
26
28
|
Classifier: Intended Audience :: Developers
|
|
27
29
|
Classifier: Intended Audience :: Information Technology
|
|
28
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
29
30
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
30
31
|
Classifier: Operating System :: Microsoft :: Windows
|
|
31
32
|
Classifier: Operating System :: POSIX :: Linux
|
|
32
33
|
Classifier: Programming Language :: Python
|
|
33
34
|
Classifier: Programming Language :: Python :: 3
|
|
34
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
35
35
|
Classifier: Programming Language :: Python :: 3.8
|
|
36
36
|
Classifier: Programming Language :: Python :: 3.9
|
|
37
37
|
Classifier: Programming Language :: Python :: 3.10
|
|
38
38
|
Classifier: Programming Language :: Python :: 3.11
|
|
39
39
|
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
40
42
|
Classifier: Topic :: Internet
|
|
41
43
|
Classifier: Topic :: Scientific/Engineering
|
|
42
44
|
Classifier: Topic :: Software Development
|
|
43
45
|
Classifier: Topic :: Software Development :: Quality Assurance
|
|
44
46
|
Classifier: Topic :: Software Development :: Libraries
|
|
47
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
48
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
45
49
|
Classifier: Topic :: Software Development :: Testing
|
|
46
50
|
Classifier: Topic :: Software Development :: Testing :: Acceptance
|
|
47
51
|
Classifier: Topic :: Software Development :: Testing :: Traffic Generation
|
|
48
52
|
Classifier: Topic :: Utilities
|
|
49
|
-
Requires-Python: >=3.
|
|
53
|
+
Requires-Python: >=3.8
|
|
50
54
|
Description-Content-Type: text/markdown
|
|
51
|
-
Requires-Dist: seleniumbase
|
|
55
|
+
Requires-Dist: seleniumbase>=4.44.8
|
|
56
|
+
Dynamic: author
|
|
57
|
+
Dynamic: author-email
|
|
58
|
+
Dynamic: classifier
|
|
59
|
+
Dynamic: home-page
|
|
60
|
+
Dynamic: license
|
|
61
|
+
Dynamic: maintainer
|
|
62
|
+
Dynamic: platform
|
|
63
|
+
Dynamic: requires-dist
|
|
64
|
+
Dynamic: requires-python
|
|
65
|
+
Dynamic: summary
|
|
52
66
|
|
|
53
67
|
**[<img src="https://img.shields.io/badge/pypi-pytest--seleniumbase-22AAEE.svg" alt="pypi" />](https://pypi.python.org/pypi/pytest-seleniumbase) is a proxy for [<img src="https://img.shields.io/badge/pypi-seleniumbase-22AAEE.svg" alt="pypi" />](https://pypi.python.org/pypi/seleniumbase)**
|
|
54
68
|
****
|
|
55
69
|
|
|
56
70
|
<!-- SeleniumBase Docs -->
|
|
57
71
|
|
|
72
|
+
<meta property="og:site_name" content="SeleniumBase">
|
|
73
|
+
<meta property="og:title" content="SeleniumBase: Python Web Automation and E2E Testing" />
|
|
74
|
+
<meta property="og:description" content="Fast, easy, and reliable Web/UI testing with Python." />
|
|
75
|
+
<meta property="og:keywords" content="Python, pytest, selenium, webdriver, testing, automation, seleniumbase, framework, dashboard, recorder, reports, screenshots">
|
|
76
|
+
<meta property="og:image" content="https://seleniumbase.github.io/cdn/img/mac_sb_logo_5b.png" />
|
|
77
|
+
<link rel="icon" href="https://seleniumbase.github.io/img/logo7.png" />
|
|
58
78
|
|
|
59
79
|
<h1>SeleniumBase</h1>
|
|
60
80
|
|
|
61
|
-
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/
|
|
81
|
+
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb3.png" alt="SeleniumBase" title="SeleniumBase" width="350" /></a></p>
|
|
62
82
|
|
|
63
|
-
<h2 align="center" class="hero__title">All-in-one Test Automation Framework</h2>
|
|
64
83
|
|
|
65
|
-
<
|
|
84
|
+
<p align="center" class="hero__title"><b>All-in-one Browser Automation Framework:<br />Web Crawling / Testing / Scraping / Stealth</b></p>
|
|
66
85
|
|
|
67
|
-
<p align="center"><a href="https://pypi.python.org/pypi/seleniumbase" target="_blank"><img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=3399EE" alt="PyPI version" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/releases" target="_blank"><img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=22AAEE" alt="GitHub version" /></a> <a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions" target="_blank"><img src="https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg" alt="SeleniumBase GitHub Actions" /></a> <a href="https://
|
|
86
|
+
<p align="center"><a href="https://pypi.python.org/pypi/seleniumbase" target="_blank"><img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=3399EE" alt="PyPI version" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/releases" target="_blank"><img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=22AAEE" alt="GitHub version" /></a> <a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions" target="_blank"><img src="https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg" alt="SeleniumBase GitHub Actions" /></a> <a href="https://discord.gg/EdhQTn3EyE" target="_blank"><img src="https://img.shields.io/badge/join-discord-infomational" alt="Join the SeleniumBase chat on Discord"/></a></p>
|
|
68
87
|
|
|
69
88
|
<p align="center">
|
|
70
89
|
<a href="#python_installation">🚀 Start</a> |
|
|
71
90
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/features_list.md">🏰 Features</a> |
|
|
72
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">📚 Examples</a> |
|
|
73
91
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">🎛️ Options</a> |
|
|
92
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">📚 Examples</a> |
|
|
74
93
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md">🌠 Scripts</a> |
|
|
75
94
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md">📱 Mobile</a>
|
|
76
95
|
<br />
|
|
77
96
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">📘 APIs</a> |
|
|
78
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md">
|
|
79
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">📊 Dashboard</a> |
|
|
97
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md"> 🔠 Formats</a> |
|
|
80
98
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md">🔴 Recorder</a> |
|
|
99
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">📊 Dashboard</a> |
|
|
81
100
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/locale_codes.md">🗾 Locales</a> |
|
|
82
|
-
<a href="https://
|
|
101
|
+
<a href="https://seleniumbase.io/devices/?url=seleniumbase.com">💻 Farm</a>
|
|
83
102
|
<br />
|
|
84
103
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/commander.md">🎖️ GUI</a> |
|
|
85
104
|
<a href="https://seleniumbase.io/demo_page">📰 TestPage</a> |
|
|
86
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/
|
|
87
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/
|
|
88
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/
|
|
89
|
-
<a href="https://
|
|
105
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md">👤 UC Mode</a> |
|
|
106
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md">🐙 CDP Mode</a> |
|
|
107
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/ReadMe.md">📶 Charts</a> |
|
|
108
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md">🌐 Grid</a>
|
|
90
109
|
<br />
|
|
91
110
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/how_it_works.md">👁️ How</a> |
|
|
92
111
|
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/migration/raw_selenium">🚝 Migrate</a> |
|
|
93
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/
|
|
94
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/
|
|
95
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/
|
|
112
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/case_plans.md">🗂️ CasePlans</a> |
|
|
113
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/boilerplates">♻️ Template</a> |
|
|
114
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md">🧬 Hybrid</a> |
|
|
96
115
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">🚎 Tours</a>
|
|
97
116
|
<br />
|
|
98
117
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/github/workflows/ReadMe.md">🤖 CI/CD</a> |
|
|
@@ -104,85 +123,132 @@ Requires-Dist: seleniumbase >=4.22.3
|
|
|
104
123
|
<br />
|
|
105
124
|
</p>
|
|
106
125
|
|
|
126
|
+
<p>SeleniumBase is the professional toolkit for web automation activities. Built for testing websites, bypassing CAPTCHAs, enhancing productivity, completing tasks, and scaling your business.</p>
|
|
127
|
+
|
|
107
128
|
--------
|
|
108
129
|
|
|
109
|
-
|
|
130
|
+
📚 Learn from [**over 200 examples** in the **SeleniumBase/examples/** folder](https://github.com/seleniumbase/SeleniumBase/tree/master/examples).
|
|
110
131
|
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
<
|
|
114
|
-
<li><a href="#install_seleniumbase" ><strong>Get Started / Installation</strong></a></li>
|
|
115
|
-
<li><a href="#basic_example_and_usage"><strong>Basic Example / Usage</strong></a></li>
|
|
116
|
-
<li><a href="#common_methods" ><strong>Common Test Methods</strong></a></li>
|
|
117
|
-
<li><a href="#fun_facts" ><strong>Fun Facts / Learn More</strong></a></li>
|
|
118
|
-
<li><a href="#demo_mode_and_debugging"><strong>Demo Mode / Debugging</strong></a></li>
|
|
119
|
-
<li><a href="#command_line_options" ><strong>Command-line Options</strong></a></li>
|
|
120
|
-
<li><a href="#directory_configuration"><strong>Directory Configuration</strong></a></li>
|
|
121
|
-
<li><a href="#seleniumbase_dashboard" ><strong>SeleniumBase Dashboard</strong></a></li>
|
|
122
|
-
<li><a href="#creating_visual_reports"><strong>Generating Test Reports</strong></a></li>
|
|
123
|
-
</ul>
|
|
124
|
-
</blockquote>
|
|
132
|
+
🐙 Note that <a translate="no" href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md"><b>UC Mode</b></a> / <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md"><b>CDP Mode</b></a> (Stealth Mode) have their own ReadMe files.
|
|
133
|
+
|
|
134
|
+
ℹ️ Most scripts run with raw <code translate="no"><b>python</b></code>, although some scripts use <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md">Syntax Formats</a> that expect <a href="https://docs.pytest.org/en/latest/how-to/usage.html" translate="no"><b>pytest</b></a> (a Python unit-testing framework included with SeleniumBase that can discover, collect, and run tests automatically).
|
|
125
135
|
|
|
126
136
|
--------
|
|
127
137
|
|
|
128
|
-
<a
|
|
138
|
+
<p align="left">📗 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_google.py">raw_google.py</a>, which performs a Google search:</p>
|
|
129
139
|
|
|
130
|
-
|
|
140
|
+
```python
|
|
141
|
+
from seleniumbase import SB
|
|
131
142
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
143
|
+
with SB(test=True, uc=True) as sb:
|
|
144
|
+
sb.open("https://google.com/ncr")
|
|
145
|
+
sb.type('[title="Search"]', "SeleniumBase GitHub page\n")
|
|
146
|
+
sb.click('[href*="github.com/seleniumbase/"]')
|
|
147
|
+
sb.save_screenshot_to_logs() # ./latest_logs/
|
|
148
|
+
print(sb.get_page_title())
|
|
135
149
|
```
|
|
136
150
|
|
|
137
|
-
|
|
151
|
+
> `python raw_google.py`
|
|
152
|
+
|
|
153
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_google.py"><img src="https://seleniumbase.github.io/cdn/gif/google_search.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="420" /></a>
|
|
154
|
+
|
|
155
|
+
--------
|
|
156
|
+
|
|
157
|
+
<p align="left">📗 Here's an example of bypassing Cloudflare's challenge page: <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/raw_gitlab.py">SeleniumBase/examples/cdp_mode/raw_gitlab.py</a></p>
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
from seleniumbase import SB
|
|
161
|
+
|
|
162
|
+
with SB(uc=True, test=True, locale="en") as sb:
|
|
163
|
+
url = "https://gitlab.com/users/sign_in"
|
|
164
|
+
sb.activate_cdp_mode(url)
|
|
165
|
+
sb.uc_gui_click_captcha()
|
|
166
|
+
sb.sleep(2)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
<img src="https://seleniumbase.github.io/other/cf_sec.jpg" title="SeleniumBase" width="332"> <img src="https://seleniumbase.github.io/other/gitlab_bypass.png" title="SeleniumBase" width="288">
|
|
170
|
+
|
|
171
|
+
--------
|
|
172
|
+
|
|
173
|
+
<p align="left">📗 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_get_swag.py">test_get_swag.py</a>, which tests an e-commerce site:</p>
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
from seleniumbase import BaseCase
|
|
177
|
+
BaseCase.main(__name__, __file__) # Call pytest
|
|
178
|
+
|
|
179
|
+
class MyTestClass(BaseCase):
|
|
180
|
+
def test_swag_labs(self):
|
|
181
|
+
self.open("https://www.saucedemo.com")
|
|
182
|
+
self.type("#user-name", "standard_user")
|
|
183
|
+
self.type("#password", "secret_sauce\n")
|
|
184
|
+
self.assert_element("div.inventory_list")
|
|
185
|
+
self.click('button[name*="backpack"]')
|
|
186
|
+
self.click("#shopping_cart_container a")
|
|
187
|
+
self.assert_text("Backpack", "div.cart_item")
|
|
188
|
+
self.click("button#checkout")
|
|
189
|
+
self.type("input#first-name", "SeleniumBase")
|
|
190
|
+
self.type("input#last-name", "Automation")
|
|
191
|
+
self.type("input#postal-code", "77123")
|
|
192
|
+
self.click("input#continue")
|
|
193
|
+
self.click("button#finish")
|
|
194
|
+
self.assert_text("Thank you for your order!")
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
> `pytest test_get_swag.py`
|
|
198
|
+
|
|
199
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_get_swag.py"><img src="https://seleniumbase.github.io/cdn/gif/fast_swag_2.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="480" /></a>
|
|
138
200
|
|
|
139
|
-
>
|
|
201
|
+
> (The default browser is ``--chrome`` if not set.)
|
|
140
202
|
|
|
141
203
|
--------
|
|
142
204
|
|
|
143
|
-
<p align="left"
|
|
205
|
+
<p align="left">📗 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_coffee_cart.py" target="_blank">test_coffee_cart.py</a>, which verifies an e-commerce site:</p>
|
|
144
206
|
|
|
145
207
|
```bash
|
|
146
|
-
cd examples/
|
|
147
208
|
pytest test_coffee_cart.py --demo
|
|
148
209
|
```
|
|
149
210
|
|
|
150
|
-
<p>(<code translate="no">--demo</code> mode slows down tests and highlights actions)</p>
|
|
151
|
-
|
|
152
211
|
<p align="left"><a href="https://seleniumbase.io/coffee/" target="_blank"><img src="https://seleniumbase.github.io/cdn/gif/coffee_cart.gif" width="480" alt="SeleniumBase Coffee Cart Test" title="SeleniumBase Coffee Cart Test" /></a></p>
|
|
153
212
|
|
|
154
|
-
>
|
|
213
|
+
> <p>(<code translate="no">--demo</code> mode slows down tests and highlights actions)</p>
|
|
155
214
|
|
|
156
|
-
|
|
215
|
+
--------
|
|
157
216
|
|
|
158
|
-
|
|
159
|
-
from seleniumbase import BaseCase
|
|
160
|
-
BaseCase.main(__name__, __file__)
|
|
217
|
+
<a id="multiple_examples"></a>
|
|
161
218
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
self.assert_element('button:contains("Total: $0.00")')
|
|
167
|
-
self.click('div[data-sb="Cappuccino"]')
|
|
168
|
-
self.assert_exact_text("cart (1)", 'a[aria-label="Cart page"]')
|
|
169
|
-
self.click('div[data-sb="Flat-White"]')
|
|
170
|
-
self.assert_exact_text("cart (2)", 'a[aria-label="Cart page"]')
|
|
171
|
-
self.click('div[data-sb="Cafe-Latte"]')
|
|
172
|
-
self.assert_exact_text("cart (3)", 'a[aria-label="Cart page"]')
|
|
173
|
-
self.click('a[aria-label="Cart page"]')
|
|
174
|
-
self.assert_exact_text("Total: $53.00", "button.pay")
|
|
175
|
-
self.click("button.pay")
|
|
176
|
-
self.type("input#name", "Selenium Coffee")
|
|
177
|
-
self.type("input#email", "test@test.test")
|
|
178
|
-
self.click("button#submit-payment")
|
|
179
|
-
self.assert_text("Thanks for your purchase.", "#app .success")
|
|
219
|
+
<p align="left">📗 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py" target="_blank">test_demo_site.py</a>, which covers several actions:</p>
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
pytest test_demo_site.py
|
|
180
223
|
```
|
|
181
224
|
|
|
225
|
+
<p align="left"><a href="https://seleniumbase.io/demo_page" target="_blank"><img src="https://seleniumbase.github.io/cdn/gif/demo_page_5.gif" width="480" alt="SeleniumBase Example" title="SeleniumBase Example" /></a></p>
|
|
226
|
+
|
|
227
|
+
> Easy to type, click, select, toggle, drag & drop, and more.
|
|
228
|
+
|
|
182
229
|
(For more examples, see the <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">SeleniumBase/examples/</a> folder.)
|
|
183
230
|
|
|
184
231
|
--------
|
|
185
232
|
|
|
233
|
+
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb3.png" alt="SeleniumBase" title="SeleniumBase" width="232" /></a></p>
|
|
234
|
+
|
|
235
|
+
<blockquote>
|
|
236
|
+
<p dir="auto"><strong>Explore the README:</strong></p>
|
|
237
|
+
<ul dir="auto">
|
|
238
|
+
<li><a href="#install_seleniumbase" ><strong>Get Started / Installation</strong></a></li>
|
|
239
|
+
<li><a href="#basic_example_and_usage"><strong>Basic Example / Usage</strong></a></li>
|
|
240
|
+
<li><a href="#common_methods" ><strong>Common Test Methods</strong></a></li>
|
|
241
|
+
<li><a href="#fun_facts" ><strong>Fun Facts / Learn More</strong></a></li>
|
|
242
|
+
<li><a href="#demo_mode_and_debugging"><strong>Demo Mode / Debugging</strong></a></li>
|
|
243
|
+
<li><a href="#command_line_options" ><strong>Command-line Options</strong></a></li>
|
|
244
|
+
<li><a href="#directory_configuration"><strong>Directory Configuration</strong></a></li>
|
|
245
|
+
<li><a href="#seleniumbase_dashboard" ><strong>SeleniumBase Dashboard</strong></a></li>
|
|
246
|
+
<li><a href="#creating_visual_reports"><strong>Generating Test Reports</strong></a></li>
|
|
247
|
+
</ul>
|
|
248
|
+
</blockquote>
|
|
249
|
+
|
|
250
|
+
--------
|
|
251
|
+
|
|
186
252
|
<details>
|
|
187
253
|
<summary> ▶️ How is <b>SeleniumBase</b> different from raw Selenium? (<b>click to expand</b>)</summary>
|
|
188
254
|
<div>
|
|
@@ -226,7 +292,7 @@ With raw Selenium, that requires more code:<br />
|
|
|
226
292
|
|
|
227
293
|
<p>📚 <b>Learn about different ways of writing tests:</b></p>
|
|
228
294
|
|
|
229
|
-
<p align="left"
|
|
295
|
+
<p align="left">📗📝 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_simple_login.py">test_simple_login.py</a>, which uses <code translate="no"><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py">BaseCase</a></code> class inheritance, and runs with <a href="https://docs.pytest.org/en/latest/how-to/usage.html">pytest</a> or <a href="https://github.com/mdmintz/pynose">pynose</a>. (Use <code translate="no">self.driver</code> to access Selenium's raw <code translate="no">driver</code>.)</p>
|
|
230
296
|
|
|
231
297
|
```python
|
|
232
298
|
from seleniumbase import BaseCase
|
|
@@ -245,22 +311,7 @@ class TestSimpleLogin(BaseCase):
|
|
|
245
311
|
self.assert_text("signed out", "#top_message")
|
|
246
312
|
```
|
|
247
313
|
|
|
248
|
-
<p align="left"
|
|
249
|
-
|
|
250
|
-
```python
|
|
251
|
-
def test_sb_fixture_with_no_class(sb):
|
|
252
|
-
sb.open("seleniumbase.io/simple/login")
|
|
253
|
-
sb.type("#username", "demo_user")
|
|
254
|
-
sb.type("#password", "secret_pass")
|
|
255
|
-
sb.click('a:contains("Sign in")')
|
|
256
|
-
sb.assert_exact_text("Welcome!", "h1")
|
|
257
|
-
sb.assert_element("img#image1")
|
|
258
|
-
sb.highlight("#image1")
|
|
259
|
-
sb.click_link("Sign out")
|
|
260
|
-
sb.assert_text("signed out", "#top_message")
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
<p align="left">📙📝 An <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_sb.py">example test</a> using the <b><code translate="no">SB</code></b> Context Manager. Runs with pure <b><code translate="no">python</code></b>. (Use <code translate="no">sb.driver</code> to access Selenium's raw <code translate="no">driver</code>.)</p>
|
|
314
|
+
<p align="left">📘📝 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_sb.py">raw_login_sb.py</a>, which uses the <b><code translate="no">SB</code></b> Context Manager. Runs with pure <code translate="no">python</code>. (Use <code translate="no">sb.driver</code> to access Selenium's raw <code translate="no">driver</code>.)</p>
|
|
264
315
|
|
|
265
316
|
```python
|
|
266
317
|
from seleniumbase import SB
|
|
@@ -277,24 +328,7 @@ with SB() as sb:
|
|
|
277
328
|
sb.assert_text("signed out", "#top_message")
|
|
278
329
|
```
|
|
279
330
|
|
|
280
|
-
<p align="left"
|
|
281
|
-
|
|
282
|
-
```python
|
|
283
|
-
from seleniumbase import DriverContext
|
|
284
|
-
|
|
285
|
-
with DriverContext() as driver:
|
|
286
|
-
driver.open("seleniumbase.io/simple/login")
|
|
287
|
-
driver.type("#username", "demo_user")
|
|
288
|
-
driver.type("#password", "secret_pass")
|
|
289
|
-
driver.click('a:contains("Sign in")')
|
|
290
|
-
driver.assert_exact_text("Welcome!", "h1")
|
|
291
|
-
driver.assert_element("img#image1")
|
|
292
|
-
driver.highlight("#image1")
|
|
293
|
-
driver.click_link("Sign out")
|
|
294
|
-
driver.assert_text("signed out", "#top_message")
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
<p align="left">📔📝 An <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_driver.py">example test</a> using the <b><code translate="no">Driver</code></b> Manager. Runs with pure <b><code translate="no">python</code></b>. (The <code>driver</code> is an improved version of Selenium's raw <code translate="no">driver</code>, with more methods.)</p>
|
|
331
|
+
<p align="left">📙📝 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_driver.py">raw_login_driver.py</a>, which uses the <b><code translate="no">Driver</code></b> Manager. Runs with pure <code translate="no">python</code>. (The <code>driver</code> is an improved version of Selenium's raw <code translate="no">driver</code>, with more methods.)</p>
|
|
298
332
|
|
|
299
333
|
```python
|
|
300
334
|
from seleniumbase import Driver
|
|
@@ -314,23 +348,6 @@ finally:
|
|
|
314
348
|
driver.quit()
|
|
315
349
|
```
|
|
316
350
|
|
|
317
|
-
<p align="left">📕📝 An <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/features/login_app.feature"> example test</a> using <b translate="no">behave-BDD</b> <a href="https://behave.readthedocs.io/en/stable/gherkin.html#features" target="_blank">Gherkin</a> syntax. Runs with <b><code translate="no">behave</code></b>. (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/ReadMe.md">Learn more</a>)</p>
|
|
318
|
-
|
|
319
|
-
```gherkin
|
|
320
|
-
Feature: SeleniumBase scenarios for the Simple App
|
|
321
|
-
|
|
322
|
-
Scenario: Verify the Simple App (Login / Logout)
|
|
323
|
-
Given Open "seleniumbase.io/simple/login"
|
|
324
|
-
And Type "demo_user" into "#username"
|
|
325
|
-
And Type "secret_pass" into "#password"
|
|
326
|
-
And Click 'a:contains("Sign in")'
|
|
327
|
-
And Assert exact text "Welcome!" in "h1"
|
|
328
|
-
And Assert element "img#image1"
|
|
329
|
-
And Highlight "#image1"
|
|
330
|
-
And Click link "Sign out"
|
|
331
|
-
And Assert text "signed out" in "#top_message"
|
|
332
|
-
```
|
|
333
|
-
|
|
334
351
|
--------
|
|
335
352
|
|
|
336
353
|
<a id="python_installation"></a>
|
|
@@ -375,48 +392,49 @@ pip install -e .
|
|
|
375
392
|
🔵 **Type ``seleniumbase`` or ``sbase`` to verify that SeleniumBase was installed successfully:**
|
|
376
393
|
|
|
377
394
|
```bash
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
COMMANDS:
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
395
|
+
___ _ _ ___
|
|
396
|
+
/ __| ___| |___ _ _ (_)_ _ _ __ | _ ) __ _ ______
|
|
397
|
+
\__ \/ -_) / -_) ' \| | \| | ' \ | _ \/ _` (_-< -_)
|
|
398
|
+
|___/\___|_\___|_||_|_|\_,_|_|_|_\|___/\__,_/__|___|
|
|
399
|
+
----------------------------------------------------
|
|
400
|
+
|
|
401
|
+
╭──────────────────────────────────────────────────╮
|
|
402
|
+
│ * USAGE: "seleniumbase [COMMAND] [PARAMETERS]" │
|
|
403
|
+
│ * OR: "sbase [COMMAND] [PARAMETERS]" │
|
|
404
|
+
│ │
|
|
405
|
+
│ COMMANDS: PARAMETERS / DESCRIPTIONS: │
|
|
406
|
+
│ get / install [DRIVER_NAME] [OPTIONS] │
|
|
407
|
+
│ methods (List common Python methods) │
|
|
408
|
+
│ options (List common pytest options) │
|
|
409
|
+
│ behave-options (List common behave options) │
|
|
410
|
+
│ gui / commander [OPTIONAL PATH or TEST FILE] │
|
|
411
|
+
│ behave-gui (SBase Commander for Behave) │
|
|
412
|
+
│ caseplans [OPTIONAL PATH or TEST FILE] │
|
|
413
|
+
│ mkdir [DIRECTORY] [OPTIONS] │
|
|
414
|
+
│ mkfile [FILE.py] [OPTIONS] │
|
|
415
|
+
│ mkrec / codegen [FILE.py] [OPTIONS] │
|
|
416
|
+
│ recorder (Open Recorder Desktop App.) │
|
|
417
|
+
│ record (If args: mkrec. Else: App.) │
|
|
418
|
+
│ mkpres [FILE.py] [LANG] │
|
|
419
|
+
│ mkchart [FILE.py] [LANG] │
|
|
420
|
+
│ print [FILE] [OPTIONS] │
|
|
421
|
+
│ translate [SB_FILE.py] [LANG] [ACTION] │
|
|
422
|
+
│ convert [WEBDRIVER_UNITTEST_FILE.py] │
|
|
423
|
+
│ extract-objects [SB_FILE.py] │
|
|
424
|
+
│ inject-objects [SB_FILE.py] [OPTIONS] │
|
|
425
|
+
│ objectify [SB_FILE.py] [OPTIONS] │
|
|
426
|
+
│ revert-objects [SB_FILE.py] [OPTIONS] │
|
|
427
|
+
│ encrypt / obfuscate │
|
|
428
|
+
│ decrypt / unobfuscate │
|
|
429
|
+
│ proxy (Start a basic proxy server) │
|
|
430
|
+
│ download server (Get Selenium Grid JAR file) │
|
|
431
|
+
│ grid-hub [start|stop] [OPTIONS] │
|
|
432
|
+
│ grid-node [start|stop] --hub=[HOST/IP] │
|
|
433
|
+
│ │
|
|
434
|
+
│ * EXAMPLE => "sbase get chromedriver stable" │
|
|
435
|
+
│ * For command info => "sbase help [COMMAND]" │
|
|
436
|
+
│ * For info on all commands => "sbase --help" │
|
|
437
|
+
╰──────────────────────────────────────────────────╯
|
|
420
438
|
```
|
|
421
439
|
|
|
422
440
|
<h3>🔵 Downloading webdrivers:</h3>
|
|
@@ -428,20 +446,21 @@ COMMANDS:
|
|
|
428
446
|
<summary> ▶️ Here's sample output from a chromedriver download. (<b>click to expand</b>)</summary>
|
|
429
447
|
|
|
430
448
|
```bash
|
|
431
|
-
*** chromedriver to download =
|
|
449
|
+
*** chromedriver to download = 131.0.6778.108 (Latest Stable)
|
|
432
450
|
|
|
433
451
|
Downloading chromedriver-mac-arm64.zip from:
|
|
434
|
-
https://
|
|
452
|
+
https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.108/mac-arm64/chromedriver-mac-arm64.zip ...
|
|
435
453
|
Download Complete!
|
|
436
454
|
|
|
437
455
|
Extracting ['chromedriver'] from chromedriver-mac-arm64.zip ...
|
|
438
456
|
Unzip Complete!
|
|
439
457
|
|
|
440
458
|
The file [chromedriver] was saved to:
|
|
441
|
-
|
|
459
|
+
~/github/SeleniumBase/seleniumbase/drivers/
|
|
460
|
+
chromedriver
|
|
442
461
|
|
|
443
|
-
Making [chromedriver
|
|
444
|
-
[chromedriver
|
|
462
|
+
Making [chromedriver 131.0.6778.108] executable ...
|
|
463
|
+
[chromedriver 131.0.6778.108] is now ready for use!
|
|
445
464
|
```
|
|
446
465
|
|
|
447
466
|
</details>
|
|
@@ -459,13 +478,9 @@ cd examples/
|
|
|
459
478
|
pytest my_first_test.py
|
|
460
479
|
```
|
|
461
480
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py"><img src="https://seleniumbase.github.io/cdn/gif/swag_labs_4.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="480" /></a>
|
|
481
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py"><img src="https://seleniumbase.github.io/cdn/gif/fast_swag_2.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="480" /></a>
|
|
465
482
|
|
|
466
|
-
>
|
|
467
|
-
|
|
468
|
-
<p align="left"><b>Here's the code for <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py">my_first_test.py</a>:</b></p>
|
|
483
|
+
<p align="left"><b>Here's the full code for <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py">my_first_test.py</a>:</b></p>
|
|
469
484
|
|
|
470
485
|
```python
|
|
471
486
|
from seleniumbase import BaseCase
|
|
@@ -549,7 +564,7 @@ self.assert_no_js_errors() # Verify there are no JS errors.
|
|
|
549
564
|
|
|
550
565
|
<p>✅ SeleniumBase automatically handles common <a href="https://www.selenium.dev/documentation/webdriver/" target="_blank">WebDriver</a> actions such as launching web browsers before tests, saving screenshots during failures, and closing web browsers after tests.</p>
|
|
551
566
|
|
|
552
|
-
<p>✅ SeleniumBase lets you <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">
|
|
567
|
+
<p>✅ SeleniumBase lets you customize tests via <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">command-line options</a>.</p>
|
|
553
568
|
|
|
554
569
|
<p>✅ SeleniumBase uses simple syntax for commands. Example:</p>
|
|
555
570
|
|
|
@@ -711,14 +726,18 @@ pytest test_coffee_cart.py --trace
|
|
|
711
726
|
--firefox-pref=SET # (Set a Firefox preference:value set, comma-separated.)
|
|
712
727
|
--extension-zip=ZIP # (Load a Chrome Extension .zip|.crx, comma-separated.)
|
|
713
728
|
--extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.)
|
|
729
|
+
--disable-features="F1,F2" # (Disable features, comma-separated, no spaces.)
|
|
714
730
|
--binary-location=PATH # (Set path of the Chromium browser binary to use.)
|
|
715
731
|
--driver-version=VER # (Set the chromedriver or uc_driver version to use.)
|
|
716
732
|
--sjw # (Skip JS Waits for readyState to be "complete" or Angular to load.)
|
|
733
|
+
--wfa # (Wait for AngularJS to be done loading after specific web actions.)
|
|
717
734
|
--pls=PLS # (Set pageLoadStrategy on Chrome: "normal", "eager", or "none".)
|
|
718
|
-
--headless # (
|
|
719
|
-
--
|
|
735
|
+
--headless # (The default headless mode. Linux uses this mode by default.)
|
|
736
|
+
--headless1 # (Use Chrome's old headless mode. Fast, but has limitations.)
|
|
737
|
+
--headless2 # (Use Chrome's new headless mode, which supports extensions.)
|
|
720
738
|
--headed # (Run tests in headed/GUI mode on Linux OS, where not default.)
|
|
721
739
|
--xvfb # (Run tests using the Xvfb virtual display server on Linux OS.)
|
|
740
|
+
--xvfb-metrics=STRING # (Set Xvfb display size on Linux: "Width,Height".)
|
|
722
741
|
--locale=LOCALE_CODE # (Set the Language Locale Code for the web browser.)
|
|
723
742
|
--interval=SECONDS # (The autoplay interval for presentations & tour steps)
|
|
724
743
|
--start-page=URL # (The starting URL for the web browser when tests begin.)
|
|
@@ -736,10 +755,12 @@ pytest test_coffee_cart.py --trace
|
|
|
736
755
|
--block-images # (Block images from loading during tests.)
|
|
737
756
|
--do-not-track # (Indicate to websites that you don't want to be tracked.)
|
|
738
757
|
--verify-delay=SECONDS # (The delay before MasterQA verification checks.)
|
|
758
|
+
--ee | --esc-end # (Lets the user end the current test via the ESC key.)
|
|
739
759
|
--recorder # (Enables the Recorder for turning browser actions into code.)
|
|
740
760
|
--rec-behave # (Same as Recorder Mode, but also generates behave-gherkin.)
|
|
741
761
|
--rec-sleep # (If the Recorder is enabled, also records self.sleep calls.)
|
|
742
762
|
--rec-print # (If the Recorder is enabled, prints output after tests end.)
|
|
763
|
+
--disable-cookies # (Disable Cookies on websites. Pages might break!)
|
|
743
764
|
--disable-js # (Disable JavaScript on websites. Pages might break!)
|
|
744
765
|
--disable-csp # (Disable the Content Security Policy of websites.)
|
|
745
766
|
--disable-ws # (Disable Web Security on Chromium-based browsers.)
|
|
@@ -762,6 +783,7 @@ pytest test_coffee_cart.py --trace
|
|
|
762
783
|
--rcs | --reuse-class-session # (Reuse session for tests in class.)
|
|
763
784
|
--crumbs # (Delete all cookies between tests reusing a session.)
|
|
764
785
|
--disable-beforeunload # (Disable the "beforeunload" event on Chrome.)
|
|
786
|
+
--window-position=X,Y # (Set the browser's starting window position.)
|
|
765
787
|
--window-size=WIDTH,HEIGHT # (Set the browser's starting window size.)
|
|
766
788
|
--maximize # (Start tests with the browser window maximized.)
|
|
767
789
|
--screenshot # (Save a screenshot at the end of each test.)
|
|
@@ -874,7 +896,7 @@ You can run it from the ``examples/`` folder like this:
|
|
|
874
896
|
pytest test_fail.py
|
|
875
897
|
```
|
|
876
898
|
|
|
877
|
-
🔵 You'll notice that a logs folder,
|
|
899
|
+
🔵 You'll notice that a logs folder, ``./latest_logs/``, was created to hold information (and screenshots) about the failing test. During test runs, past results get moved to the archived_logs folder if you have ARCHIVE_EXISTING_LOGS set to True in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py), or if your run tests with ``--archive-logs``. If you choose not to archive existing logs, they will be deleted and replaced by the logs of the latest test run.
|
|
878
900
|
|
|
879
901
|
--------
|
|
880
902
|
|
|
@@ -900,17 +922,17 @@ python -m http.server 1948
|
|
|
900
922
|
🔵 Here's a full example of what the SeleniumBase Dashboard may look like:
|
|
901
923
|
|
|
902
924
|
```bash
|
|
903
|
-
pytest test_suite.py --dashboard --rs --headless
|
|
925
|
+
pytest test_suite.py test_image_saving.py --dashboard --rs --headless
|
|
904
926
|
```
|
|
905
927
|
|
|
906
|
-
<img src="https://seleniumbase.github.io/cdn/img/dashboard_2.png" alt="The SeleniumBase Dashboard" title="The SeleniumBase Dashboard" width="
|
|
928
|
+
<img src="https://seleniumbase.github.io/cdn/img/dashboard_2.png" alt="The SeleniumBase Dashboard" title="The SeleniumBase Dashboard" width="520" />
|
|
907
929
|
|
|
908
930
|
--------
|
|
909
931
|
|
|
910
932
|
<a id="creating_visual_reports"></a>
|
|
911
933
|
<h2><img src="https://seleniumbase.github.io/img/logo7.png" title="SeleniumBase" width="32" /> Generating Test Reports:</h2>
|
|
912
934
|
|
|
913
|
-
<h3>🔵
|
|
935
|
+
<h3>🔵 <code>pytest</code> HTML Reports:</h3>
|
|
914
936
|
|
|
915
937
|
✅ Using ``--html=report.html`` gives you a fancy report of the name specified after your test suite completes.
|
|
916
938
|
|
|
@@ -930,7 +952,7 @@ pytest test_suite.py --dashboard --html=report.html
|
|
|
930
952
|
|
|
931
953
|
<img src="https://seleniumbase.github.io/cdn/img/dash_report.jpg" alt="Dashboard Pytest HTML Report" title="Dashboard Pytest HTML Report" width="520" />
|
|
932
954
|
|
|
933
|
-
If viewing pytest html reports in [Jenkins](https://www.jenkins.io/), you may need to [configure Jenkins settings](https://stackoverflow.com/a/46197356) for the html to render correctly. This is due to [Jenkins CSP changes](https://www.jenkins.io/doc/book/system-administration/security/configuring-content-security-policy/).
|
|
955
|
+
If viewing pytest html reports in [Jenkins](https://www.jenkins.io/), you may need to [configure Jenkins settings](https://stackoverflow.com/a/46197356/7058266) for the html to render correctly. This is due to [Jenkins CSP changes](https://www.jenkins.io/doc/book/system-administration/security/configuring-content-security-policy/).
|
|
934
956
|
|
|
935
957
|
You can also use ``--junit-xml=report.xml`` to get an xml report instead. Jenkins can use this file to display better reporting for your tests.
|
|
936
958
|
|
|
@@ -938,7 +960,7 @@ You can also use ``--junit-xml=report.xml`` to get an xml report instead. Jenkin
|
|
|
938
960
|
pytest test_suite.py --junit-xml=report.xml
|
|
939
961
|
```
|
|
940
962
|
|
|
941
|
-
<h3>🔵 pynose Reports:</h3>
|
|
963
|
+
<h3>🔵 <code>pynose</code> Reports:</h3>
|
|
942
964
|
|
|
943
965
|
The ``--report`` option gives you a fancy report after your test suite completes.
|
|
944
966
|
|
|
@@ -950,7 +972,7 @@ pynose test_suite.py --report
|
|
|
950
972
|
|
|
951
973
|
(NOTE: You can add ``--show-report`` to immediately display pynose reports after the test suite completes. Only use ``--show-report`` when running tests locally because it pauses the test run.)
|
|
952
974
|
|
|
953
|
-
<h3>🔵
|
|
975
|
+
<h3>🔵 <code>behave</code> Dashboard & Reports:</h3>
|
|
954
976
|
|
|
955
977
|
(The [behave_bdd/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/behave_bdd) folder can be found in the [examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder.)
|
|
956
978
|
|
|
@@ -958,7 +980,7 @@ pynose test_suite.py --report
|
|
|
958
980
|
behave behave_bdd/features/ -D dashboard -D headless
|
|
959
981
|
```
|
|
960
982
|
|
|
961
|
-
<img src="https://seleniumbase.github.io/cdn/img/sb_behave_dashboard.png" title="SeleniumBase" width="
|
|
983
|
+
<img src="https://seleniumbase.github.io/cdn/img/sb_behave_dashboard.png" title="SeleniumBase" width="520">
|
|
962
984
|
|
|
963
985
|
You can also use ``--junit`` to get ``.xml`` reports for each <code translate="no">behave</code> feature. Jenkins can use these files to display better reporting for your tests.
|
|
964
986
|
|
|
@@ -968,7 +990,7 @@ behave behave_bdd/features/ --junit -D rs -D headless
|
|
|
968
990
|
|
|
969
991
|
<h3>🔵 Allure Reports:</h3>
|
|
970
992
|
|
|
971
|
-
See: [https://
|
|
993
|
+
See: [https://allurereport.org/docs/pytest/](https://allurereport.org/docs/pytest/)
|
|
972
994
|
|
|
973
995
|
SeleniumBase no longer includes ``allure-pytest`` as part of installed dependencies. If you want to use it, install it first:
|
|
974
996
|
|
|
@@ -1022,7 +1044,7 @@ pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1
|
|
|
1022
1044
|
```
|
|
1023
1045
|
|
|
1024
1046
|
|
|
1025
|
-
<h3><img src="https://seleniumbase.github.io/img/logo7.png" title="SeleniumBase" width="32" /> Handling Pop-Up
|
|
1047
|
+
<h3><img src="https://seleniumbase.github.io/img/logo7.png" title="SeleniumBase" width="32" /> Handling Pop-Up Alerts:</h3>
|
|
1026
1048
|
|
|
1027
1049
|
🔵 <code translate="no">self.accept_alert()</code> automatically waits for and accepts alert pop-ups. <code translate="no">self.dismiss_alert()</code> automatically waits for and dismisses alert pop-ups. On occasion, some methods like <code translate="no">self.click(SELECTOR)</code> might dismiss a pop-up on its own because they call JavaScript to make sure that the <code translate="no">readyState</code> of the page is <code translate="no">complete</code> before advancing. If you're trying to accept a pop-up that got dismissed this way, use this workaround: Call <code translate="no">self.find_element(SELECTOR).click()</code> instead, (which will let the pop-up remain on the screen), and then use <code translate="no">self.accept_alert()</code> to accept the pop-up (<a href="https://github.com/seleniumbase/SeleniumBase/issues/600#issuecomment-647270426">more on that here</a>). If pop-ups are intermittent, wrap code in a try/except block.
|
|
1028
1050
|
|
|
@@ -1362,22 +1384,24 @@ self.click("a.analytics") # Clicks the generated button
|
|
|
1362
1384
|
|
|
1363
1385
|
<h3>🔵 How to use deferred asserts:</h3>
|
|
1364
1386
|
|
|
1365
|
-
<p>Let's say you want to verify multiple different elements on a web page in a single test, but you don't want the test to fail until you verified several elements at once so that you don't have to rerun the test to find more missing elements on the same page. That's where deferred asserts come in. Here's
|
|
1387
|
+
<p>Let's say you want to verify multiple different elements on a web page in a single test, but you don't want the test to fail until you verified several elements at once so that you don't have to rerun the test to find more missing elements on the same page. That's where deferred asserts come in. Here's an example:</p>
|
|
1366
1388
|
|
|
1367
1389
|
```python
|
|
1368
1390
|
from seleniumbase import BaseCase
|
|
1369
1391
|
BaseCase.main(__name__, __file__)
|
|
1370
1392
|
|
|
1371
|
-
class
|
|
1393
|
+
class DeferredAssertTests(BaseCase):
|
|
1372
1394
|
def test_deferred_asserts(self):
|
|
1373
|
-
self.open(
|
|
1374
|
-
self.wait_for_element(
|
|
1395
|
+
self.open("https://xkcd.com/993/")
|
|
1396
|
+
self.wait_for_element("#comic")
|
|
1375
1397
|
self.deferred_assert_element('img[alt="Brand Identity"]')
|
|
1376
1398
|
self.deferred_assert_element('img[alt="Rocket Ship"]') # Will Fail
|
|
1377
|
-
self.deferred_assert_element(
|
|
1378
|
-
self.deferred_assert_text(
|
|
1379
|
-
self.deferred_assert_text(
|
|
1399
|
+
self.deferred_assert_element("#comicmap")
|
|
1400
|
+
self.deferred_assert_text("Fake Item", "ul.comicNav") # Will Fail
|
|
1401
|
+
self.deferred_assert_text("Random", "ul.comicNav")
|
|
1380
1402
|
self.deferred_assert_element('a[name="Super Fake !!!"]') # Will Fail
|
|
1403
|
+
self.deferred_assert_exact_text("Brand Identity", "#ctitle")
|
|
1404
|
+
self.deferred_assert_exact_text("Fake Food", "#comic") # Will Fail
|
|
1381
1405
|
self.process_deferred_asserts()
|
|
1382
1406
|
```
|
|
1383
1407
|
|
|
@@ -1418,26 +1442,25 @@ pytest --reruns=1 --reruns-delay=1
|
|
|
1418
1442
|
|
|
1419
1443
|
<p>
|
|
1420
1444
|
<div><b>If you see something, say something!</b></div>
|
|
1421
|
-
<div><a href="https://github.com/seleniumbase/SeleniumBase/issues?q=is%3Aissue+is%3Aclosed"><img src="https://img.shields.io/github/issues-closed-raw/seleniumbase/SeleniumBase.svg?color=22BB88" title="Closed Issues" /></a>
|
|
1445
|
+
<div><a href="https://github.com/seleniumbase/SeleniumBase/issues?q=is%3Aissue+is%3Aclosed"><img src="https://img.shields.io/github/issues-closed-raw/seleniumbase/SeleniumBase.svg?color=22BB88" title="Closed Issues" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/pulls?q=is%3Apr+is%3Aclosed"><img src="https://img.shields.io/github/issues-pr-closed/seleniumbase/SeleniumBase.svg?logo=github&logoColor=white&color=22BB99" title="Closed Pull Requests" /></a></div>
|
|
1422
1446
|
</p>
|
|
1423
1447
|
|
|
1424
|
-
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_10t.png" alt="SeleniumBase" title="SeleniumBase" width="
|
|
1448
|
+
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_10t.png" alt="SeleniumBase" title="SeleniumBase" width="274" /></a></p>
|
|
1449
|
+
|
|
1450
|
+
<a href="https://pypi.org/project/seleniumbase/" target="_blank"><img src="https://img.shields.io/pypi/pyversions/seleniumbase.svg?color=22AAEE&logo=python&logoColor=FEDC54" title="Supported Python Versions" /></a>
|
|
1425
1451
|
|
|
1426
1452
|
<p><div>
|
|
1427
|
-
<span><a href="https://www.youtube.com/playlist?list=PLp9uKicxkBc5UIlGi2BuE3aWC7JyXpD3m"><img src="https://seleniumbase.github.io/cdn/img/youtube.png" title="SeleniumBase Playlist on YouTube" alt="SeleniumBase Playlist on YouTube" width="
|
|
1428
|
-
<span><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.github.io/img/social/share_github.svg" title="SeleniumBase on GitHub" alt="SeleniumBase on GitHub" width="
|
|
1429
|
-
<span><a href="https://
|
|
1430
|
-
<span><a href="https://
|
|
1453
|
+
<span><a href="https://www.youtube.com/playlist?list=PLp9uKicxkBc5UIlGi2BuE3aWC7JyXpD3m"><img src="https://seleniumbase.github.io/cdn/img/youtube.png" title="SeleniumBase Playlist on YouTube" alt="SeleniumBase Playlist on YouTube" width="70" /></a></span>
|
|
1454
|
+
<span><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.github.io/img/social/share_github.svg" title="SeleniumBase on GitHub" alt="SeleniumBase on GitHub" width="64" /></a></span>
|
|
1455
|
+
<span><a href="https://discord.gg/EdhQTn3EyE"><img src="https://seleniumbase.github.io/other/discord_icon.png" title="SeleniumBase on Discord" alt="SeleniumBase on Discord" width="66" /></a></span>
|
|
1456
|
+
<span><a href="https://www.facebook.com/SeleniumBase"><img src="https://seleniumbase.io/img/social/share_facebook.svg" title="SeleniumBase on Facebook" alt="SeleniumBase on Facebook" width="62" /></a></span>
|
|
1431
1457
|
</div></p>
|
|
1432
1458
|
|
|
1433
1459
|
<p><div><b><a href="https://github.com/mdmintz">https://github.com/mdmintz</a></b></div></p>
|
|
1434
1460
|
|
|
1435
|
-
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/
|
|
1436
|
-
<div><a href="https://
|
|
1437
|
-
<div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://
|
|
1438
|
-
<div><a href="https://
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
<p><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb.png" alt="SeleniumBase" title="SeleniumBase" width="300" /></a></p>
|
|
1443
|
-
<p><a href="https://pypi.org/project/seleniumbase/" target="_blank"><img src="https://img.shields.io/pypi/pyversions/seleniumbase.svg?color=22AAEE&logo=python&logoColor=FEDC54" title="Supported Python Versions" /></a></p>
|
|
1461
|
+
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb3.png" title="SeleniumBase" width="274" /></a></div>
|
|
1462
|
+
<div><a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-22BBCC.svg" title="SeleniumBase" /></a></div>
|
|
1463
|
+
<div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://img.shields.io/badge/tested%20with-SeleniumBase-04C38E.svg" alt="Tested with SeleniumBase" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/stargazers"><img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg?color=19A57B" title="Stargazers" /></a></div>
|
|
1464
|
+
<div><a href="https://hellogithub.com/repository/c6be2d0f1969448697683d11a4ff915e" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=c6be2d0f1969448697683d11a4ff915e&claim_uid=xcrm4p9j3d6JCO5&theme=small" alt="Featured|HelloGitHub" /></a> <a href="https://discord.gg/EdhQTn3EyE" target="_blank"><img src="https://img.shields.io/badge/join-discord-infomational" alt="Join the SeleniumBase chat on Discord"/></a> <a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://img.shields.io/gitter/room/seleniumbase/SeleniumBase.svg" alt="Gitter chat"/></a></div>
|
|
1465
|
+
<div><a href="https://pepy.tech/project/seleniumbase" target="_blank"><img src="https://static.pepy.tech/badge/seleniumbase" alt="SeleniumBase PyPI downloads" /></a> <img src="https://views.whatilearened.today/views/github/seleniumbase/SeleniumBase.svg" width="98px" height="20px" alt="Views" /></div>
|
|
1466
|
+
<div align="left"></div>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
pytest_seleniumbase-4.44.8.dist-info/METADATA,sha256=08nTjfyKf8WwM6KvXjbQOSOLC17WKuhn6HreAItTD2o,80834
|
|
2
|
+
pytest_seleniumbase-4.44.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
3
|
+
pytest_seleniumbase-4.44.8.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
4
|
+
pytest_seleniumbase-4.44.8.dist-info/RECORD,,
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
pytest_seleniumbase-4.22.3.dist-info/METADATA,sha256=1rZX7Ce24VLqPy2bnS0R56cWeQn1TuuEBaljbkHKWNw,78903
|
|
2
|
-
pytest_seleniumbase-4.22.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
3
|
-
pytest_seleniumbase-4.22.3.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
4
|
-
pytest_seleniumbase-4.22.3.dist-info/RECORD,,
|
|
File without changes
|