Skip to main content

sayspec_flutter_recorder 0.12.0 copy "sayspec_flutter_recorder: ^0.12.0" to clipboard
sayspec_flutter_recorder: ^0.12.0 copied to clipboard

PlatformAndroid

SaySpec Flutter recording SDK. Emits widget-level interaction evidence that SaySpec turns into Patrol tests.

example/lib/main.dart

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

final GlobalKey recordingSurfaceKey = GlobalKey();

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await SaySpecRecorder.instance.initializeFromEnvironment(
    appId: 'dev.sayspec.recorder_example',
    screenshotBoundaryKey: recordingSurfaceKey,
  );
  runApp(const RecorderExample());
}

class RecorderExample extends StatelessWidget {
  const RecorderExample({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorObservers: <NavigatorObserver>[SaySpecRecorder.instance],
      builder: (BuildContext context, Widget? child) => RepaintBoundary(
        key: recordingSurfaceKey,
        child: child ?? const SizedBox.shrink(),
      ),
      home: const _CounterPage(),
    );
  }
}

class _CounterPage extends StatefulWidget {
  const _CounterPage();

  @override
  State<_CounterPage> createState() => _CounterPageState();
}

class _CounterPageState extends State<_CounterPage> {
  int count = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Recorder example')),
      body: Center(
        child: Text(
          'Count: $count',
          key: const ValueKey<String>('counter_value'),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        key: const ValueKey<String>('counter_increment'),
        onPressed: () {
          setState(() => count += 1);
          SaySpecRecorder.instance.mark('counter incremented');
        },
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
0
likes
160
points
2
downloads

Documentation

API reference

Publisher

verified publisherjoe-it-solutions.com

Weekly Downloads

SaySpec Flutter recording SDK. Emits widget-level interaction evidence that SaySpec turns into Patrol tests.

Homepage

Topics

#testing #flutter #automation #qa

License

BSD-3-Clause (license)

Dependencies

flutter, http

More

Packages that depend on sayspec_flutter_recorder