Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs(cli): document run-code syntax constraints (#40309)

Simon Knott55b92d762ff8
diff --git a/packages/playwright-core/src/tools/cli-client/skill/references/running-code.md b/packages/playwright-core/src/tools/cli-client/skill/references/running-code.md
index 8b35e9a41d..98b541fb54 100644
--- a/packages/playwright-core/src/tools/cli-client/skill/references/running-code.md
+++ b/packages/playwright-core/src/tools/cli-client/skill/references/running-code.md
@@ -11,6 +11,16 @@ playwright-cli run-code "async page => {
}"
```
+You can also load the function from a file:
+
+```bash
+playwright-cli run-code --filename=./my-script.js
+```
+
+
+The code must be a single function expression, it is wrapped in `(...)` and evaluated.
+import/export/require syntax is not supported.
+
## Geolocation
```bash