vitest-dev / vitest

Next generation testing framework powered by Vite.
https://vitest.dev
MIT License
13.14k stars 1.19k forks source link

Browser Mode: Allow extended configuration of provider #6983

Open JoaoCnh opened 12 hours ago

JoaoCnh commented 12 hours ago

Clear and concise description of the problem

Running test suites in CI is quite different from running them on a local machine. CI is quite often slower and locators take more than the default 1000ms to locate elements or to perform actions (click, hover, etc).

It's possible to define a specific timeout for an expect or a locator.click for example but it would be nice to be able to set larger timeouts at a config level for when the tests run in CI.

Suggested solution

add new properties in the browser config for the following:

This would under the hood configure the correct provider configurations if possible.

Here's doc ref to Playwright test configuration

Alternative

Allow full customisation of test configuration. Right now we're allowed to extend launch options and browser context options on playwright for example but we could extend this configuration to Test Options

Additional context

No response

Validations

hi-ogawa commented 8 hours ago

It's possible to define a specific timeout for an expect

I don't think expectTimeout would apply to Vitest? I would assume that's their async assertion's timeout, so for us, that would be probably expect.element(), which can be already configured by expect.poll.timeout.

hi-ogawa commented 7 hours ago

I think actionTimeout is only anomaly for playwright since it's probably more like test runner concern than pure browser driver, so they didn't include it in their BrowserContextOptions.

@JoaoCnh Do you see anything missing for Vitest's provider options other than actionTimeout?