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