Flutter 集成测试未使用flavor运行
我正在运行与颤振应用程序的集成测试。我还在颤振中使用Flutter 集成测试未使用flavor运行,flutter,integration-testing,Flutter,Integration Testing,我正在运行与颤振应用程序的集成测试。我还在颤振中使用口味。问题是它给了我这个错误: Gradle build failed to produce an .apk file. It's likely that this file was generated under /home/khamidjon/Desktop/android_flutter_projects/soter-task-2/build, but the tool couldn't find it. 我已将所有依赖项放入pubsp
口味。问题是它给了我这个错误:
Gradle build failed to produce an .apk file. It's likely that this file was generated under /home/khamidjon/Desktop/android_flutter_projects/soter-task-2/build, but the tool couldn't find it.
我已将所有依赖项放入pubspec.yaml
中
创建了3个目录,如文档所述:集成\测试/、测试\驱动程序/、测试/
测试\驱动程序/集成\测试.dart:
import 'package:integration_test/integration_test_driver.dart';
Future<void> main() => integrationDriver();
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets("failing test example", (WidgetTester tester) async {
expect(2 + 2, equals(5));
});
}
然后在终端中运行以下命令:
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/main_functions_test.dart
因为您使用的是口味,所以需要指定要运行应用程序的口味:
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/main_functions_test.dart --flavor development