1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Can I run multiple integration tests with one single config file in Flutter?

Discussão em 'Mobile' iniciado por Stack, Novembro 5, 2024 às 15:43.

  1. Stack

    Stack Membro Participativo

    I am trying to write Flutter integration tests and to run them all with one config file instead of making config file for every single test. Is there any way to do that?

    For now I have login.dart and login_test.dart and so on, for every single test. I know its convention that every config and test file must have the same name, but that's not what I need, more configurable things are welcomed. Thanks in advance.

    This is my config file: login.dart

    import 'package:flutter_driver/driver_extension.dart';
    import 'package:seve/main.dart' as app;

    void main() {
    enableFlutterDriverExtension();
    app.main();
    }


    And test: login_test.dart looks something like this

    import ...

    FlutterDriver driver;

    void main() {
    setUpAll(() async {
    driver = await FlutterDriver.connect();
    });

    tearDownAll(() async {
    if (driver != null) {
    driver.close();
    }
    });

    test('T001loginAsDriverAndVerifyThatDriverIsLogedInTest', () async {
    some_code...
    });
    }


    Now I want to make new test file e.g login_warning.dart and be able to start both tests by calling single config file login.dart. Is that even possible?

    Continue reading...

Compartilhe esta Página