Skip to main content

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

Wire types shared by the QAFlow in-app agent and driver, including selectors, responses and error codes for Flutter QA.

example/qaflow_protocol_example.dart

// ignore_for_file: avoid_print

import 'dart:convert';

import 'package:qaflow_protocol/qaflow_protocol.dart';

void main() {
  const selector = Selector(text: 'Sign in', enabled: true);
  final request = jsonEncode({'selector': selector.toJson()});
  print('${QaMethod.tap.extensionName} <- $request');

  final reply = jsonEncode(QaResponse.failure(QaErrorCode.notFound, 'No widget matches').toJson());
  final response = QaResponse.fromJson((jsonDecode(reply) as Map).cast<String, Object?>());
  print('ok=${response.ok} code=${response.code?.wire} message=${response.message}');

  final decoded = Selector.fromJson((jsonDecode(request) as Map)['selector'].cast<String, Object?>());
  print('round trip text=${decoded.text}');
}
1
likes
0
points
234
downloads

Publisher

unverified uploader

Weekly Downloads

Wire types shared by the QAFlow in-app agent and driver, including selectors, responses and error codes for Flutter QA.

Topics

#testing #flutter #e2e #automation

License

unknown (license)

More

Packages that depend on qaflow_protocol