且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我可以在Flutter中使用一个配置文件运行多个集成测试吗?

更新时间:2022-12-08 16:33:28

是的,可以使用相同的配置"运行多个测试"文件.

Yes, running multiple "test" files with the same "config" is possible.

在通俗易懂的行话中,您的配置文件是您的 target ,而您的测试文件是您的 driver .您的目标始终是login.dart,但是您有两个驱动程序login_test.dartlogin_warning.dart.

In the flutter jargon, your config file is your target and your test file is your driver. Your target is always login.dart but you have the two drivers login_test.dart and login_warning.dart.

使用flutter drive命令,您可以指定targetdriver.

With the flutter drive command, you can specify the target as well as the driver.

因此,要运行两个驱动程序,只需执行以下命令

So in order to run both drivers, simply execute the following commands

flutter drive --target=test_driver/login.dart --driver=test_driver/login_test.dart
flutter drive --target=test_driver/login.dart --driver=test_driver/login_warning.dart

这首先执行login_test.dart,然后执行login_warning.dart驱动程序.

This executes first the login_test.dart and then the login_warning.dart driver.