maheshj01 / flutter-Testing

Automated Testing a Sample Flutter project using Gherkins Language #BDD

Home Page:https://maheshjamdade.medium.com/testing-your-flutter-app-f08ebc54beb9

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flutter Testing using BDD

A Sample Flutter project showing Bloc Architecture and BDD Testing using Gherkins plugin.

  • Clone the project
  • Run flutter pub get
  • Run the tests using dart test_driver/test_config.dart

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Flutter Folder Structure

πŸ“ android
πŸ“ build
πŸ“ ios
πŸ“ assets
> > πŸ“ fonts
> > > πŸ“‘ Raleway-Regular.ttf
> > > πŸ“‘ Raleway-Italic.ttf
> > πŸ“ images
> > > πŸ–ΌοΈ image1.jpg
> > > πŸ–ΌοΈ image2.jpg
> > πŸ“ icons
> > > πŸ–ΌοΈ cloudicon.png
> > > πŸ–ΌοΈ thumbsupicon.png
πŸ“ lib
> πŸ“ bloc
> > πŸ“‘ home_page_bloc.dart
> > πŸ“‘ login_page_bloc.dart
> πŸ“ services
> > πŸ“ sqflite
> > πŸ“ api_manager
> πŸ“ pages
> > πŸ“‘ home_page.dart
> > πŸ“‘ login_page.dart
> πŸ“ models
> > πŸ“‘ user_model.dart
> > πŸ“‘ sample_model.dart
> πŸ“ widgets
> > πŸ“‘ circular_button_widget.dart
> > πŸ“‘ common_widget.dart
> πŸ“ test
> > πŸ“‘ homepagewidget.dart
> > πŸ“‘ custombuttonwidget.dart
> πŸ“ test_driver
> > πŸ“ features
> > > πŸ“‘ login.feature
> > > πŸ“‘ home.feature
> > πŸ“ steps
> > > πŸ“‘ loginstep.dart
> > πŸ“‘ test_config.dart
> πŸ“ const
> > πŸ“‘ color_const.dart
> > πŸ“‘ string_const.dart
🐳 docker
πŸ“‘ jenkins
πŸ“‘ pubspec.yaml
πŸ“‘ Readme.md

--------------------------------------------------------------# Summary #-------------------------------------------------------------

πŸ“ BLOC

we use this folder to manage the state of our widgets across screens. each file in the bloc folder should correspond to a specific page data must flow through pages-->bloc-->services-->models-->pages(ui)

πŸ“ Services

  • πŸ“ Sqflite

    • this folder will contain all the database related stuff CRUD irrespective of the type of database
  • πŸ“ api_manager

    • here we do all the api requests and http calls.

πŸ“ Pages

  • this folder contains all the frontend pages of your application

πŸ“ widgets

  • In this folder we write the custom widgets,that we have to reuse in mutiple pages

πŸ“ models

  • here you write all your pojo/model classes to pass the data objects across screens

πŸ“ test (TDD)

  • this folder is by default created by flutter sdk when we create a new project here we do the widget testing

πŸ“ test_driver (BDD)

πŸ“ steps

  • here we have to write the steps to implement the feature files

πŸ“ features

  • this file contains the features in the gherkins language for the bdd

πŸ“ const

  • this folder contains some string and color files to use them at mutiple places inorder to keep the code clean and have some meaningful strings and colors in the code.

About

Automated Testing a Sample Flutter project using Gherkins Language #BDD

https://maheshjamdade.medium.com/testing-your-flutter-app-f08ebc54beb9


Languages

Language:Dart 87.3%Language:Objective-C 4.5%Language:Gherkin 3.2%Language:Java 3.1%Language:Swift 1.4%Language:Kotlin 0.4%