๐Ÿš€ 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! ๐Ÿš€