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 init command for browser tests #5793

Closed
4 tasks done
sheremet-va opened this issue May 29, 2024 · 3 comments · Fixed by #5960
Closed
4 tasks done

Add init command for browser tests #5793

sheremet-va opened this issue May 29, 2024 · 3 comments · Fixed by #5960
Labels
feat: browser Issues and PRs related to the browser runner p2-nice-to-have Not breaking anything but nice to have (priority)

Comments

@sheremet-va
Copy link
Member

Clear and concise description of the problem

Currently, enabling browser mode is not a very straightforward process. As a user who just wants to try it, I need to:

  • enable browser in the config
  • run vitest, see @vitest/browser is not installed
  • install @vitest/browser
  • see webdriverio is not installed
  • ask yourself what webdriverio is, install it
  • run vitest, see I forgot the browser name
  • add browser name to the config

Suggested solution

  1. We need to improve documentation on how the browser mode works internally
  2. Add vitest init-browser-mode (name TBD) command that asks what provider should be installed and what browser, then it scaffolds files to enable the browser mode integration:
    a. installs the @vitest/browser + provider package + adds @vitest/browser/providers/{name} to tsconfig

Alternative

No response

Additional context

No response

Validations

@sheremet-va sheremet-va added feat: browser Issues and PRs related to the browser runner p2-nice-to-have Not breaking anything but nice to have (priority) labels May 29, 2024
@MatanBobi
Copy link
Contributor

This one is extremely funny for me because I just bumped into every step mentioned 😅
At least in the meantime I think we should add installation page. I'd love to help with that if needed.

@sheremet-va
Copy link
Member Author

This one is extremely funny for me because I just bumped into every step mentioned 😅 At least in the meantime I think we should add installation page. I'd love to help with that if needed.

The PR is welcome 😄

@MatanBobi
Copy link
Contributor

Thanks @sheremet-va, I've created #5799 in the meanwhile to clarify installation and configuration steps :)

@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: browser Issues and PRs related to the browser runner p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants