Skip to main content
The testorim package runs Testorim tests from Python code and adds a pytest plugin, so a real-browser check can sit next to your other tests and fail the build the same way. It has no dependencies and needs Python 3.9 or newer.
Create an API key in Testorim under Settings → API keys and put it in TESTORIM_API_KEY. See Authentication for what a key may change.

From code

run_test starts the run and waits for the verdict (up to 10 minutes by default). Other calls:
A run has a verdict (passed, failed or needs_review; None while it runs or when cancelled), the step counts, the written report, failed_steps (each with the reason and blame: app, test, unsupported or internal), the run’s url, and links to the video, Playwright trace and final screenshot, which expire an hour after they were read. summary() leaves those links out because it often lands in CI logs.

In pytest

Installing the package adds a testorim fixture and a testorim marker:
  • Run only these tests with pytest -m testorim, or leave them out with pytest -m "not testorim".
  • --testorim-base-url URL points every run made through the fixture at another address, such as a pull request’s preview.
  • Without an API key the test fails with a message saying how to create one; set TESTORIM_SKIP_WITHOUT_KEY=1 to skip instead (useful for pull requests from forks, which get no secrets).
A failed run fails the test with its summary:

In GitHub Actions

Put your preview’s real address in --testorim-base-url, and make sure the preview is deployed before the job runs. A saved test that types a saved password replays only on its project’s own host or one of the project’s environments.

Errors

Every exception derives from TestorimError. The ones you will meet: The client never retries a trigger by itself, because a retried trigger is a second run. If your workspace lives on another host, set TESTORIM_API_URL. The full reference is on the package’s PyPI page.

Limits

  • The site must be reachable from the internet: Testorim’s browsers refuse localhost and private addresses.
  • Every run counts against your plan, whichever tool started it.
  • For coding agents, use the MCP server instead; for JavaScript or TypeScript test suites, the library; for shell scripts and other CI, the CLI.