Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 52216be

Browse files
authored
Merge pull request #3864 from seleniumbase/upgrades-all-around-2
Upgrades all around
2 parents a56253c + aaa5e80 commit 52216be

38 files changed

+877
-267
lines changed

‎examples/ReadMe.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
Run an [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py): (Default option: ``--chrome``)
2323

24-
```bash
24+
```zsh
2525
pytest my_first_test.py
2626
```
2727

@@ -31,15 +31,15 @@ pytest my_first_test.py
3131

3232
Here's one way of changing the browser to Firefox:
3333

34-
```bash
34+
```zsh
3535
pytest my_first_test.py --firefox
3636
```
3737

3838
--------
3939

4040
Another [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py) for a web page that has lots of different HTML items:
4141

42-
```bash
42+
```zsh
4343
pytest test_demo_site.py
4444
```
4545

@@ -49,7 +49,7 @@ pytest test_demo_site.py
4949

5050
Run an example test in ``--demo`` mode: (highlight assertions)
5151

52-
```bash
52+
```zsh
5353
pytest test_swag_labs.py --demo
5454
```
5555

@@ -59,7 +59,7 @@ pytest test_swag_labs.py --demo
5959

6060
Run [test_coffee_cart.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_coffee_cart.py) to test the [Coffee Cart](https://seleniumbase.io/coffee/) app:
6161

62-
```bash
62+
```zsh
6363
pytest test_coffee_cart.py --demo
6464
```
6565

@@ -69,7 +69,7 @@ pytest test_coffee_cart.py --demo
6969

7070
Run a [Wordle-solver example](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/wordle_test.py):
7171

72-
```bash
72+
```zsh
7373
pytest wordle_test.py
7474
```
7575

@@ -79,15 +79,15 @@ pytest wordle_test.py
7979

8080
Run an example test in ``--headless`` mode: (invisible browser)
8181

82-
```bash
82+
```zsh
8383
pytest my_first_test.py --headless
8484
```
8585

8686
--------
8787

8888
Run an [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_swag_labs.py) using Chrome's mobile device emulator: (default settings)
8989

90-
```bash
90+
```zsh
9191
pytest test_swag_labs.py --mobile
9292
```
9393

@@ -97,7 +97,7 @@ pytest test_swag_labs.py --mobile
9797

9898
Run an [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_xkcd.py) in ``--demo`` mode: (highlight assertions)
9999

100-
```bash
100+
```zsh
101101
pytest test_xkcd.py --demo
102102
```
103103

@@ -107,55 +107,55 @@ pytest test_xkcd.py --demo
107107

108108
Run a [test suite](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_suite.py) with verbose output: (see more details)
109109

110-
```bash
110+
```zsh
111111
pytest test_suite.py -v
112112
```
113113

114114
--------
115115

116116
Run a test suite using multiple parallel processes (``-n=NUM``):
117117

118-
```bash
118+
```zsh
119119
pytest test_suite.py -n=8
120120
```
121121

122122
--------
123123

124124
Run a [parameterized test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/parameterized_test.py): (Generates multiple tests from one)
125125

126-
```bash
126+
```zsh
127127
pytest parameterized_test.py -v
128128
```
129129

130130
--------
131131

132132
Run a test suite and generate a SeleniumBase Dashboard:
133133

134-
```bash
134+
```zsh
135135
pytest test_suite.py --dashboard
136136
```
137137

138138
--------
139139

140140
Run a test suite and generate a ``pytest`` report:
141141

142-
```bash
142+
```zsh
143143
pytest test_suite.py --html=report.html
144144
```
145145

146146
--------
147147

148148
Run a [failing test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_fail.py): (See the ``latest_logs/`` folder for logs and screenshots)
149149

150-
```bash
150+
```zsh
151151
pytest test_fail.py
152152
```
153153

154154
--------
155155

156156
Run a failing test that activates ``pdb`` debug mode on failure:
157157

158-
```bash
158+
```zsh
159159
pytest test_fail.py --pdb -s
160160
```
161161

@@ -165,39 +165,39 @@ pytest test_fail.py --pdb -s
165165

166166
Run a test suite that demonstrates the use of ``pytest`` markers:
167167

168-
```bash
168+
```zsh
169169
pytest -m marker_test_suite -v
170170
```
171171

172172
--------
173173

174174
Run a test suite that reuses the browser session between tests:
175175

176-
```bash
176+
```zsh
177177
pytest test_suite.py --rs
178178
```
179179

180180
--------
181181

182182
Run an [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/rate_limiting_test.py) demonstrating the ``rate_limited`` Python decorator:
183183

184-
```bash
184+
```zsh
185185
pytest rate_limiting_test.py
186186
```
187187

188188
--------
189189

190190
Run an [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/upload_file_test.py) that demonstrates how to upload a file to a website:
191191

192-
```bash
192+
```zsh
193193
pytest upload_file_test.py
194194
```
195195

196196
--------
197197

198198
🎖️ **SeleniumBase Commander** is a GUI for ``pytest``:
199199

200-
```bash
200+
```zsh
201201
sbase gui
202202
```
203203

@@ -207,23 +207,23 @@ sbase gui
207207

208208
<b>SeleniumBase tests can also be run with ``pynose``:</b>
209209

210-
```bash
210+
```zsh
211211
pynose my_first_test.py
212212
```
213213

214214
--------
215215

216216
Run an example test suite and generate a ``pynose`` test report:
217217

218-
```bash
218+
```zsh
219219
pynose test_suite.py --report --show-report
220220
```
221221

222222
--------
223223

224224
Run an example test using a ``pynose`` configuration file:
225225

226-
```bash
226+
```zsh
227227
pynose my_first_test.py --config=example_config.cfg
228228
```
229229

@@ -241,7 +241,7 @@ If you just need to perform some quick website verification on various devices,
241241

242242
To make things easier, here's a **simple GUI program** that allows you to run a few example tests by pressing a button:
243243

244-
```bash
244+
```zsh
245245
python gui_test_runner.py
246246
```
247247

‎examples/cdp_mode/ReadMe.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,10 @@ sb.cdp.wait_for_text_not_visible(text, selector="body", timeout=None)
484484
sb.cdp.wait_for_element_visible(selector, timeout=None)
485485
sb.cdp.wait_for_element_not_visible(selector, timeout=None)
486486
sb.cdp.wait_for_element_absent(selector, timeout=None)
487+
sb.cdp.wait_for_any_of_elements_visible(*args, **kwargs)
488+
sb.cdp.wait_for_any_of_elements_present(*args, **kwargs)
489+
sb.cdp.assert_any_of_elements_visible(*args, **kwargs)
490+
sb.cdp.assert_any_of_elements_present(*args, **kwargs)
487491
sb.cdp.assert_element(selector, timeout=None)
488492
sb.cdp.assert_element_visible(selector, timeout=None)
489493
sb.cdp.assert_element_present(selector, timeout=None)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /