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 WebdriverIO as alternative #2114

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

christian-bromann
Copy link
Contributor

@christian-bromann christian-bromann commented Dec 2, 2022

Description of Problem

Current testing docs only offer PW and NW as alternative solutions. WebdriverIO has released v8 which includes component testing and has dedicated docs how to get up and running when using Vue as framework.

Using JSDOM and JavaScript click events do not seem like a viable approach for testing component these days as they don't mimic user behavior at all. For example, clicks through fireEvent of @testing-library/vue do not recognise whether another element is blocking the access to an element. I've done a whole set of experiments showing that using WebDriver which is a W3C web standard as automation protocol to mimic user behavior prevents stupid errors to pass through and also offers much more capabilities, e.g. user gestures.

For pure component tests I personally would not advice to use JSDOM at all given that:

  • it lacks in certain features (e.g. triggering pseudo states) and has some known caveats
  • it completely ignores the interactivity state of elements, e.g. if my component hides a button or an input is disabled, many user interactions are still possible within JSDOM and non-organic interactions via JS clicks
  • mounting and rendering components in an actual browser allows the use of common developer debugging tools like DevTools rather than using e.g. screen.debug() to print the DOM tree providing a much better DX
  • speed advancements are just minimal, starting a headless browser is almost as fast

Proposed Solution

As WebdriverIO as viable alternative.

Additional Information

n/a

@netlify
Copy link

netlify bot commented Dec 2, 2022

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit 0f96f5a
🔍 Latest deploy log https://app.netlify.com/sites/vuejs/deploys/6486937266444e000799f991
😎 Deploy Preview https://deploy-preview-2114--vuejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@christian-bromann
Copy link
Contributor Author

@yyx990803 sorry for the ping but any chance we can get a review for this?

@yyx990803 yyx990803 merged commit 1e0960d into vuejs:main Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants