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

Adding E2E tests for client hydration and HMR #3374

Merged
merged 67 commits into from
May 23, 2022
Merged

Conversation

tony-sull
Copy link
Contributor

@tony-sull tony-sull commented May 15, 2022

Changes

Follow-up to #3349 - this adds end-to-end tests with Playwright to test component hydration and astro dev HMR

Testing

Nothing but tests!

What's covered:

  • component hydration for all frameworks (except Lit, see below)
  • HMR updates when editing a page, Astro component, or framework component
  • HMR for tailwind style updates
  • component hydration and HMR when multiple frameworks are used

TODO:

Lit tests are disabled right now. Playwright doesn't support Web Components by default and it looks like there's still an open issue to add support with Playwrights test-ct helper library

? This may be something we could shim in the tests on our end? Need to investigate further

Docs

N/A testing only, no docs updates

@changeset-bot
Copy link

changeset-bot bot commented May 15, 2022

⚠️ No Changeset found

Latest commit: d305dbc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label May 15, 2022
@tony-sull tony-sull self-assigned this May 16, 2022
@tony-sull tony-sull marked this pull request as ready for review May 22, 2022 16:29
@tony-sull tony-sull changed the title WIP: adding E2E tests for client hydration and HMR Adding E2E tests for client hydration and HMR May 22, 2022
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is amazing! Thanks so much for getting this over the line!

@tony-sull tony-sull merged commit ff56f08 into main May 23, 2022
@tony-sull tony-sull deleted the test/e2e-hydration branch May 23, 2022 16:56
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* adding Tailwind E2E tests with Playwright

* package.json updates

* adding e2e tests to CI workflow

* using e2e for dev tests, mocha for build tests

* refactor: sharing test-utils helpers

* chore: update lockfile

* Adding contributing docs

* Revert "refactor: sharing test-utils helpers"

This reverts commit 48496f4.

* refactor: simpler solution to resolving e2e test fixtures

* chore: updating lockfile

* refactor: cleaning up how URLs are resolved in e2e tests

* install playwright deps in CI

* ensure playwright deps are installed during CI

* adding a basic HMR test for tailwind styles

* using @e2e for playwright test packages

* adding react hydration and HMR tests

* adding hydration and HMR tests  for preact

* adding svelte hydration and HMR tests

* adding solid-js hydration and HMR tests

* adding solid hydration and HMR tests

* adding vue hydration and HMR tests

* adding client:media tests

* fixing Lit hydration and HMR tests

* fixing up the Vue e2e tests

* fixing up svelte tests

* chore: test cleanup

* chore: cleaning up test element IDs

* chore: updating lock file

* chore: update lockfile after merge

* TEMP: disabling React e2e tests

* Revert "TEMP: disabling React e2e tests"

This reverts commit ed1bad9.

* updating to use the new editFiles helper

* chore: updating lock file

* updating lock file

* updating lockfile

* TEMP: watching for console logs

* TEMP: testing typescript tests

* updating test:e2e scripts for config file

* seems like it didn't find the config file?

* use a fresh dev server for each test

* removing Lit tests for now

* Revert "removing Lit tests for now"

This reverts commit 4970a80.

* updating test config for CI

* WIP: disabling HMR tests to track down why they're unreliable

* TEMP: logging to debug HMR test

* afterEach isn't a global in Playwright

* fix: the test's file reset helper was using a URL not filepath

* one last try, why is the HMR test hanging at cleanup?

* resetting files after tailwind HMR test

* create the onNextChange watcher before editFile is called

* moving the file changed sync into editFile()

* code refactor + Astro Component HMR test

* chore: lint fixes

* adding a test suite for the framework-multiple example app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants