Skip to main content

qaflow_agent 0.1.0 copy "qaflow_agent: ^0.1.0" to clipboard
qaflow_agent: ^0.1.0 copied to clipboard

In-app agent for QAFlow that exposes ext.qa.* VM service extensions so flows can drive a Flutter app.

qaflow_agent #

The in-app half of QAFlow. It registers ext.qa.* service extensions on the Dart VM service so the qaflow driver can find widgets, tap, type, scroll and take screenshots in a running debug or profile build.

Add it as a normal dependency, not a dev dependency: lib/main_qa.dart lives in lib/ and imports it. It still stays out of release builds, for two reasons. The driver launches the separate lib/main_qa.dart entrypoint, and your lib/main.dart, which release builds compile, never imports the agent. And QaAgent.install() throws when kReleaseMode is true, so even a release build of main_qa.dart refuses to register anything.

Install #

flutter pub add qaflow_agent

Create lib/main_qa.dart next to your normal lib/main.dart:

import 'package:flutter/material.dart';
import 'package:qaflow_agent/qaflow_agent.dart';

void main() {
  QaAgent.install();
  runApp(QaAgent.wrap(const MyApp()));
}

Pass onReset to QaAgent.install to clear your app's persisted state when a flow asks for a clean start. Then run flows with the qa CLI from the qaflow package.

See example/lib/main.dart. In your app it is lib/main_qa.dart; the example names it main.dart so pub.dev shows it.

More #

QAFlow is three packages: this one goes in the app under test, qaflow runs the flows and provides the qa command, and qaflow_protocol holds the messages they share.

1
likes
0
points
239
downloads

Publisher

unverified uploader

Weekly Downloads

In-app agent for QAFlow that exposes ext.qa.* VM service extensions so flows can drive a Flutter app.

Topics

#testing #flutter #e2e #automation

License

unknown (license)

Dependencies

flutter, qaflow_protocol

More

Packages that depend on qaflow_agent