QAlprit (qalprit)
Mobile QA. Bugs caught with proof.
QAlprit is a deterministic, Markdown-driven mobile UI test automation framework for native Android and iOS applications powered by Appium 2.
Every test run produces verifiable visual and structural proof—step-by-step screenshots, masked failure XML dumps, Appium logs, and self-contained HTML reports—with zero LLM calls at runtime and in-memory secret redaction before any image touches disk.
Why QAlprit?
- 100% Deterministic Execution — Zero runtime LLM calls or flaky AI guesswork. Test steps compile directly into Appium 2 actions with automatic element readiness polling.
- QA-Friendly Markdown Specs — Author tests as Markdown files with YAML front matter under
specs/, compose 1-level reusableflows/, and keep shared cross-platform locators inscreens/screens.yaml. - Security-First Evidence Pipeline —
.envsubstitution and RFC 6238${TOTP:VAR}generation run purely in Python stdlib. Secrets are masked across logs, JSON, XML, and HTML reports, while Pillow black-fillssecret: trueandsensitive: truebounding boxes in memory (scaled to Retina/device pixels) before writing PNGs to disk. - Self-Contained Proof Reports & Workbench UI — Generates a single portable
report.html(Pillow-compressed WebP/JPEG screenshots with interactive lightbox, or--external-assets),summary.mdfor PR comments,results.json, and includes a localqalprit uiworkbench plus a static Web UI inweb/ready for Vercel. - Guaranteed Cleanup & Target Gating —
teardown:steps execute even after mid-test failures; simulator-only steps likebiometricare cleanly skipped on real devices.
Architecture
Editable Draw.io source: docs/architecture.drawio
Layer-by-Layer Breakdown
- Authoring & Configuration
specs/**/*.md: Test cases written in Markdown with YAML front matter (id,title,platforms,targets,reset,steps,teardown,expected).flows/**/*.md: Reusable 1-level-deep step sequences invoked viarun_flowwith${param}interpolation (nested flows are rejected at validation time).screens/screens.yaml: Logical<screen>.<element>locator catalog supporting sharedaccessibility_id, per-platformandroid/iosoverrides, parameterized{name}templates, andsensitive: truescreenshot redaction markers.config/&.env:devices.yamlprofiles,environments.yamlapp package/bundle IDs & timeouts, plus local.envsecrets and RFC 6238${TOTP:VAR}authenticator codes.
- Deterministic Execution Core (
src/qalprit/)cli.py: Click CLI (doctor,devices,inspect,validate,run,report,ui).validator.py: Fail-fast pre-flight validation of step vocabulary, 1-level flows, locator targets, template parameters, and environment variables—no device required.runner.py&steps/: Reuses one Appium 2 session across compatible tests, appliesreinstall/clear_data/nonereset strategies, polls for element readiness, tracks--retries/flakystatus, and guaranteesteardown:.appium_manager.py: Auto-starts and stops a local Appium 2 subprocess (auto-detectingANDROID_HOME,JAVA_HOME, and free ports) or attaches to an existing server via--appium-url.
- Appium 2 & Native Targets
- Drives Android emulators/devices (
UiAutomator2,.apk,adb shell pm clear) and iOS simulators/devices on macOS (XCUITest,.app/.ipa,xcrun simctl).
- Drives Android emulators/devices (
- In-Memory Evidence Redaction & Reporting
evidence.py: Captures raw PNG bytes in memory, scales Appium element bounds byscreenshot_width / window_width, black-fills sensitive fields via Pillow, scrubs strings viaSecretMasker, and flags embedded WebViews (C8).report/generator.py&ui_server.py: Rendersreport.html,summary.md, and powers the localqalprit uiworkbench server.
Quick Start
Install
pip install qalprit
Or install from source for local development:
git clone https://github.com/vattitude-me/QAlprit.git
cd QAlprit
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Validate & Run
# 1. Copy sample environment variables (never commit .env)
cp config/env.example .env
# 2. Check OS prerequisites (Node, Appium 2, drivers, JDK 17+, Android SDK, Xcode on macOS)
qalprit doctor
# 3. List connected Android devices/AVDs and iOS simulators
qalprit devices
# 4. Validate specs, flows, locators, and env vars without needing a device
qalprit validate --suite mda --env mda
# 5. Run a suite against an Android APK (Appium 2 auto-started and stopped)
qalprit run --platform android --device android_emulator --app /path/to/app.apk --env mda --suite mda
# 6. Open the local Workbench UI to browse runs, proof reports, specs, and sensitive locators
qalprit ui
Sample Output & End-to-End MDA Process
Want to see what a real run produces before connecting a device? Explore the published sample run from the Sauce Labs My Demo App (mda suite, 5/5 passed on Android 15):
- Sample Proof Report Directory — Contains
summary.md, sanitizedresults.json, and self-containedreport.html(download & open in any browser, or browse live at/sample-reporton the Vercel site).
|
MDA-002 — Password field black-filled in memory before save; locked-out banner verified. |
MDA-004 — Card Number & Security Code ( sensitive: true) black-filled in memory; cardholder & expiry kept readable.
|
Step-by-Step Process for Any App Under Test
- Install & Verify Tooling: Run
pip install qalprit && qalprit doctorto confirm Node, Appium 2 (uiautomator2/xcuitest), Java, and Android/iOS SDKs. - Add App Binary Locally: Place your
.apkor.app/.ipainsideapps/(ignored by git). For the sample suite, downloadmda-2.3.0-27.apkfrom Sauce Labs My Demo App Android. - Configure Secrets (
config/env.example->.env): Copyconfig/env.exampleto.envso${VAR}credentials and${TOTP:VAR}secrets resolve at runtime without ever touching git or logs. - Inspect & Map Screens: Run
qalprit inspect --platform androidagainst a live screen (or--from-xml) to populatescreens/screens.yamland mark PII/payment/password fields withsensitive: true. - Author Specs & Validate Offline: Write Markdown specs under
specs/<suite>/and shared 1-level flows underflows/, then runqalprit validate --suite mda --env mdato catch missing locators, params, or env vars in under a second. - Execute & Inspect Proof: Run
qalprit run --platform android --device android_emulator --app apps/mda-2.3.0-27.apk --env mda --suite mda, then reviewresults/<run-id>/report.html, pastesummary.mdinto PRs, or launchqalprit ui.
CLI Commands
| Command | Purpose |
|---|---|
qalprit doctor [--json-output] |
OS-aware prerequisite check (skips Xcode on Linux/Windows). |
qalprit devices |
List connected Android adb devices, AVDs, and iOS simulators. |
qalprit inspect --platform android|ios [--device <profile>] [--from-xml <file>] |
Dump addressable UI elements, flag WebViews, and emit starter screens.yaml. |
qalprit validate [--suite <name>] [--env <name>] [--platform android|ios] [--tag <tag>] |
Fail-fast schema, flow, locator, template param, and env var validation. |
qalprit run --platform android|ios --device <profile> --app <path> [options] |
Execute specs (--env, --suite, --tags, --retries, --appium-url, --external-assets). |
qalprit report <results-dir> [--external-assets] |
Regenerate report.html and summary.md from an existing results.json. |
qalprit ui [--port 8765] [--results-dir results] [--no-open] |
Launch the local QAlprit Workbench web UI. |
User Interfaces
- Self-Contained Proof Report (
report.html) — Generated per run inresults/<run-id>/report.htmlwith KPI cards, status/tag/text filters, expanded flow badges, failure XML inspection, and a modal screenshot lightbox. - Local Workbench (
qalprit ui) — Zero-dependency Python HTTP server for browsing historical runs, opening proof reports, and auditingsensitive: truescreen locators. - Web Showcase & Interactive Demo (
web/) — Static web application configured viavercel.jsonfor instant Vercel deployment with an interactive Proof Report Viewer and Spec Studio.
Repository Structure
QAlprit/
├── config/
│ ├── devices.yaml # Named Android/iOS emulator & device profiles
│ ├── environments.yaml # Per-env package/bundle IDs and timeouts
│ └── env.example # Sample .env variables (copy to .env locally)
├── docs/
│ ├── architecture.drawio # Editable Draw.io architecture diagram
│ ├── architecture.svg # Exported architecture vector diagram
│ ├── authoring-guide.md # QA step vocabulary, worked examples & iOS Keychain note
│ ├── copilot-conversion-prompt.md
│ └── logo/
│ ├── qalprit-logo.png # Raster brand logo (1024x1024 PNG)
│ └── qalprit-logo.svg # Vector brand logo SVG
├── examples/
│ └── mda-sample-run/ # Published 5/5 Sauce Labs MDA sample report, JSON & previews
├── flows/ # 1-level reusable Markdown flows
├── screens/
│ └── screens.yaml # Logical locators & sensitive: true redaction markers
├── specs/ # Test suites (mda/, regression/)
├── src/qalprit/ # Core Python package, steps, evidence, report & UI server
├── tests/ # Unit tests (FakeDriver, Pillow redaction, validator, UI)
├── web/ # Vercel-ready web showcase & interactive proof demo
├── pyproject.toml
└── vercel.json
Documentation & Community
- QA Authoring Guide — Complete step vocabulary, worked examples, locator strategy, and iOS Keychain reset caveat.
- Copilot Confluence Conversion Prompt — Prompt template and review checklist for converting manual test plans.
- Contributing Guide
- Security Policy
- Code of Conduct
Running Tests
pytest -v
License
Released under the MIT License.
Metadata
Release files for qalprit 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qalprit-0.1.0.tar.gz | 66.8 kB | Without provenance | Details for qalprit-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qalprit-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for qalprit-0.1.0-py3-none-any.whl |
Total release size: 130.3 kB
Release files / qalprit-0.1.0.tar.gz
| Download URL | qalprit-0.1.0.tar.gz |
|---|---|
| Size | 66.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de67ecce3d739aad4ddbabab5c1a2bc14dbe0ac900c89911f8667c90e36ba530
|
|
BLAKE2b-256 checksum How to use checksums |
a7ab038a3e42f8b686762bb786a27b04f67c4a7189c732e16f70dd561242bc66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / qalprit-0.1.0-py3-none-any.whl
| Download URL | qalprit-0.1.0-py3-none-any.whl |
|---|---|
| Size | 63.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad65a605334fd7191fe1ef818e5035e35845da71315d175253a9f8636f8787b2
|
|
BLAKE2b-256 checksum How to use checksums |
28b6423f780107eae0456db05de5b3fb356036fb1dccfb6158e1a0cf3e529266
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for qalprit 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.