我尝试使用patrol 1.0.8包在flutter中运行集成测试。然后我在ios物理设备上使用命令patrol test integration_test/classic_process_test.dart --verbose
运行测试时出错。
错误为Error: No .xctestrun file was found at ~/projectName/build/ios_integ/Build/Products
下面是我的代码:
import 'package: projectName/main.dart';
import 'package:patrol/patrol.dart';
void main() async{
patrolTest('Test classic account process', nativeAutomation: true, (PatrolTester $) async{
await $.pumpWidgetAndSettle(MyApp());
await $(#slide1).scrollTo(duration: Duration(seconds: 1), step: -300, maxScrolls: 0);
await $(#slide2).scrollTo(duration: Duration(seconds: 1), step: -300, maxScrolls: 300);
await $(#slide3).tap();
await $(#KeysStrings.I_AM_NEW).tap();
await $(#KeysStrings.LASTNAME_KEY).enterText("Babacar");
await $(#KeysStrings.FIRSTNAME_KEY).enterText("Test auto");
await $(#KeysStrings.PHONE_NUMBER_KEY).enterText("760123456");
await $(#KeysStrings.SUBMIT_REGISTER_FORM_KEY).tap();
await $(#KeysStrings.TAKE_HOME_PICTURE_KEY).tap();
await $(#KeysStrings.HAVE_HOME_NUMBER).tap();
await $(#KeysStrings.HOME_NUMBER_FIELD_KEY).enterText("122e");
await $(#KeysStrings.SUBMIT_HOME_NUMBER_KEY).tap();
await Future.delayed(Duration(seconds: 10));
await $(#KeysStrings.GENERATE_ADDRESS_BUTTON_KEY).tap();
await Future.delayed(Duration(seconds: 3));
await Future.delayed(Duration(seconds: 10));
await $(#KeysStrings.GET_PLATE_BUTTON_KEY1).tap();
await $(#KeysStrings.CHOOSE_PAYMENT_MOMENT).tap();
await $(#KeysStrings.CHOOSE_PAYMENT_METHOD).tap();
await $(#KeysStrings.VALIDATE_PAYMENT_BUTTON).tap();
await $(#KeysStrings.CONTINUE_AFTER_ENTER_AMOUNT).tap();
});
}
提前感谢您的帮助!
1条答案
按热度按时间jk9hmnmh1#
这是
patrol_cli
中的一个bug。here也报告了这个bug。自patrol_cli v1.1.1起已修复。运行
patrol update
以确保您使用的是最新的patrol_cli
版本。