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! π