Skip to main content

Framework Support

TestivAI works with any framework that can control Chrome. One SDK, every framework.

Supported Frameworksโ€‹

LanguageFrameworkCapture CallRun Command
JavaScriptCypresscy.witness('name')testivai run "cypress run --browser chrome"
JavaScriptSeleniumawait witness(driver, 'name')testivai run "npx jest tests/"
JavaScriptWebdriverIOawait browser.witness('name')testivai run "npx wdio run wdio.conf.js"
JavaScriptPuppeteerawait witness(page, 'name')testivai run "npx jest tests/"
JavaScriptPlaywrightDedicated SDKnpx playwright test
PythonSelenium + pytestwitness(driver, 'name')testivai run "pytest tests/ -v"
PythonSelenium + unittestwitness(self.driver, 'name')testivai run "python -m unittest discover"
PythonRobot FrameworkWitness nametestivai run "robot tests/"
JavaSelenium + JUnit 5TestivAIWitness.witness(driver, "name")testivai run "mvn test"
JavaSelenium + TestNGTestivAIWitness.witness(driver, "name")testivai run "mvn test"
RubyRSpec + Capybarawitness 'name'testivai run "bundle exec rspec"
RubyCucumber + CapybaraStep: the "name" page looks correcttestivai run "bundle exec cucumber"

Pick your framework from the sidebar to see full setup instructions and a working example.


How the Capture Worksโ€‹

All frameworks call the same underlying mechanism โ€” a global window.testivaiWitness() function injected by the CDP SDK via Chrome's remote debugging protocol. The generated helper file wraps this call in a framework-idiomatic way:

  • JS frameworks โ€” executeScript / evaluate wrapper
  • Python โ€” driver.execute_script() wrapper
  • Java โ€” JavascriptExecutor wrapper
  • Ruby โ€” execute_script wrapper
  • Cypress โ€” native cy.window().invoke() custom command
  • Robot Framework โ€” Execute Javascript keyword wrapper

Chrome Requirementโ€‹

All non-Playwright frameworks require Chrome to start with --remote-debugging-port=9222. The testivai init wizard generates configuration to do this automatically for each framework.

Playwright

Playwright has its own CDP integration built in. Use @testivai/witness-playwright instead of this SDK.