Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/headless code example #216

Merged
merged 2 commits into from
Apr 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ exports.config = {
browserName: "chrome",
acceptInsecureCerts: true,
"goog:chromeOptions": {
["window-size=1440,800", "--auto-open-devtools-for-tabs"] // <--
args: ["--window-size=1440,800", "--auto-open-devtools-for-tabs"] // <--
}
}
]
Expand All @@ -146,7 +146,7 @@ The browser will be started by `wdi5` with the DevTools immediately available.![

## Chrome: run headless

"headless" means running the browser without a GUI.
"headless" means running the browser without a GUI. Running browsers in "headless" mode is a great way for running automated tests, especially in an continous integration pipeline.
In `wdio.conf.(j|t)s`, provide "headless" as `args` to the `chrome` capability:

```js
Expand All @@ -161,14 +161,14 @@ exports.config = {
browserName: "chrome",
acceptInsecureCerts: true,
"goog:chromeOptions": {
["window-size=1440,800", "--headless"] // <--
args: ["--window-size=1440,800", "--headless"] // <--
}
}
]
}
```

Note that running headless can still be combined with a dedicated viewport, `1440,800` in the example above.
However, there can be one problem: The "invisible" browser window starts a viewport only the size of 800x600, which is often too small for modern responsive applications. You can combine running headless with a dedicated viewport, `1440,800` like in the example above.

## DevX: code completion for `wdi5`- and `wdio`-API

Expand Down