test

A command for running Mendix microflow tests and checking the running application in a browser. Microflows are Mendix workflows that contain application logic.

In plain words
What is it for?
Use it to open or reuse a browser session, inspect pages, assert that widgets exist, take screenshots, log in, and close the session.
Why use it?
It combines automated tests with browser checks, helping confirm that both backend workflows and visible pages work.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/mendixlabs/mxcli/test
Clone the repo
git clone --depth 1 https://github.com/mendixlabs/mxcli

Made for: Claude Code.

Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 768 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00013 $0.00768
Opus 5 $0.00006 $0.00384
Sonnet 5 $0.00003 $0.00154
Haiku 4.5 $0.00001 $0.00077

Measured yesterday against content hash 00e3eea72226, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/mendix/test.md · 97 lines

How it starts

The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test App

Verify the running Mendix application using playwright-cli.

Prerequisites

  • App must be running: mxcli docker run -p app.mpr --wait
  • playwright-cli installed (included in devcontainer)

Session lifecycle

Manage the browser session across commands (attach/reuse, check, tear down):

mxcli playwright open -p app.mpr    # open or attach to the session
mxcli playwright status             # is it live? what page?
mxcli playwright close [--all]      # tear down

Typical loop: open once and log in, then iterate mxcli playwright verify … --keep-open.

Quick Start

# Open browser and take snapshot
playwright-cli open http://localhost:8080
playwright-cli snapshot

# Verify a widget exists (page/DOM assertions run in page context -> eval)
playwright-cli eval "() => document.querySelector('.mx-name-widgetName') !== null"

# Take a screenshot
playwright-cli screenshot

# Close when done
playwright-cli close

Login (Security Enabled)

playwright-cli open http://localhost:8080
playwright-cli eval "() => { document.querySelector('#usernameInput').value = 'MxAdmin' }"
playwright-cli eval "() => { document.querySelector('#passwordInput').value = 'AdminPassword1!' }"
playwright-cli eval "() => document.querySelector('#loginButton').click()"
playwright-cli eval "() => new Promise(r => setTimeout(r, 3000))"
playwright-cli state-save mendix-auth

Full Workflow

# 1. Apply MDL changes
mxcli exec changes.mdl -p app.mpr

# 2. Build, start, and wait for runtime
mxcli docker run -p app.mpr --fresh --wait

# 3. Open browser and verify
playwright-cli open http://localhost:8080
playwright-cli snapshot
# ... interact and verify ...

# 4. Verify data persistence
mxcli oql -p app.mpr --json "SELECT Name FROM MyModule.Customer"

# 5. Close browser
playwright-cli close

CI/CD Scripts

For regression testing, capture commands in shell scripts:

# Run a test script
bash tests/verify-customers.sh

# Run all test scripts
for f in tests/verify-*.sh; do bash "$f" || exit 1; done

Read the full file on GitHub · 97 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 97 lines · 13 tokens per session scan A 00e3eea72226

Subscribe to this mod's changes

test is a command published in the GitHub repository mendixlabs/mxcli (115 stars, last pushed 2d ago), licensed Apache-2.0. It adds 13 tokens to every session and 768 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.