|
2 | 2 |
|
3 | 3 | <h2><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> Mobile Testing</h2>
|
4 | 4 |
|
5 |
| -Use ``--mobile`` to run your SeleniumBase tests using Chromium's mobile device emulator with default values for device metrics (CSS Width, CSS Height, Pixel-Ratio) and user agent. |
| 5 | +Use ``--mobile`` to run your SeleniumBase tests using Chrome's mobile device emulator with default values for Device Metrics and User-Agent. |
| 6 | + |
| 7 | +<b>Here's an example mobile test:</b> |
| 8 | + |
| 9 | +* [SeleniumBase/examples/test_skype_site.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_skype_site.py) |
6 | 10 |
|
7 |
| -To configure the mobile device metrics, use: |
| 11 | +```bash |
| 12 | +pytest test_skype_site.py --mobile |
| 13 | +``` |
| 14 | +[<img src="https://cdn2.hubspot.net/hubfs/100006/images/skype_mobile_test_2.gif" title="SeleniumBase Mobile Testing">](https://cdn2.hubspot.net/hubfs/100006/images/skype_mobile_test_2.gif) |
| 15 | + |
| 16 | +To configure Device Metrics, use: |
8 | 17 | ```bash
|
9 | 18 | --metrics="CSS_Width,CSS_Height,Pixel_Ratio"
|
10 | 19 | ```
|
11 | 20 |
|
12 |
| -To configure the user agent, use: |
| 21 | +To configure the User-Agent, use: |
13 | 22 | ```bash
|
14 | 23 | --agent="USER-AGENT-STRING"
|
15 | 24 | ```
|
16 | 25 |
|
17 |
| -To find real values for device metrics, see: |
| 26 | +To find real values for Device Metrics, see: |
18 | 27 | * [Device Metrics List](https://gist.github.com/sidferreira/3f5fad525e99b395d8bd882ee0fd9d00)
|
19 | 28 |
|
20 |
| -For a list of available user agent strings, see: |
| 29 | +For a list of available User-Agent strings, see: |
21 | 30 | * [User Agent Strings List](https://developers.whatismybrowser.com/useragents/explore/)
|
22 | 31 |
|
23 | 32 | --------
|
24 | 33 |
|
25 |
| -Here's an example of running a mobile test: |
26 |
| - |
27 |
| -* [SeleniumBase/examples/test_skype_site.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_skype_site.py) |
28 |
| - |
29 |
| -```bash |
30 |
| -pytest test_skype_site.py --mobile |
31 |
| -``` |
32 |
| -[<img src="https://cdn2.hubspot.net/hubfs/100006/images/skype_mobile_test_2.gif" title="SeleniumBase Mobile Testing">](https://cdn2.hubspot.net/hubfs/100006/images/skype_mobile_test_2.gif) |
33 |
| - |
34 |
| --------- |
35 |
| - |
36 | 34 | Here's another example of running a mobile test ([SeleniumBase/examples/test_swag_labs.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_swag_labs.py)), which demonstrates using ``--metrics`` and ``--agent`` with ``--mobile``:
|
37 | 35 |
|
38 | 36 | ```bash
|
|
0 commit comments