Open vishalpatel1327 opened 1 year ago
Hi, sorry for the problems.
This looks related to #1428. Might be caused by #1797.
What command did you use? Please post the exact invocation.
I am having the same problem when running patrol test --target ./integration_test/views/test.dart --flavor flavor_name
.
Patrol version: 2.3.1
Oi @C-8, how are you doing? Try to modify the begin of your target path to:
patrol test --target integration_test\views\test.dart --flavor flavor_name
Also try to run the flutter clean
command, today I've faced a problem related to build task from gradle, that only was solved by cleaning the project, I don't know why 😅
Oi @C-8, how are you doing? Try to modify the begin of your target path to:
patrol test --target integration_test\views\test.dart --flavor flavor_name
Also try to run the
flutter clean
command, today I've faced a problem related to build task from gradle, that only was solved by cleaning the project, I don't know why 😅
This worked!
void main() {
patrolTest(
'counter state is the same after going to home and switching apps',
($) async {
await $.pumpWidgetAndSettle(
MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('app')),
backgroundColor: Colors.blue,
),
),
);
// expect($('app'), findsOneWidget);
await $.native.disableWifi();
await Future.delayed(const Duration(seconds: 2));
await $.native.enableWifi();
await Future.delayed(const Duration(seconds: 2));
},
nativeAutomation: true,
config: PatrolTesterConfig(),
nativeAutomatorConfig:
NativeAutomatorConfig(packageName: "com.example.app"),
);
}
Unfortunately i can't run any native test code
Exception has occurred. _AssertionError ('package:flutter/src/foundation/binding.dart': Failed assertion: line 153 pos 12: '_debugInitializedType == null': Binding is already initialized to IntegrationTestWidgetsFlutterBinding)
I started to experience the same problem after migration from Flutter 3.19 to Flutter 3.22.
The patrol version does not matter. Might it be related? When I build app normally (flutter run), everything is fine. Problem happens when build app using patrol test --target integration_test/home_screen_test.dart --flavor qa --dart-define=integration_test=true
FileSystemException(uri=org-dartlang-untranslatable-uri:package%3Aflutter_gen%2Fgen_l10n%2Fapp_localizations.dart; message=StandardFileSystem only supports file:* and data:* URIs)
#0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:34)
#1 asFileUri (package:vm/kernel_front_end.dart:752)
#2 writeDepfile (package:vm/kernel_front_end.dart:892)
<asynchronous suspension>
#3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:680)
<asynchronous suspension>
#4 starter (package:frontend_server/starter.dart:101)
<asynchronous suspension>
#5 main (file:///Volumes/Work/s/w/ir/x/w/sdk/pkg/frontend_server/bin/frontend_server_starter.dart:13)
<asynchronous suspension>
Target kernel_snapshot failed: Exception
@Wreos I don't think the issue you described is related to this one. Yours seems to be caused by this regression in the latest Flutter version
Steps to reproduce
I just make a demo as the document said
but having an issue with generated import don't know why
Actual results
generated file need to be error less
Logs
Logs
``` In next major release, patrolTest method will be intended for UI tests. If you want to use Patrol in your widget tests, use patrol_finders package. For more information, see https://patrol.leancode.co/patrol-finders-release Disable this warning by setting the PATROL_FINDERS environment variable. Verbose mode enabled. More logs will be printed. Received 1 test target(s) Received test target: D:\flutter_demo_projects\flutter_testcase\.\integration_test\login_view_patrol_test.dart Generated entrypoint D:\flutter_demo_projects\flutter_testcase\integration_test\test_bundle.dart with 1 bundled test(s) $ flutter --no-version-check devices --machine No device specified, using the first one (RZCN800JJ9L) Received 1 device(s) to run on Received device: RZCN800JJ9L Received 6 --dart-define(s) (0 custom, 6 internal) Received internal --dart-define: PATROL_WAIT=0 Received internal --dart-define: PATROL_APP_PACKAGE_NAME=com.example.flutter_testcase Received internal --dart-define: PATROL_ANDROID_APP_NAME=My App Received internal --dart-define: PATROL_IOS_APP_NAME=My App Received internal --dart-define: INTEGRATION_TEST_SHOULD_REPORT_RESULTS_TO_NATIVE=false Received internal --dart-define: PATROL_TEST_LABEL_ENABLED=true • Building apk with entrypoint test_bundle.dart... $ .\gradlew.bat :app:assembleDebug -Ptarget=D:\flutter_demo_projects\flutter_testcase\integration_test\test_bundle.dart -Pdart-defines=UEFUUk9MX1dBSVQ9MA==,UEFUUk9MX0FQUF9QQUNLQUdFX05BTU U9Y29tLmV4YW1wbGUuZmx1dHRlcl90ZXN0Y2FzZQ==,UEFUUk9MX0FORFJPSURfQVBQX05BTUU9TXkgQXBw,UEFUUk9MX0lPU19BUFBfTkFNRT1NeSBBcHA=,SU5URUdSQVRJT05fVEVTVF9TSE9VTERfUkVQT1JUX1JFU1VMVFNfVE9fTkFUSVZFPWZhbHNl,UEFUUk9MX1RFU1RfTEFCRUxfRU5BQkxFRD10cnVl : > Task :app:preBuild UP-TO-DATE : > Task :app:preDebugBuild UP-TO-DATE : > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE : : > Task :app:compileFlutterBuildDebug FAILED Invalid depfile: D:\flutter_demo_projects\flutter_testcase\.dart_tool\flutter_build\788a6a6ba831791a8bc838a36f885749\kernel_snapshot.d Invalid depfile: D:\flutter_demo_projects\flutter_testcase\.dart_tool\flutter_build\788a6a6ba831791a8bc838a36f885749\kernel_snapshot.d Unhandled exception: FileSystemException(uri=d:/flutter_demo_projects/flutter_testcase/integration_test/login_view_patrol_test.dart; message=StandardFileSystem only supports file:* and data:* URIs) #0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:34:7) #1 IncrementalCompiler._initializeExperimentalInvalidation (package:front_end/src/fasta/incremental_compiler.dart:1268:56) #2 IncrementalCompiler.computeDelta.Patrol version
patrol: ^2.3.1
Patrol Doctor output
Patrol Doctor output
``` In next major release, patrolTest method will be intended for UI tests. If you want to use Patrol in your widget tests, use patrol_finders package. For more information, see https://patrol.leancode.co/patrol-finders-release Disable this warning by setting the PATROL_FINDERS environment variable. Patrol CLI version: 2.2.1 Program adb found in C:\android\Sdk\platform-tools\adb.exe Env var $ANDROID_HOME set to C:\android\Sdk ```Flutter Doctor output
Flutter Doctor output
``` [√] Flutter (Channel stable, 3.13.7, on Microsoft Windows [Version 10.0.22621.2428], locale en-IN) • Flutter version 3.13.7 on channel stable at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2f708eb839 (9 days ago), 2023-10-09 09:58:08 -0500 • Engine revision a794cf2681 • Dart version 3.1.3 • DevTools version 2.25.0 [√] Windows Version (Installed version of Windows is version 10 or higher) [!] Android toolchain - develop for Android devices (Android SDK version 33.0.1) • Android SDK at C:\android\Sdk • Platform android-33-ext4, build-tools 33.0.1 • ANDROID_HOME = C:\android\Sdk • Java binary at: E:\new android studio\Android Studio1\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [X] Visual Studio - develop Windows apps X Visual Studio not installed; this is necessary to develop Windows apps. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components [√] Android Studio (version 2022.1) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Edge (web) • edge • web-javascript • Microsoft Edge 117.0.2045.60 [√] Network resources • All expected network resources are available. ! Doctor found issues in 2 categories. ```