r/javascript • u/xcodebeast • 17d ago
Flashwright: the fastest e2e testing framework, up to 4x faster than Playwright
https://flashwright.dev/If you're interested in the details, here's a blog post: https://codebeast.io/blog/flashwright
16
u/fireatx 17d ago
seems cool, similar to vitest's isolate: false config option, but i feel like this could probably just be a PR on the playwright repo adding a new config option. does this need to be an entirely new package?
3
u/xcodebeast 17d ago
Thanks. I agree, that particular optimization could be a PR on playwright repo but I think all the other optimizations + the QoL features I added justified a new package. I might push some PRs to Playwright though.
4
u/fireatx 17d ago
you definitely should put up some PRs! at my work we use playwright in several places, and having these optimizations available would be a game changer. i can't justify replacing playwright entirely, but could definitely make use of these speedups if they were available within playwright.
19
u/Positive_Method3022 17d ago
The strategy can lead to false positives/negatives. Sandboxing test execution by context is a must.
0
u/xcodebeast 17d ago
It depends a lot on the project and what you're testing as u/caboosetp said. Flashwright allows you to turn off each individual optimization so you can use only what actually fits your project.
1
u/caboosetp 17d ago
Depends on what you're testing.
Many of the tests i write are testing static components like navigation which shouldn't depend on what other stuff has done. If not being in a sandbox breaks that, there's a problem anyways. The chance of a false positive is also almost zero.
Being able to choose to group tests like that to use a resetting context would be fine. Especially if you're just grouping things like static components.
But I agree the ability to put tests in a sandbox context is also very important, especially for anything dynamic. Unfortunately it's the dynamic stuff that generally has the most tests, so i don't even know if grouping just some things is going to see real gains on most projects
12
u/OpiumOpossum 17d ago edited 17d ago
Not sure but this seems like it could have memory leaks if you use listeners, network interceptors or logging. Otherwise, I am pretty sure this is a similar way to how Vitest optimizes their test runner.
1
u/RubbelDieKatz94 🇩🇪 Sr. Fullstack / TS / Py / 10+ years 13d ago
Vitest is slower than Jest btw, in its default config. It has some pretty advanced isolation that makes it very stable, and rather slow.
3
u/Discordbothost 17d ago
there's an isolation: 'strict' option for a fresh context per test. default recycling is per worker, so the concern is state leaking into the next test on that worker, not parallel workers sharing one context. https://github.com/xcodebeast/flashwright#differences-from-playwright
3
u/LukaRozman27 17d ago
beware if you rely on Playwright's built-in tracing, Flashwright skips it entirely to hit those speed claims.
3
u/DarkGhostHunter 17d ago
Tested with Pest and the gains are… negligible. Barely 5%, margin of error.
2
u/tomByrer 16d ago
Neat! How well does it work vs headless browsers, esp LitePanda & co? Much improvement there?
1
u/ahmed_h2105 3d ago
With built-in tracing skipped, how do you account for the lost debugging visibility in the speed comparison?
39
u/Recoil42 17d ago
TLDR: