我正在使用Visual Studio,并且我创建了一个脚本文件integration_test.sh。
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/login_test.dart
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/register_test.dart
..
执行测试。我只是运行bash scripts/integration_test.sh
我也在尝试添加launch.json 和task.json 仍然无法弄清楚。一旦一切正常,我会更新答案。
launch.json 的代码
{
"version": "0.2.0",
"configurations": [
{
"name": "Flutter Dev",
"program": "lib/main_dev.dart",
"request": "launch",
"type": "dart"
},
...
{
"name": "Flutter Integration Test",
"preLaunchTask": "IntegrationTest",
}
]
}
task.json 的代码
{
"version": "0.2.0",
"tasks":[
{
"taskName": "IntegrationTest",
"command": "scripts/integration_test.sh",
"isShellCommand": true
}
]
}