Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests do not start on iOS #1745

Closed
lravihs opened this issue Sep 26, 2023 · 5 comments
Closed

Tests do not start on iOS #1745

lravihs opened this issue Sep 26, 2023 · 5 comments

Comments

@lravihs
Copy link

lravihs commented Sep 26, 2023

Steps to reproduce

Do the setup as mentioned in the patrol official website for iOS in your application.
Run with the patrol test --target integration_test/example_test.dart

Actual results

The simulator is cloning and only generating the build despite of launching the test starting screen for automation

Logs

lallu@Laliths-MacBook-Pro Next-Gen-App % patrol test --target integration_test/example_test.dart --verbose          
You're using Patrol CLI 2.0, which has breaking changes.
Read the migration guide at https://patrol.leancode.co/v2.
Disable this warning by setting the PATROL_MIGRATED environment variable.

Verbose mode enabled. More logs will be printed.
Received 1 test target(s)
Received test target: /Users/lallu/Documents/GitHub/Next-Gen-App/integration_test/example_test.dart
Generated entrypoint /Users/lallu/Documents/GitHub/Next-Gen-App/integration_test/test_bundle.dart with 1 bundled test(s)
Received Android flavor: jk
Received iOS flavor: jk
$ flutter --no-version-check devices --machine
No device specified, using the first one (iPhone 14 Pro)
Received 1 device(s) to run on
Received device: iPhone 14 Pro
Received 7 --dart-define(s) (0 custom, 7 internal)
Received internal --dart-define: PATROL_WAIT=0
Received internal --dart-define: PATROL_APP_PACKAGE_NAME=com.paytronix.nexgenfl
Received internal --dart-define: PATROL_APP_BUNDLE_ID=com.paytronix.nexgenfl
Received internal --dart-define: PATROL_ANDROID_APP_NAME=NGA JK Cafe
Received internal --dart-define: PATROL_IOS_APP_NAME=NGA JK Cafe
Received internal --dart-define: INTEGRATION_TEST_SHOULD_REPORT_RESULTS_TO_NATIVE=false
Received internal --dart-define: PATROL_TEST_LABEL_ENABLED=true
• Building app with entrypoint test_bundle.dart for iOS simulator (debug)...
$ flutter build ios --no-version-check --config-only --no-codesign --debug --simulator --flavor jk --target /Users/lallu/Documents/GitHub/Next-Gen-App/integration_test/test_bundle.dart --dart-define PATROL_WAIT=0 --dart-define PATROL_APP_PACKAGE_NAME=com.paytronix.nexgenfl --dart-define PATROL_APP_BUNDLE_ID=com.paytronix.nexgenfl --dart-define PATROL_ANDROID_APP_NAME=NGA JK Cafe --dart-define PATROL_IOS_APP_NAME=NGA JK Cafe --dart-define INTEGRATION_TEST_SHOULD_REPORT_RESULTS_TO_NATIVE=false --dart-define PATROL_TEST_LABEL_ENABLED=true
        Building com.paytronix.nexgenfl for simulator (ios)...
$ xcodebuild build-for-testing -workspace Runner.xcworkspace -scheme jk -configuration Debug-jk -only-testing RunnerUITests -sdk iphonesimulator -destination generic/platform=iOS Simulator -quiet -derivedDataPath ../build/ios_integ OTHER_SWIFT_FLAGS=$(inherited) -D PATROL_ENABLED
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Runner/iOSPicker.swift:56:41: warning: 'keyWindow' was deprecated in iOS 13.0: Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes
                let win  = UIApplication.shared.keyWindow
                                                ^
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Runner/AppDelegate.swift:12:11: warning: immutable value 'controller' was never used; consider replacing with '_' or removing it
              let controller : FlutterViewController = window!.rootViewController as! FlutterViewController
                  ^~~~~~~~~~
                  _
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Runner/iOSDatePicker.swift:56:41: warning: 'keyWindow' was deprecated in iOS 13.0: Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes
                let win  = UIApplication.shared.keyWindow
                                                ^
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Runner/AppDelegate.swift:12:11: warning: immutable value 'controller' was never used; consider replacing with '_' or removing it
              let controller : FlutterViewController = window!.rootViewController as! FlutterViewController
                  ^~~~~~~~~~
                  _
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Runner/iOSDatePicker.swift:56:41: warning: 'keyWindow' was deprecated in iOS 13.0: Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes
                let win  = UIApplication.shared.keyWindow
                                                ^
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Runner/iOSPicker.swift:56:41: warning: 'keyWindow' was deprecated in iOS 13.0: Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes
                let win  = UIApplication.shared.keyWindow
                                                ^
        note: Building targets in dependency order
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'CGRPCZlib' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'CNIOAtomics' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'CNIOBoringSSL' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'CNIOBoringSSLShims' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'CNIODarwin' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'CNIOHTTPParser' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'CNIOLinux' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'CNIOWindows' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'Logging' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'ReachabilitySwift' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIOConcurrencyHelpers' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIOCore' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target '_NIODataStructures' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIOEmbedded' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIOPosix' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIO' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIOExtras' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIOFoundationCompat' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIOHTTP1' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIOHPACK' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIOTLS' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIOHTTP2' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIOSSL' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftNIOTransportServices' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'SwiftProtobuf' from project 'Pods')
        /Users/lallu/Documents/GitHub/Next-Gen-App/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'gRPC-Swift' from project 'Pods')
        note: Run script build phase 'Run Script' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')
        note: Run script build phase 'Thin Binary' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')
        warning: Run script build phase 'xcode_backend build' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RunnerUITests' from project 'Runner')
        warning: Run script build phase 'xcode_backend embed_and_thin' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RunnerUITests' from project 'Runner')
✓ Completed building app with entrypoint test_bundle.dart for iOS simulator (53.8s)
Will uninstall apps before running tests
$ xcrun simctl uninstall FB544EF5-4FD7-45B9-B525-3C746378DE95 com.paytronix.nexgenfl
$ xcrun simctl uninstall FB544EF5-4FD7-45B9-B525-3C746378DE95 com.paytronix.nexgenfl.RunnerUITests.xctrunner
• Running app with entrypoint test_bundle.dart for iOS simulator on simulator iPhone 14 Pro...
$ xcodebuild -showsdks -json
Assuming SDK version 16.2 for iphonesimulator
Looking for .xctestrun matching jk_iphonesimulator16.2*.xctestrun at /Users/lallu/Documents/GitHub/Next-Gen-App/build/ios_integ/Build/Products
Found 1 match(es), the first one will be used
Found /Users/lallu/Documents/GitHub/Next-Gen-App/build/ios_integ/Build/Products/jk_iphonesimulator16.2-arm64-x86_64.xctestrun
$ xcodebuild test-without-building -xctestrun /Users/lallu/Documents/GitHub/Next-Gen-App/build/ios_integ/Build/Products/jk_iphonesimulator16.2-arm64-x86_64.xctestrun -only-testing RunnerUITests -destination platform=iOS Simulator,name=iPhone 14 Pro
        Command line invocation:
            /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild test-without-building -xctestrun /Users/lallu/Documents/GitHub/Next-Gen-App/build/ios_integ/Build/Products/jk_iphonesimulator16.2-arm64-x86_64.xctestrun -only-testing RunnerUITests -destination "platform=iOS Simulator,name=iPhone 14 Pro"
        
        User defaults from command line:
            IDEPackageSupportUseBuiltinSCM = YES
        
        2023-07-26 16:11:51.897991+0530 RunnerUITests-Runner[82818:440964] [SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
        2023-07-26 16:11:51.898268+0530 RunnerUITests-Runner[82818:440964] [SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
        2023-07-26 16:11:51.908055+0530 RunnerUITests-Runner[82818:440964] Running tests...
        2023-07-26 16:11:52.785619+0530 RunnerUITests-Runner[82818:440964] PatrolServer: INFO: PATROL_PORT is null, falling back to default (8081)
        2023-07-26 16:11:52.786115+0530 RunnerUITests-Runner[82818:440964] PatrolServer: INFO: PatrolServer constructor called
        2023-07-26 16:11:52.786185+0530 RunnerUITests-Runner[82818:440964] PatrolServer: INFO: PATROL_ENABLED flag is defined
        2023-07-26 16:11:52.786531+0530 RunnerUITests-Runner[82818:440964] PatrolAppServiceClient: created, port: 8082
        2023-07-26 16:11:52.793264+0530 RunnerUITests-Runner[82818:441002] [si_destination_compare] send failed: Invalid argument
        2023-07-26 16:11:52.793347+0530 RunnerUITests-Runner[82818:441002] [si_destination_compare] send failed: Undefined error: 0
        2023-07-26 16:11:52.795909+0530 RunnerUITests-Runner[82818:440999] PatrolServer: INFO: Server started on http://localhost:8081
            t =      nans Checking existence of `"Allow" Button`
            t =      nans Ignoring failure to get hierarchy for remote element in process 80428 (Error getting main window kAXErrorServerNotFound)
            t =      nans Open com.paytronix.nexgenfl
            t =      nans     Launch com.paytronix.nexgenfl
            t =      nans         Setting up automation session
            t =      nans         Wait for com.paytronix.nexgenfl to idle
^CCaught SIGINT, exiting...
✗ Failed to execute tests of app with entrypoint test_bundle.dart for iOS simulator on simulator iPhone 14 Pro (xcodebuild was interrupted) (455.1s)
Interrupted: xcodebuild was interrupted
#0      throwToolInterrupted (package:patrol_cli/src/base/exceptions.dart:15:3)
#1      IOSTestBackend.execute.<anonymous closure> (package:patrol_cli/src/ios/ios_test_backend.dart:177:9)
<asynchronous suspension>
#2      DisposeScope.run (package:dispose_scope/src/dispose_scope.dart:46:7)
<asynchronous suspension>
#3      IOSTestBackend.execute (package:patrol_cli/src/ios/ios_test_backend.dart:147:5)
<asynchronous suspension>
#4      TestCommand._execute (package:patrol_cli/src/commands/test.dart:269:7)
<asynchronous suspension>
#5      TestCommand.run (package:patrol_cli/src/commands/test.dart:169:23)
<asynchronous suspension>
#6      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#7      PatrolCommandRunner.runCommand (package:patrol_cli/src/runner/patrol_command_runner.dart:310:18)
<asynchronous suspension>
#8      PatrolCommandRunner.run (package:patrol_cli/src/runner/patrol_command_runner.dart:254:18)
<asynchronous suspension>
#9      patrolCommandRunner (package:patrol_cli/src/runner/patrol_command_runner.dart:72:20)
<asynchronous suspension>
#10     main (file:///Users/lallu/.pub-cache/hosted/pub.dev/patrol_cli-2.0.4/bin/main.dart:6:20)
<asynchronous suspension>

See the logs above to learn what happened. Also consider running with --verbose. If the logs still aren't useful, then it's a bug - please report it.
$ xcrun simctl uninstall FB544EF5-4FD7-45B9-B525-3C746378DE95 com.paytronix.nexgenfl
$ xcrun simctl uninstall FB544EF5-4FD7-45B9-B525-3C746378DE95 com.paytronix.nexgenfl.RunnerUITests.xctrunner

Patrol version

patrol: ^2.1.0

Patrol Doctor output

lallu@Laliths-MacBook-Pro Next-Gen-App % patrol doctor
You're using Patrol CLI 2.0, which has breaking changes.
Read the migration guide at https://patrol.leancode.co/v2.
Disable this warning by setting the PATROL_MIGRATED environment variable.

Patrol CLI version: 2.0.4
Program adb found in /Users/lallu/Documents/platform-tools/adb
Env var $ANDROID_HOME set to /Users/lallu/Library/Android/sdk
Program xcodebuild found in /usr/bin/xcodebuild
Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller

Flutter Doctor output

lallu@Laliths-MacBook-Pro Next-Gen-App % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.10.6, on macOS 13.3 22E252 darwin-arm64, locale en-IN)
! Warning: dart on your path resolves to /opt/homebrew/Cellar/dart/3.0.3/libexec/bin/dart, which is not inside your current Flutter SDK checkout at
/Users/lallu/Documents/flutter. Consider adding /Users/lallu/Documents/flutter/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.80.1)
[✓] Connected device (3 available)
[✓] Network resources

@neiljaywarner
Copy link

@bartekpacia bump. i think i'm having a similar error and it looks like 3 weeks with no comment

@bartekpacia
Copy link
Contributor

@neiljaywarner Sorry to hear that. Please provide a minimal, reproducible sample so we can easily debug.

@bartekpacia bartekpacia changed the title Unable to execute in iOS devices only Tests do not start on iOS Oct 26, 2023
@bartekpacia
Copy link
Contributor

May be related to #1828

@bartekpacia
Copy link
Contributor

We have tracked down the cause in #1897. Therefore I'm closing this one.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants