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

feat: test examples in playwright #238

Closed
wants to merge 5 commits into from
Closed

feat: test examples in playwright #238

wants to merge 5 commits into from

Conversation

olizilla
Copy link
Contributor

@olizilla olizilla commented Jan 9, 2023

  • use playwright and playwright-test to verify the examples run in a browser
  • have playwright-test fire up the vite preview server on a known port to serve the example
  • add github workflow

So far i've just added a minimal e2e style test for the vue sign-in-up example, to show the pattern and get feedback. It's already found a bug there in safari which doesn't appear in firefox or chrome:

Screenshot 2023-01-09 at 14 30 39

Screenshot 2023-01-09 at 14 30 53

WIP on #150

TODO

  • add tests for other examples
  • consider pulling tests up to parent dir and reuse the same e2e test for each ui flavour - i'm imagining we'd have a test for each example, and then run that suite once for each ui library directory.
  • fix safari bug in sign-in example where submitting the form errors and returns the user to the form instead of the verify message

License: MIT
Signed-off-by: Oli Evans oli@protocol.ai

- use playwright and playwright-test to verify the examples run in a browser
- have playwright-test fire up the vite preview server on a known port to serve the example
- add github workflow

- add tests for other examples
- consider pulling tests up to parent dir and reuse the same e2e test for each ui flavour
- fix safari bug in sign-in example where submitting the form errors and returns the user to the form instead of the verify message

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 9, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 46ab8ea:

Sandbox Source
@w3ui/example-react-file-upload Configuration
@w3ui/example-react-sign-up-in Configuration
@w3ui/example-react-uploads-list Configuration
@w3ui/example-solid-file-upload Configuration
@w3ui/example-solid-sign-up-in Configuration
@w3ui/example-solid-uploads-list Configuration
@w3ui/example-vue-file-upload Configuration
@w3ui/example-vue-sign-up-in Configuration
@w3ui/example-vue-uploads-list Configuration

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
@olizilla olizilla mentioned this pull request Jan 9, 2023
@gobengo
Copy link
Contributor

gobengo commented Jan 9, 2023

lookin good. @olizilla I noticed the PR description here says playwright-test (npm) but the code uses @playwright/test (npm). Just making sure your intention is to use the latter?

olizilla added a commit that referenced this pull request Jan 11, 2023
- pulls example tests out to own dir to reuse them for each ui library.

also explores using vitest to drive playwright tests. It's ok, but I think we want as little friction as possible for browser testing, and i'm now inclined to use @playwright/test instead after trying it in #238 and now i see it has support for what we need to do here https://playwright.dev/docs/test-advanced#projects and https://playwright.dev/docs/test-parameterize

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
@olizilla
Copy link
Contributor Author

@gobengo yes! good point! it's confusing as heck, but in this instance I mean to use @playwright/test for its comfy UI testing.

I made a better one over here #242 where we can write the tests for the examples once and then run them over all the ui libraries.

@olizilla olizilla closed this Jan 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