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

Browser Mode: Allow extended configuration of provider #6983

Closed
4 tasks done
JoaoCnh opened this issue Nov 28, 2024 · 4 comments · Fixed by #6984
Closed
4 tasks done

Browser Mode: Allow extended configuration of provider #6983

JoaoCnh opened this issue Nov 28, 2024 · 4 comments · Fixed by #6984

Comments

@JoaoCnh
Copy link

JoaoCnh commented Nov 28, 2024

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:

  • actionTimeout - optional and number
  • expectTimeout - optional and number

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
Copy link
Contributor

hi-ogawa commented Nov 29, 2024

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
Copy link
Contributor

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?

@JoaoCnh
Copy link
Author

JoaoCnh commented Nov 29, 2024

Hey, at the moment the only thing other than actionTimeout that I encountered was the ability to activate playwright tracing for debugging purposes in CI. But not sure what are the plans for Vitest regarding that in the future.

@hi-ogawa
Copy link
Contributor

hi-ogawa commented Nov 29, 2024

Indeed, it looks like https://playwright.dev/docs/api/class-testoptions#test-options-trace is another diff between https://playwright.dev/docs/api/class-testoptions and https://playwright.dev/docs/api/class-browser#browser-new-context

I like playwright's trace too but I'm not sure yet how we can integrate that. I would assume at least we would rely on their UI to preview trace, but maybe it's possible to generate that during Vitest browser mode.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants