Skip to main content

A powerful TUI for running custom test cases.

Project description

◆ CaseCraft

GitHub PyPI

Source: https://github.com/Saksham-cmd-tech/caseRunner.git

A terminal-based test case runner for developers. CaseCraft provides a sleek, Tokyo Night-themed interface to test edge cases, validate function outputs, and track your code's behavior—right from the terminal.

Built with Python and Textual, it features lazygit-style keybindings, native terminal transparency, a beautiful boot sequence, and per-file session persistence.


Features

  • Dynamic Boot Sequence: Hacker-style splash screen that automatically checks PyPI for version updates in the background.
  • Native Transparency: Automatically inherits your terminal's background color and opacity.
  • Cross-Platform Execution: Safely evaluates the correct executable environments (e.g. python3 vs python) across macOS, Linux, and Windows.
  • Local Persistence: All your test cases are saved locally inside a .casecraft/ folder in your project.

Installation

CaseCraft is available via pip:

pip install casecraft

Requires Python 3.10+.


Usage

1. Initialization

To start using CaseCraft in your project, simply run the CLI command:

casecraft init

This will generate a hidden .casecraft/ folder in your current directory where all test case data will be safely persisted.

2. Launching the App

Open the dashboard by running:

casecraft

3. Loading a File

Press p to open the Directory Tree modal. Navigate through your project files using the arrow keys and press Enter to select your source file (e.g. src/main.py).
CaseCraft will load your file and assign an empty test suite to it.

4. Adding Test Cases

Press a to open the Add Test Case modal.
Fill in:

  • Label / Name — a short description (e.g. Basic case, Edge: empty list)
  • Input (stdin) — the arguments or data you want to pipe into the program
  • Expected Output — the output you want the program to print

Press ctrl+s to save or Escape to cancel.

5. Running Tests

Action Key
Run all test cases space

6. Managing Test Cases

Action Key
Search /
Add a
Edit selected e
Delete selected d
Switch panels Tab
Quit q

Verdicts

Badge Meaning
AC Accepted — output matches expected
WA Wrong Answer — output differs
TLE Time Limit Exceeded — ran longer than 2 seconds
RE Runtime Error — non-zero exit code or exception

Output comparison normalizes whitespace: trailing spaces and blank lines at the end are ignored.


Session System

  • Every .py file gets its own session stored in .casecraft/sessions.json.
  • Switching to a different file automatically loads that file's test cases.
  • The last opened file is restored on the next launch.
  • Sessions survive app restarts — your test cases are always saved locally to your project workspace.

Project Structure

CaseCraft/
├── pyproject.toml
├── README.md
├── src/
│   └── casecraft/
│       ├── cli.py              ← CLI initialization logic
│       ├── app.py              ← Textual app, UI composition
│       ├── runner.py           ← subprocess execution
│       ├── models.py           ← Data models
│       ├── utils.py            ← session I/O, helpers
│       └── widgets/
│           └── add_modal.py    ← Add / Edit test case modal

Screenshots

Run the app and enjoy the Tokyo Night TUI.


About & Support

CaseCraft is built and maintained by Saksham.

If you encounter any bugs, have feature requests, or want to contribute, please visit the Issue Tracker.


Future Improvements

  • Multi-language support (Node.js, Go, Rust) via configurable run commands
  • Environment variable injection per test case
  • Memory usage tracking alongside runtime
  • ctrl+k command palette
  • Export results as a Markdown or JSON report
  • Configurable timeout per test case
  • Side-by-side character-level diff highlighting

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

casecraft-1.4.13.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

casecraft-1.4.13-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file casecraft-1.4.13.tar.gz.

File metadata

  • Download URL: casecraft-1.4.13.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for casecraft-1.4.13.tar.gz
Algorithm Hash digest
SHA256 14bdeae4297cc39a301a3eafa41b246ad7b03c221ca7492c68d3477260a58913
MD5 163760aef300f5e5f09f8583ad352f4f
BLAKE2b-256 7da2ce6ddf64f27deb16814348029ae36e079776f96020cd7f5e4fc112f8ebc5

See more details on using hashes here.

Provenance

The following attestation bundles were made for casecraft-1.4.13.tar.gz:

Publisher: publish.yml on Saksham-cmd-tech/caseRunner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file casecraft-1.4.13-py3-none-any.whl.

File metadata

  • Download URL: casecraft-1.4.13-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for casecraft-1.4.13-py3-none-any.whl
Algorithm Hash digest
SHA256 9a2db8c8c2958b08ca3533856fa0be6692acf813153f567273ce66edf1972001
MD5 041e97afda0fddca4f27b79cb63beb38
BLAKE2b-256 3431611585804bc53ee67faa646a89ec79c29cf8f05be8f1e9223af0cd1a505f

See more details on using hashes here.

Provenance

The following attestation bundles were made for casecraft-1.4.13-py3-none-any.whl:

Publisher: publish.yml on Saksham-cmd-tech/caseRunner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page