Skip to content

Commit de2fe1e

Browse files
committed
Update the docs
1 parent 9cc8f00 commit de2fe1e

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ The code above will leave your browser window open in case there's a failure. (i
357357
--agent=STRING # (Modify the web browser's User-Agent string.)
358358
--mobile # (Use the mobile device emulator while running tests.)
359359
--metrics=STRING # (Set mobile metrics: "CSSWidth,CSSHeight,PixelRatio".)
360+
--chromium-arg=ARG # (Add a Chromium arg for Chrome/Edge, comma-separated.)
360361
--extension-zip=ZIP # (Load a Chrome Extension .zip|.crx, comma-separated.)
361362
--extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.)
362363
--headless # (Run tests headlessly. Default mode on Linux OS.)

help_docs/customizing_test_runs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ SeleniumBase provides additional ``pytest`` command-line options for tests:
109109
--port=PORT # (The Selenium Grid port used by the test server.)
110110
--proxy=SERVER:PORT # (Connect to a proxy server:port for tests.)
111111
--proxy=USERNAME:PASSWORD@SERVER:PORT # (Use authenticated proxy server.)
112+
--agent=STRING # (Modify the web browser's User-Agent string.)
112113
--mobile # (Use the mobile device emulator while running tests.)
113114
--metrics=STRING # (Set mobile metrics: "CSSWidth,CSSHeight,PixelRatio".)
115+
--chromium-arg=ARG # (Add a Chromium arg for Chrome/Edge, comma-separated.)
114116
--extension-zip=ZIP # (Load a Chrome Extension .zip|.crx, comma-separated.)
115117
--extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.)
116118
--headless # (Run tests headlessly. Default mode on Linux OS.)

help_docs/shadow_dom.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Shadow DOM support / Shadow-root interaction
2+
3+
🔵 SeleniumBase lets you pierce through open Shadow DOM selectors (to interact with elements inside) by adding ``::shadow`` to CSS fragments that include a shadow-root element. For multi-layered shadow-roots, you must individually pierce through each shadow-root element that you want to get through.
4+
5+
🔵 Here are some examples of Shadow DOM selectors:
6+
7+
```python
8+
css_1 = "downloads-manager::shadow #no-downloads"
9+
10+
css_2 = "downloads-manager::shadow #downloadsList downloads-item::shadow #file-link"
11+
12+
css_3 = "downloads-manager::shadow downloads-toolbar::shadow cr-toolbar::shadow cr-toolbar-search-field::shadow cr-icon-button"
13+
14+
css_4 = "downloads-manager::shadow downloads-toolbar::shadow cr-toolbar::shadow cr-toolbar-search-field::shadow #searchInput"
15+
16+
css_5 = "downloads-manager::shadow downloads-toolbar::shadow cr-toolbar::shadow cr-toolbar-search-field::shadow #clearSearch"
17+
```
18+
19+
🔵 The shadow-root (``::shadow``) elements are transitional, and therefore cannot be the final part of your CSS selectors. Complete your CSS selectors by including an element that's inside a shadow-root.
20+
21+
🔵 Note that ``::shadow`` selectors only exist within SeleniumBase, and do not exist outside of it.
22+
23+
🔵 Here's an example test that interacts with Shadow DOM elements: [examples/test_shadow_dom.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_shadow_dom.py)

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ nav:
114114
- Desired Capabilities: help_docs/desired_capabilities.md
115115
- Docker Start Guide: integrations/docker/ReadMe.md
116116
- Using Safari Driver: help_docs/using_safari_driver.md
117+
- Shadow DOM Support: help_docs/shadow_dom.md
117118
- macOS Hidden Files: help_docs/hidden_files_info.md
118119
- MySQL Instructions: help_docs/mysql_installation.md
119120
- Demo Pages:

0 commit comments

Comments
 (0)