but*_*oys 6 integration-testing splash-screen flutter
我的集成测试正在使用 flutter_driver,但在按照文档迁移到integration_test之后,我无法通过启动屏幕。
\n下面是一个简单的测试。如果不使用,sleep我永远不会越过Test starting...屏幕,正如其他人在这里发现的那样。随着sleep测试通过Test starting...,但随后卡在了我的启动屏幕上。不确定是否相关,但我的身份验证屏幕位于启动屏幕之后。
import \'dart:io\';\nimport \'package:flutter/widgets.dart\';\nimport \'package:flutter_test/flutter_test.dart\';\nimport \'package:integration_test/integration_test.dart\';\nimport \'../lib/main.dart\' as app;\n\nvoid main() {\n IntegrationTestWidgetsFlutterBinding.ensureInitialized();\n\n testWidgets(\'verify users\', (WidgetTester tester) async {\n app.main();\n\n sleep(const Duration(seconds: 10));\n\n await tester.pumpAndSettle();\n\n final Finder menuButtonFinder = find.byKey(const Key(\'kKeyButtonMenu\'));\n\n expect(menuButtonFinder, findsOneWidget);\n });\n}\nRun Code Online (Sandbox Code Playgroud)\n下面是显示失败的输出
\nPS C:\\projects\\dream_app> flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart \nRunning "flutter pub get" in dream_app... 1,128ms\nRunning Gradle task \'assembleDebug\'...\nRunning Gradle task \'assembleDebug\'... Done 29.9s\n\xe2\x88\x9a Built build\\app\\outputs\\flutter-apk\\app-debug.apk.\nInstalling build\\app\\outputs\\flutter-apk\\app.apk... 861ms\nD/EGL_emulation(16572): eglMakeCurrent: 0xda965820: ver 2 0 (tinfo 0xc3357610)\nD/EGL_emulation(16572): eglMakeCurrent: 0xddd1ad20: ver 2 0 (tinfo 0xddd0fc70)\nD/eglCodecCommon(16572): setVertexArrayObject: set vao to 0 (0) 1 0\nI/OpenGLRenderer(16572): Davey! duration=1837ms; Flags=1, IntendedVsync=580073648796040, Vsync=580073665462706,\nOldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=580073681834600, AnimationStart=580073681923600,\nPerformTraversalsStart=580073681982400, DrawStart=580075339090900, SyncQueued=580075340979900, SyncStart=580075354420900, \nIssueDrawCommandsStart=580075355228300, SwapBuffers=580075391296000, FrameCompleted=580075499793800,\nDequeueBufferDuration=19391000, QueueBufferDuration=499000,\nI/Choreographer(16572): Skipped 110 frames! The application may be doing too much work on its main thread.\nVMServiceFlutterDriver: Connecting to Flutter application at http://127.0.0.1:54327/W14R71Jsq2c=/\nVMServiceFlutterDriver: Isolate found with number: 3967110223154191\nVMServiceFlutterDriver: Isolate is paused at start.\nVMServiceFlutterDriver: Attempting to resume isolate\nD/EGL_emulation(16572): eglMakeCurrent: 0xda965820: ver 2 0 (tinfo 0xc3357610)\nD/eglCodecCommon(16572): setVertexArrayObject: set vao to 0 (0) 1 0\nI/flutter (16572): 00:00 +0: verify users\nVMServiceFlutterDriver: Connected to Flutter application.\nI/lytics.dreamap(16572): The ClassLoaderContext is a special shared library.\nI/chatty (16572): uid=10179(com.dreamalytics.dreamapp) identical 1 line\nI/lytics.dreamap(16572): The ClassLoaderContext is a special shared library.\nI/lytics.dreamap(16572): Waiting for a blocking GC ClassLinker\nI/lytics.dreamap(16572): WaitForGcToComplete blocked ClassLinker on ProfileSaver for 12.908ms\nI/DynamiteModule(16572): Considering local module com.google.android.gms.ads.dynamite:0 and remote module\ncom.google.android.gms.ads.dynamite:211512000\nI/DynamiteModule(16572): Selected remote version of com.google.android.gms.ads.dynamite, version >= 211512000\nD/DynamitePackage(16572): Instantiated singleton DynamitePackage.\nD/DynamitePackage(16572): Instantiating com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl\nW/lytics.dreamap(16572): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,\nlinking, allowed)\nW/lytics.dreamap(16572): Accessing hidden method\nLsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed) \nW/ConnectionStatusConfig(16572): Dynamic lookup for intent failed for action: com.google.android.gms.leibniz.events.service.STARTE/GmsClient(16572): unable to connect to service: com.google.android.gms.leibniz.events.service.START on com.google.android.gms\nW/lytics.dreamap(16572): Accessing hidden method\nLsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed) \nI/WebViewFactory(16572): Loading com.google.android.webview version 74.0.3729.185 (code 373018518)\nI/lytics.dreamap(16572): The ClassLoaderContext is a special shared library.\nI/lytics.dreamap(16572): The ClassLoaderContext is a special shared library.\nI/cr_LibraryLoader(16572): Time to load native libraries: 12 ms (timestamps 8336-8348)\nI/chromium(16572): [INFO:library_loader_hooks.cc(50)] Chromium logging enabled: level = 0, default verbosity = 0\nI/cr_LibraryLoader(16572): Expected native library version number "74.0.3729.185", actual native library version number\n"74.0.3729.185"\nW/cr_ChildProcLH(16572): Create a new ChildConnectionAllocator with package name = com.google.android.webview, sandboxed = true\nW/lytics.dreamap(16572): Accessing hidden method\nLandroid/content/Context;->bindServiceAsUser(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/Handler;Landroid/os/UserHandle;)Z (greylist, reflection, allowed)\nI/cr_BrowserStartup(16572): Initializing chromium process, singleProcess=false\nE/chromium(16572): [ERROR:filesystem_posix.cc(89)] stat /data/user/0/com.dreamalytics.dreamapp/cache/WebView/Crashpad: No such\nfile or directory (2)\nE/chromium(16572): [ERROR:filesystem_posix.cc(62)] mkdir /data/user/0/com.dreamalytics.dreamapp/cache/WebView/Crashpad: No such\nfile or directory (2)\nW/lytics.dreamap(16572): Accessing hidden method\nLandroid/view/textclassifier/logging/SmartSelectionEventTracker;-><init>(Landroid/content/Context;I)V (greylist, reflection, \nallowed)\nW/lytics.dreamap(16572): Accessing hidden method\nLandroid/view/textclassifier/logging/SmartSelectionEventTracker;->logEvent(Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;)V (greylist, reflection, allowed)\nW/lytics.dreamap(16572): Accessing hidden method\nLandroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionStarted(I)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed)\nW/lytics.dreamap(16572): Accessing hidden method\nLandroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(II)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed)\nW/lytics.dreamap(16572): Accessing hidden method\nLandroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, \nallowed)\nW/lytics.dreamap(16572): Accessing hidden method\nLandroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextSelection;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed) \nW/lytics.dreamap(16572): Accessing hidden method\nLandroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(III)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed)\nW/lytics.dreamap(16572): Accessing hidden method\nLandroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(IIILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, \nallowed)\nW/cr_media(16572): Requires BLUETOOTH permission\nD/HostConnection(16572): HostConnection::get() New Host Connection established 0xb4191340, tid 16729\nD/HostConnection(16572): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem\nANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands\nANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV420_888_to_NV21 \nANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 \nANDROID_EMU_vulkan_async_queue_submit GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr\nANDROID_EMU_gles_max_version_2\nE/chromium(16572): [ERROR:gl_surface_egl.cc(342)] eglChooseConfig failed with error EGL_SUCCESS\nW/lytics.dreamap(16572): Accessing hidden method\nLsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed) \nI/Choreographer(16572): Skipped 35 frames! The application may be doing too much work on its main thread.\nI/lytics.dreamap(16572): NativeAlloc concurrent copying GC freed 14077(1257KB) AllocSpace objects, 6(232KB) LOS objects, 49%\nfree, 3486KB/6972KB, paused 1.983ms total 111.546ms\nI/OpenGLRenderer(16572): Davey! duration=953ms; Flags=0, IntendedVsync=580078056495135, Vsync=580078639828445,\nOldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=580078641823200, AnimationStart=580078641880200, \nPerformTraversalsStart=580078641955600, DrawStart=580078642163700, SyncQueued=580078642249900, SyncStart=580078642789500, \nIssueDrawCommandsStart=580078642831900, SwapBuffers=580078653158500, FrameCompleted=580079010104200,\nDequeueBufferDuration=274000, QueueBufferDuration=474000,\nD/eglCodecCommon(16572): setVertexArrayObject: set vao to 0 (0) 0 0\nD/EGL_emulation(16572): eglCreateContext: 0xe5e667c0: maj 2 min 0 rcv 2\nD/EGL_emulation(16572): eglMakeCurrent: 0xe5e667c0: ver 2 0 (tinfo 0xb41ed380)\nE/chromium(16572): [ERROR:gl_surface_egl.cc(342)] eglChooseConfig failed with error EGL_SUCCESS\nI/VideoCapabilities(16572): Unsupported profile 4 for video/mp4v-es\nW/cr_MediaCodecUtil(16572): HW encoder for video/avc is not available on this device.\nD/eglCodecCommon(16572): setVertexArrayObject: set vao to 0 (0) 0 0\nD/EGL_emulation(16572): eglCreateContext: 0xe5eed240: maj 2 min 0 rcv 2\nD/EGL_emulation(16572): eglMakeCurrent: 0xe5eed240: ver 2 0 (tinfo 0xb41ed380)\nD/eglCodecCommon(16572): setVertexArrayObject: set vao to 1 (1) 0 0\nW/ConnectionTracker(16572): Exception thrown while unbinding\nW/ConnectionTracker(16572): java.lang.IllegalArgumentException: Service not registered:\ncom.google.android.gms.measurement.internal.zzjj@479ea95\nW/ConnectionTracker(16572): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1751)\nW/ConnectionTracker(16572): at android.app.ContextImpl.unbindService(ContextImpl.java:1776)\nW/ConnectionTracker(16572): at android.content.ContextWrapper.unbindService(ContextWrapper.java:741)\nW/ConnectionTracker(16572): at\ncom.google.android.gms.common.stats.ConnectionTracker.zza(com.google.android.gms:play-services-basement@@17.3.0:55)\nW/ConnectionTracker(16572): at\ncom.google.android.gms.common.stats.ConnectionTracker.unbindService(com.google.android.gms:play-services-basement@@17.3.0:50) \nW/ConnectionTracker(16572): at\ncom.google.android.gms.measurement.internal.zzjk.zzF(com.google.android.gms:play-services-measurement-impl@@19.0.0:6)\nW/ConnectionTracker(16572): at\ncom.google.android.gms.measurement.internal.zziu.zza(com.google.android.gms:play-services-measurement-impl@@19.0.0:5)\nW/ConnectionTracker(16572): at\ncom.google.android.gms.measurement.internal.zzak.run(com.google.android.gms:play-services-measurement-impl@@19.0.0:5)\nW/ConnectionTracker(16572): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)\nW/ConnectionTracker(16572): at java.util.concurrent.FutureTask.run(FutureTask.java:266)\nW/ConnectionTracker(16572): at\ncom.google.android.gms.measurement.internal.zzfq.run(com.google.android.gms:play-services-measurement-impl@@19.0.0:6)\nW/lytics.dreamap(16572): Accessing hidden method\nLsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed) \nI/flutter (16572): (The following exception is now available via WidgetTester.takeException:)\nI/flutter (16572): \xe2\x95\x90\xe2\x95\x90\xe2\x95\xa1 EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK \xe2\x95\x9e\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\nI/flutter (16572): The following TestFailure object was thrown running a test:\nI/flutter (16572): Expected: exactly one matching node in the widget tree\nI/flutter (16572): Actual: _KeyFinder:<zero widgets with key [<\'kKeyButtonMenu\'>] (ignoring offstage widgets)>\nI/flutter (16572): Which: means none were found but one was expected\nI/flutter (16572):\nI/flutter (16572): When the exception was thrown, this was the stack:\nI/flutter (16572): #4 main.<anonymous closure> (file:///C:/projects/dream_app/integration_test/app_test.dart:19:5)\nI/flutter (16572): <asynchronous suspension>\nI/flutter (16572): <asynchronous suspension>\nI/flutter (16572): (elided one frame from package:stack_trace)\nI/flutter (16572): ...\nI/flutter (16572):\nI/flutter (16572): This was caught by the test expectation on the following line:\nI/flutter (16572): file:///C:/projects/dream_app/integration_test/app_test.dart line 19\nI/flutter (16572): The test description was:\nI/flutter (16572): verify users\nI/flutter (16572): \xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\nI/flutter (16572): (If WidgetTester.takeException is called, the above exception will be ignored. If it is not, then the above \nexception will be dumped when another exception is caught by the framework or when the test ends, whichever happens first, and \nthen the test will fail due to having not caught or expected the exception.)\nI/flutter (16572): \xe2\x95\x90\xe2\x95\x90\xe2\x95\xa1 EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK \xe2\x95\x9e\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\nI/flutter (16572): The following TestFailure object was thrown running a test:\nI/flutter (16572): Expected: exactly one matching node in the widget tree\nI/flutter (16572): Actual: _KeyFinder:<zero widgets with key [<\'kKeyButtonMenu\'>] (ignoring offstage widgets)>\nI/flutter (16572): Which: means none were found but one was expected\nI/flutter (16572):\nI/flutter (16572): When the exception was thrown, this was the stack:\nI/flutter (16572): #4 main.<anonymous closure> (file:///C:/projects/dream_app/integration_test/app_test.dart:19:5)\nI/flutter (16572): <asynchronous suspension>\nI/flutter (16572): <asynchronous suspension>\nI/flutter (16572): (elided one frame from package:stack_trace)\nI/flutter (16572): ...\nI/flutter (16572):\nI/flutter (16572): This was caught by the test expectation on the following line:\nI/flutter (16572): file:///C:/projects/dream_app/integration_test/app_test.dart line 19\nI/flutter (16572): The test description was:\nI/flutter (16572): verify users\nI/flutter (16572): \xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\nI/flutter (16572): 00:11 +0: verify users [E]\nI/flutter (16572): Test failed. See exception logs above.\nI/flutter (16572): The test description was: verify users\nI/flutter (16572): \nI/flutter (16572): 00:11 +0 -1: (tearDownAll)\nFailure Details:\nFailure in method: verify users\n\xe2\x95\x90\xe2\x95\x90\xe2\x95\xa1 EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK \xe2\x95\x9e\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\nThe following TestFailure object was thrown running a test:\nExpected: exactly one matching node in the widget tree\nActual: _KeyFinder:<zero widgets with key [<\'kKeyButtonMenu\'>]\n(ignoring offstage widgets)>\nWhich: means none were found but one was expected\n\nWhen the exception was thrown, this was the stack
这对你有用吗?
import 'dart:io';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../lib/main.dart' as app;
void main() {
// Changing the `utilityPolicy`. Credits to: https://stackoverflow.com/a/68099497/8358501
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized() as IntegrationTestWidgetsFlutterBinding;
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive;
testWidgets('verify users', (WidgetTester tester) async {
app.main();
sleep(const Duration(seconds: 10));
await tester.pumpAndSettle();
final Finder menuButtonFinder = find.byKey(const Key('kKeyButtonMenu'));
expect(menuButtonFinder, findsOneWidget);
});
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3077 次 |
| 最近记录: |