pytest-seleniumbase 4.29.0__tar.gz → 4.34.3__tar.gz
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.
- {pytest_seleniumbase-4.29.0 → pytest_seleniumbase-4.34.3}/PKG-INFO +176 -141
- {pytest_seleniumbase-4.29.0 → pytest_seleniumbase-4.34.3}/README.md +153 -135
- pytest_seleniumbase-4.34.3/pyproject.toml +31 -0
- {pytest_seleniumbase-4.29.0 → pytest_seleniumbase-4.34.3}/pytest_seleniumbase.egg-info/PKG-INFO +176 -141
- {pytest_seleniumbase-4.29.0 → pytest_seleniumbase-4.34.3}/pytest_seleniumbase.egg-info/SOURCES.txt +1 -0
- pytest_seleniumbase-4.34.3/pytest_seleniumbase.egg-info/requires.txt +1 -0
- {pytest_seleniumbase-4.29.0 → pytest_seleniumbase-4.34.3}/setup.py +4 -5
- pytest_seleniumbase-4.29.0/pytest_seleniumbase.egg-info/requires.txt +0 -1
- {pytest_seleniumbase-4.29.0 → pytest_seleniumbase-4.34.3}/pytest_seleniumbase.egg-info/dependency_links.txt +0 -0
- {pytest_seleniumbase-4.29.0 → pytest_seleniumbase-4.34.3}/pytest_seleniumbase.egg-info/top_level.txt +0 -0
- {pytest_seleniumbase-4.29.0 → pytest_seleniumbase-4.34.3}/setup.cfg +0 -0
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: pytest-seleniumbase
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.34.3
|
|
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
|
|
@@ -31,7 +33,6 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
|
31
33
|
Classifier: Operating System :: POSIX :: Linux
|
|
32
34
|
Classifier: Programming Language :: Python
|
|
33
35
|
Classifier: Programming Language :: Python :: 3
|
|
34
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
35
36
|
Classifier: Programming Language :: Python :: 3.8
|
|
36
37
|
Classifier: Programming Language :: Python :: 3.9
|
|
37
38
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -49,15 +50,31 @@ Classifier: Topic :: Software Development :: Testing
|
|
|
49
50
|
Classifier: Topic :: Software Development :: Testing :: Acceptance
|
|
50
51
|
Classifier: Topic :: Software Development :: Testing :: Traffic Generation
|
|
51
52
|
Classifier: Topic :: Utilities
|
|
52
|
-
Requires-Python: >=3.
|
|
53
|
+
Requires-Python: >=3.8
|
|
53
54
|
Description-Content-Type: text/markdown
|
|
54
|
-
Requires-Dist: seleniumbase>=4.
|
|
55
|
+
Requires-Dist: seleniumbase>=4.34.3
|
|
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
|
|
55
66
|
|
|
56
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)**
|
|
57
68
|
****
|
|
58
69
|
|
|
59
70
|
<!-- SeleniumBase Docs -->
|
|
60
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" />
|
|
61
78
|
|
|
62
79
|
<h1>SeleniumBase</h1>
|
|
63
80
|
|
|
@@ -66,35 +83,35 @@ Requires-Dist: seleniumbase>=4.29.0
|
|
|
66
83
|
|
|
67
84
|
<p align="center" class="hero__title"><b>All-in-one Browser Automation Framework:<br />Web Crawling / Testing / Scraping / Stealth</b></p>
|
|
68
85
|
|
|
69
|
-
<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>
|
|
70
87
|
|
|
71
88
|
<p align="center">
|
|
72
89
|
<a href="#python_installation">🚀 Start</a> |
|
|
73
90
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/features_list.md">🏰 Features</a> |
|
|
74
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">📚 Examples</a> |
|
|
75
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> |
|
|
76
93
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md">🌠 Scripts</a> |
|
|
77
94
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md">📱 Mobile</a>
|
|
78
95
|
<br />
|
|
79
96
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">📘 APIs</a> |
|
|
80
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md">
|
|
81
|
-
<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> |
|
|
82
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> |
|
|
83
100
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/locale_codes.md">🗾 Locales</a> |
|
|
84
|
-
<a href="https://
|
|
101
|
+
<a href="https://seleniumbase.io/devices/?url=seleniumbase.com">💻 Farm</a>
|
|
85
102
|
<br />
|
|
86
103
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/commander.md">🎖️ GUI</a> |
|
|
87
104
|
<a href="https://seleniumbase.io/demo_page">📰 TestPage</a> |
|
|
88
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/case_plans.md">🗂️ CasePlans</a> |
|
|
89
105
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md">👤 UC Mode</a> |
|
|
90
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/
|
|
91
|
-
<a href="https://
|
|
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>
|
|
92
109
|
<br />
|
|
93
110
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/how_it_works.md">👁️ How</a> |
|
|
94
111
|
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/migration/raw_selenium">🚝 Migrate</a> |
|
|
95
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/
|
|
96
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/
|
|
97
|
-
<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> |
|
|
98
115
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">🚎 Tours</a>
|
|
99
116
|
<br />
|
|
100
117
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/github/workflows/ReadMe.md">🤖 CI/CD</a> |
|
|
@@ -106,23 +123,82 @@ Requires-Dist: seleniumbase>=4.29.0
|
|
|
106
123
|
<br />
|
|
107
124
|
</p>
|
|
108
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
|
+
|
|
109
128
|
--------
|
|
110
129
|
|
|
111
130
|
📚 Learn from [**over 200 examples** in the **SeleniumBase/examples/** folder](https://github.com/seleniumbase/SeleniumBase/tree/master/examples).
|
|
112
131
|
|
|
113
|
-
|
|
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.
|
|
114
133
|
|
|
115
|
-
ℹ️
|
|
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).
|
|
116
135
|
|
|
117
|
-
|
|
136
|
+
--------
|
|
118
137
|
|
|
119
|
-
|
|
120
|
-
|
|
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>
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
from seleniumbase import SB
|
|
142
|
+
|
|
143
|
+
with SB(test=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())
|
|
121
149
|
```
|
|
122
150
|
|
|
123
|
-
|
|
151
|
+
> `python raw_google.py`
|
|
124
152
|
|
|
125
|
-
|
|
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_code="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>
|
|
200
|
+
|
|
201
|
+
> (The default browser is ``--chrome`` if not set.)
|
|
126
202
|
|
|
127
203
|
--------
|
|
128
204
|
|
|
@@ -132,7 +208,7 @@ pytest my_first_test.py
|
|
|
132
208
|
pytest test_coffee_cart.py --demo
|
|
133
209
|
```
|
|
134
210
|
|
|
135
|
-
<p align="left"><a href="https://seleniumbase.io/coffee/" target="_blank"><img src="https://seleniumbase.github.io/cdn/gif/coffee_cart.gif" width="
|
|
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>
|
|
136
212
|
|
|
137
213
|
> <p>(<code translate="no">--demo</code> mode slows down tests and highlights actions)</p>
|
|
138
214
|
|
|
@@ -146,7 +222,7 @@ pytest test_coffee_cart.py --demo
|
|
|
146
222
|
pytest test_demo_site.py
|
|
147
223
|
```
|
|
148
224
|
|
|
149
|
-
<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="
|
|
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>
|
|
150
226
|
|
|
151
227
|
> Easy to type, click, select, toggle, drag & drop, and more.
|
|
152
228
|
|
|
@@ -216,7 +292,7 @@ With raw Selenium, that requires more code:<br />
|
|
|
216
292
|
|
|
217
293
|
<p>📚 <b>Learn about different ways of writing tests:</b></p>
|
|
218
294
|
|
|
219
|
-
<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>
|
|
220
296
|
|
|
221
297
|
```python
|
|
222
298
|
from seleniumbase import BaseCase
|
|
@@ -235,22 +311,7 @@ class TestSimpleLogin(BaseCase):
|
|
|
235
311
|
self.assert_text("signed out", "#top_message")
|
|
236
312
|
```
|
|
237
313
|
|
|
238
|
-
<p align="left"
|
|
239
|
-
|
|
240
|
-
```python
|
|
241
|
-
def test_sb_fixture_with_no_class(sb):
|
|
242
|
-
sb.open("seleniumbase.io/simple/login")
|
|
243
|
-
sb.type("#username", "demo_user")
|
|
244
|
-
sb.type("#password", "secret_pass")
|
|
245
|
-
sb.click('a:contains("Sign in")')
|
|
246
|
-
sb.assert_exact_text("Welcome!", "h1")
|
|
247
|
-
sb.assert_element("img#image1")
|
|
248
|
-
sb.highlight("#image1")
|
|
249
|
-
sb.click_link("Sign out")
|
|
250
|
-
sb.assert_text("signed out", "#top_message")
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
<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>
|
|
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>
|
|
254
315
|
|
|
255
316
|
```python
|
|
256
317
|
from seleniumbase import SB
|
|
@@ -267,24 +328,7 @@ with SB() as sb:
|
|
|
267
328
|
sb.assert_text("signed out", "#top_message")
|
|
268
329
|
```
|
|
269
330
|
|
|
270
|
-
<p align="left"
|
|
271
|
-
|
|
272
|
-
```python
|
|
273
|
-
from seleniumbase import DriverContext
|
|
274
|
-
|
|
275
|
-
with DriverContext() as driver:
|
|
276
|
-
driver.open("seleniumbase.io/simple/login")
|
|
277
|
-
driver.type("#username", "demo_user")
|
|
278
|
-
driver.type("#password", "secret_pass")
|
|
279
|
-
driver.click('a:contains("Sign in")')
|
|
280
|
-
driver.assert_exact_text("Welcome!", "h1")
|
|
281
|
-
driver.assert_element("img#image1")
|
|
282
|
-
driver.highlight("#image1")
|
|
283
|
-
driver.click_link("Sign out")
|
|
284
|
-
driver.assert_text("signed out", "#top_message")
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
<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>
|
|
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>
|
|
288
332
|
|
|
289
333
|
```python
|
|
290
334
|
from seleniumbase import Driver
|
|
@@ -304,23 +348,6 @@ finally:
|
|
|
304
348
|
driver.quit()
|
|
305
349
|
```
|
|
306
350
|
|
|
307
|
-
<p align="left">📕📝 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/features/login_app.feature">login_app.feature</a>, which uses <a translate="no" href="https://behave.readthedocs.io/en/stable/gherkin.html#features" target="_blank">behave-BDD Gherkin</a> syntax. Runs with <code translate="no">behave</code>. (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/ReadMe.md">Learn about the <b>SeleniumBase behave-BDD</b> integration</a>)</p>
|
|
308
|
-
|
|
309
|
-
```gherkin
|
|
310
|
-
Feature: SeleniumBase scenarios for the Simple App
|
|
311
|
-
|
|
312
|
-
Scenario: Verify the Simple App (Login / Logout)
|
|
313
|
-
Given Open "seleniumbase.io/simple/login"
|
|
314
|
-
And Type "demo_user" into "#username"
|
|
315
|
-
And Type "secret_pass" into "#password"
|
|
316
|
-
And Click 'a:contains("Sign in")'
|
|
317
|
-
And Assert exact text "Welcome!" in "h1"
|
|
318
|
-
And Assert element "img#image1"
|
|
319
|
-
And Highlight "#image1"
|
|
320
|
-
And Click link "Sign out"
|
|
321
|
-
And Assert text "signed out" in "#top_message"
|
|
322
|
-
```
|
|
323
|
-
|
|
324
351
|
--------
|
|
325
352
|
|
|
326
353
|
<a id="python_installation"></a>
|
|
@@ -365,48 +392,49 @@ pip install -e .
|
|
|
365
392
|
🔵 **Type ``seleniumbase`` or ``sbase`` to verify that SeleniumBase was installed successfully:**
|
|
366
393
|
|
|
367
394
|
```bash
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
COMMANDS:
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
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
|
+
╰──────────────────────────────────────────────────╯
|
|
410
438
|
```
|
|
411
439
|
|
|
412
440
|
<h3>🔵 Downloading webdrivers:</h3>
|
|
@@ -418,20 +446,21 @@ COMMANDS:
|
|
|
418
446
|
<summary> ▶️ Here's sample output from a chromedriver download. (<b>click to expand</b>)</summary>
|
|
419
447
|
|
|
420
448
|
```bash
|
|
421
|
-
*** chromedriver to download =
|
|
449
|
+
*** chromedriver to download = 131.0.6778.108 (Latest Stable)
|
|
422
450
|
|
|
423
451
|
Downloading chromedriver-mac-arm64.zip from:
|
|
424
|
-
https://storage.googleapis.com/chrome-for-testing-public/
|
|
452
|
+
https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.108/mac-arm64/chromedriver-mac-arm64.zip ...
|
|
425
453
|
Download Complete!
|
|
426
454
|
|
|
427
455
|
Extracting ['chromedriver'] from chromedriver-mac-arm64.zip ...
|
|
428
456
|
Unzip Complete!
|
|
429
457
|
|
|
430
458
|
The file [chromedriver] was saved to:
|
|
431
|
-
|
|
459
|
+
~/github/SeleniumBase/seleniumbase/drivers/
|
|
460
|
+
chromedriver
|
|
432
461
|
|
|
433
|
-
Making [chromedriver
|
|
434
|
-
[chromedriver
|
|
462
|
+
Making [chromedriver 131.0.6778.108] executable ...
|
|
463
|
+
[chromedriver 131.0.6778.108] is now ready for use!
|
|
435
464
|
```
|
|
436
465
|
|
|
437
466
|
</details>
|
|
@@ -449,9 +478,9 @@ cd examples/
|
|
|
449
478
|
pytest my_first_test.py
|
|
450
479
|
```
|
|
451
480
|
|
|
452
|
-
<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="
|
|
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>
|
|
453
482
|
|
|
454
|
-
<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>
|
|
455
484
|
|
|
456
485
|
```python
|
|
457
486
|
from seleniumbase import BaseCase
|
|
@@ -701,11 +730,14 @@ pytest test_coffee_cart.py --trace
|
|
|
701
730
|
--binary-location=PATH # (Set path of the Chromium browser binary to use.)
|
|
702
731
|
--driver-version=VER # (Set the chromedriver or uc_driver version to use.)
|
|
703
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.)
|
|
704
734
|
--pls=PLS # (Set pageLoadStrategy on Chrome: "normal", "eager", or "none".)
|
|
705
|
-
--headless # (
|
|
706
|
-
--
|
|
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.)
|
|
707
738
|
--headed # (Run tests in headed/GUI mode on Linux OS, where not default.)
|
|
708
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".)
|
|
709
741
|
--locale=LOCALE_CODE # (Set the Language Locale Code for the web browser.)
|
|
710
742
|
--interval=SECONDS # (The autoplay interval for presentations & tour steps)
|
|
711
743
|
--start-page=URL # (The starting URL for the web browser when tests begin.)
|
|
@@ -728,6 +760,7 @@ pytest test_coffee_cart.py --trace
|
|
|
728
760
|
--rec-behave # (Same as Recorder Mode, but also generates behave-gherkin.)
|
|
729
761
|
--rec-sleep # (If the Recorder is enabled, also records self.sleep calls.)
|
|
730
762
|
--rec-print # (If the Recorder is enabled, prints output after tests end.)
|
|
763
|
+
--disable-cookies # (Disable Cookies on websites. Pages might break!)
|
|
731
764
|
--disable-js # (Disable JavaScript on websites. Pages might break!)
|
|
732
765
|
--disable-csp # (Disable the Content Security Policy of websites.)
|
|
733
766
|
--disable-ws # (Disable Web Security on Chromium-based browsers.)
|
|
@@ -750,6 +783,7 @@ pytest test_coffee_cart.py --trace
|
|
|
750
783
|
--rcs | --reuse-class-session # (Reuse session for tests in class.)
|
|
751
784
|
--crumbs # (Delete all cookies between tests reusing a session.)
|
|
752
785
|
--disable-beforeunload # (Disable the "beforeunload" event on Chrome.)
|
|
786
|
+
--window-position=X,Y # (Set the browser's starting window position.)
|
|
753
787
|
--window-size=WIDTH,HEIGHT # (Set the browser's starting window size.)
|
|
754
788
|
--maximize # (Start tests with the browser window maximized.)
|
|
755
789
|
--screenshot # (Save a screenshot at the end of each test.)
|
|
@@ -862,7 +896,7 @@ You can run it from the ``examples/`` folder like this:
|
|
|
862
896
|
pytest test_fail.py
|
|
863
897
|
```
|
|
864
898
|
|
|
865
|
-
🔵 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.
|
|
866
900
|
|
|
867
901
|
--------
|
|
868
902
|
|
|
@@ -918,7 +952,7 @@ pytest test_suite.py --dashboard --html=report.html
|
|
|
918
952
|
|
|
919
953
|
<img src="https://seleniumbase.github.io/cdn/img/dash_report.jpg" alt="Dashboard Pytest HTML Report" title="Dashboard Pytest HTML Report" width="520" />
|
|
920
954
|
|
|
921
|
-
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/).
|
|
922
956
|
|
|
923
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.
|
|
924
958
|
|
|
@@ -1411,21 +1445,22 @@ pytest --reruns=1 --reruns-delay=1
|
|
|
1411
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>
|
|
1412
1446
|
</p>
|
|
1413
1447
|
|
|
1414
|
-
<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>
|
|
1415
1449
|
|
|
1416
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>
|
|
1417
1451
|
|
|
1418
1452
|
<p><div>
|
|
1419
|
-
<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="
|
|
1420
|
-
<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="
|
|
1421
|
-
<span><a href="https://
|
|
1422
|
-
<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>
|
|
1423
1457
|
</div></p>
|
|
1424
1458
|
|
|
1425
1459
|
<p><div><b><a href="https://github.com/mdmintz">https://github.com/mdmintz</a></b></div></p>
|
|
1426
1460
|
|
|
1427
|
-
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb3.png" title="SeleniumBase" width="
|
|
1428
|
-
<div><a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a
|
|
1429
|
-
<div><a href="https://
|
|
1430
|
-
<div><a href="https://
|
|
1431
|
-
<div
|
|
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>
|