E2e test#8632
Closed
ryanfkeller wants to merge 5 commits into
Closed
Conversation
New hfla_e2e container based on playwright:v1.59.1:jammy. Uses the e2e profile so that devs can still use "docker compose up" to only launch the hfla_site and not run tests. Container depends on hfla_test, and command waits for hfla_site:4000 to be present before running tests. Container is launchable with > docker compose up hfla_e2e On a local machine, first launch of hfla_e2e also launches hfla_site, which builds the site. Subsequent runs use the existing hfla_site build. One thing to note is that if hfla_site source is updated, there's a race condition between the site being updated and hfla_e2e being run again. If hfla_e2e is run immediately after a change, it will be run on the stale (published) version of the site, and won't block waiting on the build to finish.
Absolute urls are appropriate for metadata, but using them with local assets makes those assets break when the site isn't served from the configured url (i.e. localhost). Using relative paths means that the asset url will always match the served site url. This was discovered while setting up the e2e tests -- utils.js was silently failing to load because absolute_url baked in localhost:4000 to the utils url which doesn't resolve in the container network.
|
Want to review this pull request? Take a look at this documentation for a step by step guide! From your project repository, check out a new branch and test the changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes did you make?
tests/e2e/) with Docker Compose integrationhead.htmlto use relative paths for local assets (CSS, JS, favicon)Why did you make the changes (we will use this info to test)?
Screenshots of Proposed Changes To The Website (if any)
Notes:
Tests run in Docker via
docker compose up hfla_e2e. The site is served using the existing hfla_site image, with a Playwright container added alongside it that runs the tests.I have checked this PR for CodeQL alerts and none were found.