Testing Web Apps
Learn how to set up Munk AI to test your web applications, including local development servers and live sites.
Munk AI supports testing web applications directly out of the box using a headless or headed Chromium browser. You can use it to test both live websites and your local development servers (like Next.js, Nuxt, or Vite).
Prerequisites
Before running any web tests, you need to ensure the underlying browser binaries are installed. Munk AI uses Playwright under the hood for web automation.
Run this command once in your environment:
python -m playwright install chromium
Running a Test against a Web Target
When testing a web application, you must define the platform as web and provide a starting URL.
Using CLI Flags (For quick tests)
If you are using munk run case directly from the CLI, you can specify the target using the --platform and --base-url flags:
munk run case \
--app-id web-demo \
--plan-id my-first-plan \
--case-id docs-navigation \
--platform web \
--base-url http://localhost:3000 \
--headed \
--config ./munk.yaml
Tip: Adding --headed opens a visible browser window, which is highly recommended during local debugging so you can see what the AI is doing.
Using a JSON Request File (Recommended)
For reproducible CI workflows (like verify change or run plan), it is highly recommended to define your target inside the app_target field of your JSON request file:
{
"app_target": {
"app_id": "my-web-app",
"platform": "web",
"web": {
"base_url": "http://127.0.0.1:3000/"
},
"launch_context": {
"browser": "chromium",
"headless": "false"
}
},
"provided_cases": [
{
"case_id": "login-flow",
"intent": "Verify user can log in",
"expected": ["The dashboard is visible"],
"runner_goal": "Click Login, enter test credentials, and submit."
}
]
}
Then run it:
munk verify change --request-file ./verify-request.json --config ./munk.yaml
Current Capabilities
The Web Runtime is actively being developed. Currently, it supports:
- Navigation: Opening URLs and handling redirects.
- Vision & DOM Parsing: Analyzing the page visually and constructing a semantic UI tree.
- Basic Interactions: Clicking, typing, scrolling, and pressing keyboard shortcuts.
- Assertions: Verifying text presence, element visibility, and page transitions.
Note: Complex browser features like multi-tab management, deep iframe inspection, or intercepting network requests are currently out of scope for the MVP stage.
