Comparison with other tools
tuiv builds heavily upon playwright and extends it with a more compact syntax.
Instead of handling all the promises yourself in playwright like this:
const element = await page.waitForSelector('.some-selector') await element.click() await element.type('foo') expect(await element.textContent()).stringContaining('bar')
tuiv allows you to write chained commands and assertions, removing the need for a lot of local variables:
tuiv also auto-retries assertions and provides more assertions specifically for DOM elements.
Playwright Test Runner / Folio
But, did I mention that Folio at that point (around March 2021) was very much alpha? Unfortunately for me, folio completely changed their api away from fixtures to something completely else, so I just… wrote my own test runner.
So if you are thinking "that API looks a lot like an early version of folio", you are absolutely right, because it is. Beyond the similar API however there are a ton of features missing and the internals are (hopefully) rather different (it's in plain JS and not in TypeScript, for starters). The reporter API is also event based (similar to mocha) instead of hook-function based.
With the proper release of the Playwright Test Runner, Folio has changed its API back to (slightly different) fixtures, but by that time I already was way too deep in my own implementation.
Cypress is a clear inspiration for tuiv and while Cypress remains a great and polished tool for e2e testing, it has some big caveats.
Reliance on JS-injections
Own async-to-sync API
Testing in the browser is inherently asynchronous. Waiting for pages to load, elements to exist and assertion conditions to be true need to all be handled. While playwright leaves this completely to the test author (resulting in a lot of
await), Cypress completely hides this asynchronicity and presents the test author with a synchronous API, which, on first glance, is awesome. However, this forcing of asynchronous into synchronous call chains makes controlling the test flow (for conditional testing for example) difficult (fallbacks exist) and some parts of Cypress' API a bit bizarre.
tuiv instead relies on native Promises and Proxies, letting the test author write standard js.
Cypress just added Firefox support and still does not support Safari, which makes its use as a cross platform testing tool severely limited.
From an outside perspective it looks like Cypress development is not fixing core problems but expanding into new use cases (with Cypress Studio for example).
Some long time problems I have while writing cypress tests are in no particular order:
- each test suite is a separate test run
- no way to stop on error in interactive mode
- iframes are complicated™
- no window/tab support
- some function names are… bad (
focusedare queries for example, instead of checks, like the naming would suggest)