zeba_academy_widget_tester_plus 0.0.1
zeba_academy_widget_tester_plus: ^0.0.1 copied to clipboard
A powerful and lightweight Flutter testing framework that simplifies widget testing with visual builders, interaction helpers, snapshot testing, and debug logging.
๐ zeba_academy_widget_tester_plus #
A powerful yet lightweight Flutter package that simplifies widget testing with visual builders, interaction helpers, snapshot testing, and debug logging โ all in one place.
โจ Features #
- ๐งช Simplified Testing System โ Clean and structured test execution
- ๐ Interaction Testing โ Easy APIs for tap, scroll, and text input
- ๐ธ Snapshot Testing โ Save and compare widget states
- ๐จ Visual Test Builder โ Build multiple UI scenarios effortlessly
- ๐งพ Debug Logs โ Centralized logging for test debugging
๐ฆ Installation #
Add this to your pubspec.yaml:
dev_dependencies:
zeba_academy_widget_tester_plus: ^0.0.1
Then run:
flutter pub get
๐ Getting Started #
Basic Example #
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:zeba_academy_widget_tester_plus/zeba_academy_widget_tester_plus.dart';
void main() {
testWidgets('Button interaction test', (tester) async {
final testerPlus = TesterPlus();
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: ElevatedButton(
onPressed: () {},
child: const Text('Tap Me'),
),
),
),
);
final interaction = InteractionTester(tester);
await testerPlus.runTest(
name: "Tap Button Test",
tester: tester,
callback: (tester) async {
await interaction.tap(find.text('Tap Me'));
},
);
expect(testerPlus.results.first.success, true);
});
}
๐งช Core Components #
๐น TesterPlus #
Handles execution and tracks test results.
๐น InteractionTester #
Provides helper methods for UI interactions.
๐น SnapshotManager #
Stores and compares widget snapshots.
๐น VisualTestBuilder #
Build multiple UI test scenarios easily.
๐น DebugLogger #
Logs test execution details.
๐ธ Snapshot Testing Example #
final result = SnapshotManager.compare("home_screen", newImage);
๐จ Visual Test Builder Example #
final builder = VisualTestBuilder()
..addScenario(MyWidget())
..addScenario(MyWidget(darkMode: true));
final scenarios = builder.build();
๐งพ Debug Logs #
DebugLogger.log("Test started");
๐ Project Structure #
lib/
โโโ zeba_academy_widget_tester_plus.dart
โโโ src/
โโโ core/
โโโ builder/
โโโ models/
๐ Roadmap #
- โ Golden test integration
- โ Pixel-perfect snapshot comparison
- โ HTML test reports
- โ CLI runner
- โ CI/CD support
๐ License (GPL v3) #
This project is licensed under the GNU General Public License v3.0.
๐จโ๐ป About Me #
โจ Iโm Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects. You can learn more about me and my work at sufyanism.com or connect with me on Linkedin
๐ Your all-in-one no-bloat hub! #
๐ Explore cutting-edge resources in coding, tech, and development at zeba.academy and code.zeba.academy. Empower yourself with practical skills through curated directives, real-world projects, and hands-on experience. Level up your tech game today! ๐ปโจ
Zeba Academy is a learning platform dedicated to coding, technology, and development. โก Visit our main site: zeba.academy โก Explore hands-on courses and resources at: code.zeba.academy โก Check out our YouTube for more tutorials: zeba.academy โก Follow us on Instagram: zeba.academy
โค๏ธ Support #
If you like this package, give it a โญ on GitHub and share it with the community!
Thank you for visiting! ๐