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(publish): improve e2e tests #3580
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- asset prefix is set in the build step by writing to
.env.production
. [[dendron://dendron.docs/pkg.nextjs-template.ref.asset-prefix]] - for testing, we can write to
.env.test
. see https://nextjs.org/docs/basic-features/environment-variables#test-environment-variables
a0fab6d
to
a0baf47
Compare
This is a more ergonomic API and want to use that inside [[dendron://dendron.docs/pkg.nextjs-template.qa.test]].
… command This commit aims to allow passing arguments to the mentions command like so: `yarn cli:test:template:docker --update-snapshots`. It appears docker does not support positional arguments therefore prepending `$0` so that the first argument gets applied.
The issue is that add that env var results into css styles not being rendered and therefore changing the form of that result that we want to test with visual regression testing. Maybe we need to seperate VRT from e2e testing which appear to me to be actually not the same. VRT does not require interaction with the page.
Lets keep this how it was for now.
@kevinslin pinging you with the thing I am grabing after with which is writing the assetprefix test case. In The next question that would then come up is that we would only set About how to do the seperation, I can think of having two directories with |
for VRT tests, can we test with |
Further grasping of the issue made me conclude that the pivot point for seperation is when we build nextjs for all the tests in |
i think we ultimately do need two builds if we want to test this e2e. can we do something like the following? BUILD_DIR=general-build next build
BUILD_DIR=assetPrefix-build next build and when running the test, run the test in the right build director? BUILD_DIRS = [...]
BUILD_DIRS.map {
await cli.nextBuild([path.join(__dirname, "..", BUILD_DIR)]);
} ideally what we want: [regular build, simple build].forEach(build => {
runAllCommonTest(build);
runBuildSpecificTest(build)
})
|
b10901d
to
54cf881
Compare
This commit aims to allow `yarn run ci:test:template:docker -u` or any other multiple arguments appendix.
The cause of the changes is an update from playwright and its browser dependencies.
@kevinslin found a way without having multiple build steps |
@kevinslin I found an issue where the logo will not get loaded when providing a asset-prefix which will not get checked for here
Shall I continue withing this PR fixing that and adding missing checks for correctly applies asset-prefix? |
continue with the pr, we'll fix the logo in a separate pr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good - nitpick on typo
]); | ||
}); | ||
|
||
test("THEN `NEXT_PUBLIC_ASSET_PREFIX` control path generatoin", async ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The aim of this PR is to add tests for checking if assetPrefixes are applied. It includes some improvements that emerged out of figuring this out.
Some docs on how to add playwright tests are also part of the aim of this PR [[dendron://dendron.docs/pkg.nextjs-template.qa.test#e2e-testing-with-playwright]]
Pull Request Checklist
If you are a community contributor, copy and paste the PR template from Dendron Community PR Checklist and add it to the body of the pull request.
If you are a team member, copy and paste the template from Dendron Extended PR Checklist.
To copy the template, click on the
Raw
button on the gist to copy the plaintext version of the template to this PR.