Skip to main content
TestScript

TestScript

A typed testing language for Web and API automation. Python interpreter · Lark grammar · .tscr files · tscr CLI.

User Guide · Language Reference · Examples · Español

Version CI

0.2.0 / experimental. The implementation and language specification evolve together. Not yet published on PyPI. The PyPI name testscript belongs to an unrelated project; this distribution uses testscript-lang.

Install from source

Python 3.12+:

git clone https://github.com/angel-valdezzz/testscript.git
cd testscript
python -m pip install .
tscr --version
tscr check examples/core.tscr
tscr run examples/core.tscr

For browser automation:

python -m pip install ".[playwright]"
python -m playwright install chromium

Or python -m pip install ".[selenium]" with Chrome available. API and core examples do not need a browser.

A small language with a testing purpose

flow verifyName(name: String) {
    step "Validate the name" {
        expect len(name) > 0
    }
}

test "A valid user" tags ["smoke"] {
    verifyName("Angel")
}
  • test: discoverable execution unit.
  • flow: reusable behavior; can compose flows and return values.
  • fn: pure data computation; no browser/HTTP/observability effects.
  • fixture: setup and teardown, including cleanup after setup failure.
  • record: typed immutable fields.
  • data: CSV/JSON/YAML parameterization; one result per row.
  • step: a named section in the execution timeline.
  • expect: assertions; catching an assertion does not erase its failure.

Commands

Command Purpose
tscr check tests/ Syntax, names, types and effect checks
tscr lint tests/ --flows-only Semantic checks + optional naming/architecture warnings
tscr list tests/ --tag smoke Discover and filter tests
tscr run tests/ --provider playwright Run with JSON, JUnit XML and standalone HTML results

Repeat --tag for OR inclusion; repeat --exclude-tag to exclude any matching tag. --name is a case-sensitive title substring. Exit codes: 0 passed/skipped, 1 test failure, 2 invalid input/configuration, 5 no tests selected.

Development

python -m pip install -e ".[dev,playwright,selenium]"
python -m pytest
python -m ruff check src tests
python scripts/check_docs.py
python scripts/build_docs.py
python -m build

See specification, architecture, roadmap and contributing.

Credits

Built on Python, Lark, HTTPX, PyYAML, Playwright/Selenium and MkDocs Material. TestScript is an independent project; it is not affiliated with these projects or the existing PyPI package named testscript.

MIT · Angel Gerardo Molina Valdez

Metadata

Release files for testscript-lang 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for testscript-lang 0.2.0
File Size Uploaded
testscript_lang-0.2.0.tar.gz 32.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for testscript-lang 0.2.0
File Interpreter ABI Platform
testscript_lang-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 60.9 kB

Release files / testscript_lang-0.2.0.tar.gz

Download URL testscript_lang-0.2.0.tar.gz
Size 32.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4bca3c65bfd039bfa56ba110990b072d52ffd5413e59da454cac412464d6f796
BLAKE2b-256 checksum
How to use checksums
41ab22e0e0aa5a257de7d2bd05d19161a7449178fdfd819cea547c8bc774c2e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / testscript_lang-0.2.0-py3-none-any.whl

Download URL testscript_lang-0.2.0-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
799c6cf88bb12f0c762d72d13b641dc37d1c0ffab0fb8dddec1cc4a560c6b0bd
BLAKE2b-256 checksum
How to use checksums
e775904286a001cef38dfdc83b3cd2888b5542e6ca3d85b19154b748eaf13443
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page