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

add support to open the browser after ViteDevServer started without open configured #13706

Open
4 tasks done
userquin opened this issue Jul 3, 2023 · 2 comments
Open
4 tasks done
Labels
enhancement New feature or request

Comments

@userquin
Copy link
Contributor

userquin commented Jul 3, 2023

Description

We're adding none provider to Vitest browser to allow run tests in the browser without playwright/webdriverio.

Right now, the draft PR (vitest-dev/vitest#3674) will configure open = true before creating ViteDevServer: https://github.com/vitest-dev/vitest/pull/3674/files#diff-0820b575c16b5a3f5f4fab98f25d1a896a476dc1fe768b4ef79f49b2eaa9f19fR51-R52.

We want to delay opening the browser, and open it in the appropiate time: https://github.com/vitest-dev/vitest/pull/3674/files#diff-ead1606bb6c60ea8c5c6dea3c305fffa9ec9813b3c70f785aafd4349c71b5f2eR34-R36

Suggested solution

Just allow open url at any time

Alternative

No response

Additional context

No response

Validations

@patak-dev
Copy link
Member

We exposed server.openBrowser() here: #11974. If open is false, and then you call this function I think it should work as you expect.

You mentioned in a DM that you wanted to control the loaded URL, no? So the default won't be enough if I understand correctly and you would need openBrowser to take an optional param to open a different URL. Is that correct?

@userquin
Copy link
Contributor Author

userquin commented Jul 3, 2023

You mentioned in a DM that you wanted to control the loaded URL, no? So the default won't be enough if I understand correctly and you would need openBrowser to take an optional param to open a different URL. Is that correct?

yes

EDIT: when I created Vitest PR it wasn't working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants