WebdriverIO and Vera: import specs, export tests
One deterministic converter reads both WebdriverIO specs and plain JavaScript selenium-webdriver scripts, because real suites mix the two. Each it() becomes a Vera test and the common browser, element and expect-webdriverio calls become steps. Any Vera test exports back as a single-file WebdriverIO spec.
What comes across
- The WebdriverIO converter is deterministic: the same file gives the same tests, with no AI call and no AI credits spent.
- Each it(), specify() or test() inside describe(), context() or suite() becomes one Vera test.
- browser.url() and navigateTo() become goto steps.
- $(selector) calls — click, setValue, addValue, clearValue, selectByVisibleText, moveTo and waitForDisplayed — become click, fill, select, hover and wait steps.
- expect-webdriverio matchers toBeDisplayed, toBeExisting, toHaveText, toContainText and toHaveValue become assertions.
- JavaScript selenium-webdriver is read by the same converter: driver.get() and driver.findElement(By.css/id/name/className(…)) with click or sendKeys.
- On export, a test downloads as a .e2e.js file: a Mocha describe/it block driving browser.url() and $(…).setValue().
What does not
- Custom commands, page objects, chained or dynamic selectors and non-literal arguments are not converted. Each statement is listed as a warning for manual or AI conversion, never silently dropped.
- By.linkText() is approximated as a text= match and flagged with a warning to verify.
- Setup and teardown hooks (beforeEach and friends) are skipped with a warning; re-add the setup to each test, or factor it into one reusable flow.
- On export, an accessibility-audit step becomes a TODO: WebdriverIO has no built-in equivalent, so @axe-core/webdriverio has to be wired up by hand.
- On export, a step with no WebdriverIO equivalent becomes a TODO comment at the spot it stood, rather than being dropped.
How to set it up
- Open a project's Tests page and choose Import tests, then pick your spec 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 wdio 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 WebdriverIO.
Questions
Can Vera import WebdriverIO tests?
Yes, deterministically. browser.url, $(selector) actions, waitForDisplayed and expect-webdriverio matchers map onto Vera steps, one test per it() block.
Does the WebdriverIO importer read selenium-webdriver scripts?
Yes. JavaScript selenium-webdriver uses the same converter: driver.get and driver.findElement(By…) calls become steps, and a flat script with no it() blocks becomes one test.
Can I export Vera tests to WebdriverIO?
Yes. Any test exports as a single-file .e2e.js WebdriverIO spec. Steps with no WebdriverIO equivalent become TODO comments and are listed as warnings.