Skip to content

Software Development at Program Tom LTD

Place for coding, programming, development and software in general.

Menu
  • Blog
  • PDF Booklets
  • Dev Utils & Content
  • Java Spring Boot Or Web Apps
  • English
    • български
    • English
    • Español
    • Português
    • हिन्दी
    • Русский
    • Deutsch
    • Français
    • Italiano
    • العربية
  • About Us
Menu
Flutter Tests

Flutter Tests

Posted on September 29, 2024 by Toma Velev

There are several types of Flutter Tests that you could use to verify different aspects of your logic in your applications.

Unit Tests

Similar to unit tests in other programming languages, these tests isolate individual units of code (e.g., functions or classes) to ensure they work correctly. They’re useful for testing business logic, API calls, and other non-widget-related code.  Unit Tests – test small functionality that has strict input-output requirements. Great Examples may be – business calculations, encryption, etc

BloC Tests

In many cases the business logic is hard to be extracted as Services. BloC Tests are unit tests that verify the changes in the stream that is transfered from the Controller to the UI. There are of course different variations of MVC/BloC, but BloC is one of the most popular. Bloc tests – verify expected state of BlocState during/before/after BloC Events.

Widget Tests

These tests verify that widgets behave as expected when interacting with them programmatically. They’re written using the flutter_test package and allow for testing of widget logic, such as button clicks, text input, and scrolling. Widget Tests – for testing the presence in the tree – the UI elements you are building.

Golden Tests

The golden toolkit is discontinued package https://pub.dev/packages/golden_toolkit. Most probably someone will pick it up and continue development. Golden Tests – test pixel perfect output of your widgets onto phones, tablets, etc – with png files. It is typical to verify the common 4 states in a screen

  • loading
  • error
  • empty
  • loaded

The tests described so far you execute in command line mode and do not need an emulator or virtual machine. For next – level verification – you could assert logic and UI when your app is runing on top of simulators.

Integration Tests

These tests could check the state of your app – when it runs on emulator – with less mocked layers. https://github.com/flutter/flutter/tree/main/packages/integration_test. They are executed with drivers – that bridge the Test Verification logic inside the Flutter Engine.

UI Test Automation

Taking advanges of the same idea are the different implementation of the UI testing tools. This type of testing uses tools like Appium, Espresso or Patrol to automate UI interactions, such as scrolling, tapping, and entering text. These tests can help ensure that your app’s UI works correctly across different devices and platforms.

  • Join iOS Beta Testing Explained
  • Firebase App Distribution Setup
  • iOS App Lifetime Unverified
  • Flutter Bottom Border
  • Get Flutter current time zone

Categories

  • Apps (25)
  • ChatGPT (24)
  • Choosing a Framework (38)
  • Flutter (279)
  • Graphical User Interface (14)
  • Marketing (118)
  • Software Development (288)
  • Spring (45)
  • StartUp (22)
  • Uncategorized (4)
  • Uncategorized (14)
  • Vaadin (15)

Tags

Algorithms (9) crypto (29) flutterdev (39) General (86) Java (7) QR & Bar Codes (3) Software Dev Choices (33) Spring Boot (1) standards (1) Theme (3) User Authentication & Authorization (9) User Experience (10) Utilities (19) WordPress (11)

Product categories

  • All Technologies (86)
    • Flutter Apps (26)
    • GPT (4)
    • Java (38)
    • Native Android (3)
    • PHP (9)
    • Spring (Boot) / Quarkus (35)
    • Utils (15)
    • Vaadin 24+ (27)
    • Vaadin 8 (1)
  • Apps (18)
    • Employees DB (1)
    • Notes (6)
    • Personal Budget (1)
    • Recipes Book (1)
    • Stuff Organizer (1)
    • To-Do (2)
  • PDF Books (3)
  • Source Code Generators (8)

Recent Posts

  • Join iOS Beta Testing Explained
  • Firebase App Distribution Setup
  • iOS App Lifetime Unverified
  • Flutter Bottom Border
  • Get Flutter current time zone

Post Categories

  • Apps (25)
  • ChatGPT (24)
  • Choosing a Framework (38)
  • Flutter (279)
  • Graphical User Interface (14)
  • Marketing (118)
  • Software Development (288)
  • Spring (45)
  • StartUp (22)
  • Uncategorized (4)
  • Uncategorized (14)
  • Vaadin (15)