-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
enhancement: pending triagefeat: browserIssues and PRs related to the browser runnerIssues and PRs related to the browser runner
Description
Clear and concise description of the problem
Currently using launchOptions for remote server with connectOptions is forbidden as per:
vitest/packages/browser-playwright/src/playwright.ts
Lines 172 to 184 in cee999b
| if (this.options.connectOptions) { | |
| if (this.options.launchOptions) { | |
| this.project.vitest.logger.warn( | |
| c.yellow(`Found both ${c.bold(c.italic(c.yellow('connect')))} and ${c.bold(c.italic(c.yellow('launch')))} options in browser instance configuration. | |
| Ignoring ${c.bold(c.italic(c.yellow('launch')))} options and using ${c.bold(c.italic(c.yellow('connect')))} mode. | |
| You probably want to remove one of the two options and keep only the one you want to use.`), | |
| ) | |
| } | |
| const browser = await playwright[this.browserName].connect(this.options.connectOptions.wsEndpoint, this.options.connectOptions) | |
| this.browser = browser | |
| this.browserPromise = null | |
| return this.browser | |
| } |
but playwright server supports setting remote browser launch option via x-playwright-launch-options header or launch-options query for initial wsEndpoint.
Suggested solution
Reuse and apply existing launchOptions logic to connect(wsEndpoint) via launch-options=... query.
Alternative
No response
Additional context
While doing #9600, I partially confirmed launch-options works. Also it would be nice to run same browser test suite with wsEndpoint too.
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancement: pending triagefeat: browserIssues and PRs related to the browser runnerIssues and PRs related to the browser runner