flutterflutter-dependenciesflutter-integration-testflutter-patrol

Error when running Integration test in Flutter using patrol


I'm trying to run an integration test in flutter using the patrol 1.0.8 package. Then I got an error when running the test with commanded patrol test integration_test/classic_process_test.dart --verbose on ios physical device.

Error is Error: No .xctestrun file was found at ~/projectName/build/ios_integ/Build/Products

Here is my code:

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();
 });
}

Thank you in advance for your help!


Solution

  • This was a bug in patrol_cli. It was also reported here.

    It's been fixed since patrol_cli v1.1.1. Run patrol update to make sure you're on the latest patrol_cli version.