Giter Club home page Giter Club logo

welltested's Introduction

welltested

Welltested is an AI testing autopilot for Flutter developers add and maintain intelligent tests coverage and deliver stable welltested apps to users.

Generate and Configure API Key

🗝️ Generate API Key

Welltested is completely free for individual developers. To create an account, please sign up here.

⚙️ Configure API Key

Create a .env file in root of your project, and add your key received in the email.

WELLTESTED_API=YOUR_API_KEY

We uses dotenv to retrive API Key. Once .env file is created, please declare it as an asset in pubspec.yaml to make is accessible to the package.

assets:
  - .env

Let's create tests

Add the @Welltested() annotation to the class whose methods are to be tested.

@Welltested()
class Auth {
    Future<void> logInUser() {...}
    Future<void> logOutUser() {...}
}

In the above case, it will generate unit tests for logInUser and logOutUser methods of Auth class.

Exclude Methods

By default, all methods in an annotated class are included. To exclude any method from testing, add their name to the excludedMethods list in the Welltested annotation.

@Welltested(excludedMethods: ['logOutUser'])
class Auth {
    Future<void> logInUser() {...}
    Future<void> logOutUser() {...}
}

In the above case, it will not create unit tests for logOutUser method.

Custom Testcases

To specify custom testcases for any method, use @Testcases() annotation.

@Welltested()
class Auth {
    @Testcases(['Throws exception when email is empty'])
    Future<User> logInUser() {...}
}

Generate Tests

To generate unit tests for annotated classes, please run the following command:

dart run welltested:ai build

Saving Tests

At times, tests generated by welltested might have syntax issues. When encountering such issues, please makes the fixes and run the below command to save your changes. We remember your fixes and don't repeat the mistake.

dart run welltested:save build

USAGE WIKI

To read detailed setup instructions, code guidelines and supported platform infromation, read our Usage Wiki.

NOTE

  1. The minimum supported Flutter SDK version is 3.0.0 with Dart SDK 2.17.0. Any prior projects need to be upgraded for welltested to work.

For complete Example please check example project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.