Closed hirasso closed 10 months ago
@daun how exactly do I install the browsers for playwright? Is the action test:e2e:install
in swup actually being exectued from somewhere?
https://github.com/swup/fragment-plugin/actions/runs/6852523927/job/18631255071?pr=64#step:7:12
@hirasso I don't think it's being executed. The core's rather complicated GitHub action does that on its own. With the much simpler action files for the plugin, you could run the npm script from there.
TIL caching playwright isn't necessarily speeding up actions.
Without cache: 2m 20s With cache: 2m 57s
@daun do you understand what's happening here?
https://github.com/swup/fragment-plugin/actions/runs/6860973311/job/18655736640?pr=64#step:8:10
Error: Report file results.json not found. Make sure Playwright is configured to generate a JSON report.
If I understand the config correctly, it should spit out the results.json
at the root when in CI:
reporter: process.env.CI
? [['dot'], ['github'], ['json', { outputFile: '../../report.json' }]]
: [['list'], ['html', { outputFolder: '../reports/html', open: 'on-failure' }]],
Although swup's playwright config doesn't even report JSON at all when in CI: https://github.com/swup/swup/blob/1cd87ea335b95b9b8caee602634974f5011d2cc7/tests/config/playwright.config.ts#L32-L40
It's not THAT important I'd say, I could totally live without the reporter in the PR tbh :)
@hirasso It's currently report.json
vs. results.json
🤠 Matching both should fix it hopefully.
Haha true 😆 so many trees 🌲🌳🌴🏝️
12 passed
12 tests across 1 suite
28.7 seconds
b2332df
OMG it's working! 🤯🥳
...ready for review 🤪
I guess the playwright shield status will appear when this is merged.
I decided to use "vitest" and "playwright" instead of "unit" and "e2e" since the vitest tests aren't all real unit tests. The line is blurry.
Makes sense! The reason I've used functional
and unit
was mostly to make it understandable for people who haven't used/heard of both tools, but that's probably not too many people anyway.
Description
Adds basic e2e test coverage to the plugin.
Checks
master
branchnpm run lint
)npm run test
)