spot
0.22.0, released 7 weeks ago by pascalwelsch.com
Toolkit for Flutter widget tests with chainable selectors and automatic timeline reports.
What it does
Spot simplifies queries and assertions against the widget tree using a chainable selector API called spot. It visualizes test steps and assertions as an HTML timeline report complete with automatic screenshots.
AI-written summary of version 0.22.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want more readable and chainable widget queries in Flutter widget tests
- You need automatic screenshots and HTML timeline reports for failing tests
Skip it when
- You prefer using standard flutter_test finders and matchers exclusively
Strengths
- Chainable selectors for precise widget queries
- Automatic HTML timeline generation with screenshots on test failure
- Clearer error messages and full widget tree dumps
Weaknesses
- Adds an opinionated testing wrapper over the built-in flutter_test package
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 12
Add spot to dev_dependencies in pubspec.yaml and optionally load app fonts in tests using loadAppFonts().
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:spot/spot.dart';
void main() {
testWidgets('existing Widget test', (tester) async {
await tester.pumpWidget(MyApp());
await act.tap(spot<ElevatedButton>());
spot<Scaffold>().spotText('monde').existsOnce();
});
}Alternatives
Packages that do the same job and could replace spot.
- golden_screenshot
Utilities to automate screenshot generation using Flutter's golden tests.
76Compare - golden_bricks
A font that renders each character as a rectangle for consistent golden tests
48Compare - test_screenshot
Take screenshots during your flutter unit tests for debugging
41Compare
Works with
Packages commonly used together with spot: ones it builds on, ones built on it, and its own family.
- stack_tracespot depends on itProvides parsing, inspection, and readable formatting of Dart stack traces.
- clockspot depends on itA fakeable wrapper for dart:core clock APIs.
- test_apispot depends on itThe user facing API for structuring Dart tests and checking expectations.
- imagespot depends on itPure Dart library to load, manipulate, encode, and decode various image formats.
- cispot depends on itDetect CI environments and inspect CI vendor details in Dart scripts.
- dartxspot depends on itCollection of useful static extension methods for Dart core types.
- checksspot depends on itA framework for checking test expectations against values and building custom expectations.
- jasprspot depends on itA web framework for building websites in Dart with Flutter-like syntax and server-side rendering.