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

chore(repo): add preview app tests with playwright #102

Merged
merged 8 commits into from Dec 30, 2023

Conversation

wladpaiva
Copy link
Contributor

@wladpaiva wladpaiva commented Dec 17, 2023

Component / Package Name:

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, please include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

Add playwright testing to make sure emails are getting rendered properly. It also added a github action to run testing on CI.

Things to do

  • Fix eslint errors (I tried to disable the rules for .spec files only but eslint formatting was incompatible with prettier formatting so I just ignored it for now)
  • Move the CI to the correct flow. Should it prevent release or only prevent merges?
  • It's only testing one demo email so maybe the rest of them as well

@shellscape
Copy link
Owner

shellscape commented Dec 17, 2023

Thanks for putting this together!

As a point of reference, #101 had a preview error in it. But it didn't show up when running the preview from within the repo. That seems to be a continual pain point. I had to publish a new test version and install it independently, elsewhere on my file system and run the preview to surface a dependency issue with Vite where a dependency of postcss-color-functional-notation was causing a vite build issue, and need to be added to optimizeDeps:

postcss-color-functional-notation
  -> @csstools/postcss-progressive-custom-properties
       -> postcss-value-parser

FWIW this happens a lot when adding new dependencies.

So I'm going to have to figure out how to create a local project in isolation without having to publish and we can run playwright against that. Will work on the plumbing to make that happen.

@shellscape
Copy link
Owner

Tested some things locally and we can use the pnpm file: protocol for dependencies to accurately mimic a published version. Will add a script to this PR that generates a separate local test project using that.

# Conflicts:
#	apps/demo/package.json
#	pnpm-lock.yaml
@shellscape
Copy link
Owner

@wladpaiva no matter what I do, I keep getting Serving HTML report at http://localhost:9323. Press Ctrl+C to quit. when running the tests locally. Are you aware of any way to get past that and have the process end without user intervention?

@wladpaiva
Copy link
Contributor Author

Weird, that's the report and comes from the playwright show-report command. Mine is not auto executing it. How are you running it?

image

@shellscape
Copy link
Owner

I ended up making a lot of changes last night, including swapping the html reporter for the line reporter, which is what you're seeing now. Ran into all kinds of clunkiness with playwright last night too. Things like it not being able to run this line and return the innerHtml https://github.com/shellscape/jsx-email/pull/102/files#diff-033c527a97d545b925c665015ba56236fc739ea416a1f72edcd15289bfd6867bR24, and snapshots being absolutely bafflingly weird.

@shellscape shellscape changed the title WIP Add playwright test chore(repo): WIP add preview app tests with playwright Dec 29, 2023
@wladpaiva
Copy link
Contributor Author

image
Pulled your last change and seems to be working without editing anything

@shellscape
Copy link
Owner

yessir! figured a few things out. I think we're good to go on this. there are a few changes I want to get into the preview app before we pull the trigger on this one.

@shellscape shellscape marked this pull request as ready for review December 29, 2023 19:11
@shellscape shellscape changed the title chore(repo): WIP add preview app tests with playwright chore(repo): add preview app tests with playwright Dec 29, 2023
@shellscape shellscape merged commit 4051b94 into shellscape:main Dec 30, 2023
10 checks passed
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.

None yet

2 participants