TestCafe and Vera: import tests, export suites
The TestCafe importer reads fixtures and tests with the TypeScript compiler and turns each link of TestCafe's fluent t.* chains into a Vera step. It is deterministic and spends no AI credits. Vera does not run TestCafe itself; the export is a TestCafe suite for your own project.
What comes across
- The TestCafe converter is deterministic: the same file gives the same tests, with no AI call and no AI credits spent.
- fixture('Name').page('url') sets the test-name prefix and adds a goto step at the start of every test in that fixture.
- Each test('name', async t => …) becomes one Vera test, and every link of a fluent chain such as t.click(a).typeText(b, 'x') becomes its own step.
- t.navigateTo, click, doubleClick, rightClick, typeText, pressKey, hover, wait and takeScreenshot map onto Vera actions.
- t.expect(…).eql(), contains(), ok() and notOk() become assertions.
- Selector('css') arguments are unwrapped to Vera selectors.
- On export, a test downloads as a single .testcafe.js file with fixture and test blocks, the t controller and Selector() wrapping.
What does not
- Chained Selector modifiers such as .nth() and .find(), custom helpers and unclassifiable ClientFunctions are not converted. Each statement is listed as a warning for manual or AI conversion, never silently dropped.
- Selector(…).withText('t') collapses to a text= match, with a warning to verify the target.
- t.pressKey() with a key sequence imports only the first key.
- t.selectText() is dropped — Vera has no equivalent action.
- Vera never runs TestCafe itself. The exported file is for your own TestCafe project; inside Vera the test runs on its own engine.
How to set it up
- Open a project's Tests page and choose Import tests, then pick your TestCafe test files. The format is detected from each file.
- Read the warnings and the unresolved count before trusting the test count: they name every statement that was not converted.
- Optionally tick the AI conversion box to convert what the importer could not read. It is off by default because it spends AI credits, and every step it writes is flagged for review.
- Or convert from the repository: npx vera-agent init --import testcafe finds the specs and uploads them through the CI API, which needs Pro or above on Vera's cloud (self-hosted installs include it). The dashboard import works on every plan.
- To take a test back out, open its Export as code menu on the Tests page and choose TestCafe.
Questions
Can Vera import TestCafe tests?
Yes. Fixtures, tests, t.* action chains and t.expect assertions convert deterministically, with no AI credits spent. A fixture's page becomes a goto at the start of each of its tests.
Does Vera run TestCafe?
No. TestCafe is an import source and an export target. Imported tests run on Vera’s own engine, and the export is a TestCafe suite you run in your own project.
What happens to Selector().nth() or .find() chains?
They are not converted. Each statement is reported as unresolved, for manual conversion or opt-in AI conversion.