flutter-testing-framework

Implements Flutter testing across widget, integration, VM service, and accessibility layers.

Updated May 17, 2026
One-click install
npx skills add https://github.com/irrit-us/agent_misc --skill flutter-testing-framework-irrit-us
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: flutter-testing-framework
Source: https://github.com/irrit-us/agent_misc/tree/main/skills/flutter-testing-framework
Command: npx skills add https://github.com/irrit-us/agent_misc --skill flutter-testing-framework-irrit-us

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires websockets, and includes scripts (resource) and references (resource) components.

What problem does it solve? Flutter projects often lack a coherent testing strategy: teams mix deprecated FlutterDriver code, skip golden file baselines, miss WCAG accessibility violations, and struggle to integrate Flutter test output into CI pipelines or external Python/JS harnesses. This Skill provides a four-layer testing architecture with decision trees, reference guides, and runnable scripts to set up, migrate, and automate Flutter tests correctly. ## Core Features & Use Cases - Four-Layer Test Architecture: Covers flutter_test widget tests, integration_test on-device execution, vm_service VM introspection, and golden file plus WCAG 2.2 accessibility testing with matchesGoldenFile and meetsGuideline. - External Harness Integration: Ships a Python VM service bridge (flutter_debug_bridge.py), a shell test runner, and a converter that transforms flutter test --machine JSON-Lines output into JUnit XML for CI tools. - Migration & Troubleshooting Guides: Includes a FlutterDriver to integration_test migration reference, reusable test helpers (waitForWidget, scrollUntilVisible), and documented failure patterns like missing ensureSemantics or stale goldens. - Use Case: A team migrating from FlutterDriver can follow the migration reference, copy the helper templates, run tests via test_runner.sh in CI mode, and publish JUnit results to GitHub Actions. ## Quick Start Ask the agent to set up Flutter widget and integration tests for your project using the four-layer architecture and wire the results into CI as JUnit XML.

Frequently Asked Questions about flutter-testing-framework

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate from FlutterDriver to integration_test?▼

Remove enableFlutterDriverExtension and the flutter_driver dependency, add integration_test to dev_dependencies, and create a three-line integration_driver.dart entry point. Translate driver.tap to tester.tap plus pumpAndSettle, and replace driver.requestData with direct service calls since tests now run inside the app isolate.

How do I set up golden file testing in Flutter?▼

Wrap the widget under test in a RepaintBoundary, then call expectLater with matchesGoldenFile using the naming convention testFileName.subtestName.variant.png. Load fonts in flutter_test_config.dart to prevent cross-platform drift and regenerate baselines with flutter test --update-goldens.

How do I convert flutter test output to JUnit XML for CI?▼

Run flutter test with the --machine flag to emit JSON-Lines events, then pipe the output into the convert_to_junit.py script with an --output path. The script parses testStart and testDone events and writes JUnit XML consumable by Jenkins, GitHub Actions, and GitLab.

Does Flutter accessibility testing require enabling semantics first?▼

Yes, Flutter does not build the semantics tree by default because of its overhead. Call tester.ensureSemantics() before any meetsGuideline checks, otherwise tap-target, label, and contrast guidelines operate on an empty tree and silently pass.

Why does my Flutter integration test hang or time out?▼

Hangs usually come from infinite animations blocking pumpAndSettle, platform channels calling back into test code, or a stalled frame pipeline. Use pump with explicit durations, connect to the VM service to inspect the isolate stack, and check getVMTimeline for stuck operations.

When should I use a custom vm_service bridge instead of integration_test?▼

Use a vm_service bridge when an external Python or JavaScript harness must drive the Flutter app, when you need isolate-level debugging or Timeline profiling during tests, or when dumping the semantics tree remotely. It requires debug or profile mode and adds WebSocket reconnection complexity.