SeleniumBase/help_docs/demo_mode.md

57 lines
2.5 KiB
Markdown

<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Demo Mode 🎦
<p align="left"><img src="https://seleniumbase.github.io/cdn/gif/xkcd_vid.gif" width="480" alt="SeleniumBase Example" title="SeleniumBase Example" /></p>
<p align="left">🔵 <b translate="no">Demo Mode</b> helps you see what a test is doing.</p>
<p align="left">🏇💨 👀 If a test runs too fast for your eyes, use <b translate="no">Demo Mode</b> to slow it down, highlight actions, and display assertions. Example usage:</p>
```bash
cd examples/
pytest test_coffee_cart.py --demo
```
<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>
> <p>(<code translate="no">--demo</code> mode slows down tests and highlights actions)</p>
--------
Another example:
```bash
pytest my_first_test.py --demo
```
--------
<p align="left">Here's how to run <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_swag_labs.py" target="_blank">test_swag_labs.py</a> from <a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples" target="_blank">examples/</a> in <b>Demo Mode</b>:</p>
```bash
pytest test_swag_labs.py --demo
```
<p align="left"><a href="https://www.saucedemo.com/" target="_blank"><img src="https://seleniumbase.github.io/cdn/gif/swag_demo_2.gif" width="450" alt="SeleniumBase Example" title="SeleniumBase Example" /></a></p>
--------
<p>Here's an example that only uses the <code translate="no">highlight()</code> method for highlighting browser actions:</p>
<p align="left">(<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_error_page.py" target="_blank">test_error_page.py</a> from <a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples" target="_blank">examples/</a>)</p>
```bash
pytest test_error_page.py
```
<p align="left"><a href="https://seleniumbase.io/error_page/" target="_blank"><img src="https://seleniumbase.github.io/cdn/gif/error_page.gif" width="450" alt="SeleniumBase Example" title="SeleniumBase Example" /></a></p>
--------
Here's an example of a mobile test in <b translate="no">Demo Mode</b>:
<p align="left"><img src="https://seleniumbase.github.io/cdn/gif/skype_mobile_test_2.gif" width="450" alt="SeleniumBase Example" title="SeleniumBase Example" /></p>