website
website copied to clipboard
[PAGE ISSUE]: How to test a Flutter app Codelab
I run the last command at step 7 and got an error about the Scrolling test:
Running "flutter pub get" in step_07... 2,120ms
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
Running Gradle task 'assembleProfile'... 32.1s
√ Built build\app\outputs\flutter-apk\app-profile.apk (13.3MB).
Installing build\app\outputs\flutter-apk\app.apk... 7.1s
D/ViewRootImpl@bf207ea[MainActivity]( 3588): MSG_RESIZED_REPORT: frame=(0,0,720,1520) ci=(0,55,0,84) vi=(0,55,0,84) or=1
D/InputMethodManager( 3588): prepareNavigationBarInfo() DecorView@7250bde[MainActivity]
D/InputMethodManager( 3588): getNavigationBarColor() -855310
V/InputMethodManager( 3588): Starting input: tba=com.example.testing_app ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager( 3588): startInputInner - Id : 0
VMServiceFlutterDriver: Connecting to Flutter application at http://127.0.0.1:57004/7kmppVdwa_c=/
VMServiceFlutterDriver: Isolate found with number: 3518934142509727
VMServiceFlutterDriver: Isolate is paused at start.
VMServiceFlutterDriver: Attempting to resume isolate
I/flutter ( 3588): 00:00 +0: Testing App Performance Tests Scrolling test
VMServiceFlutterDriver: Connected to Flutter application.
D/OpenGLRenderer( 3588): makeCurrent EglSurface : 0x0 -> 0xf04db0c0
I/flutter ( 3588): SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = localhost, port = 38110
I/flutter ( 3588): #0 _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:682)
I/flutter ( 3588): #1 _RawSocket.startConnect (dart:io-patch/socket_patch.dart:1817)
I/flutter ( 3588): #2 RawSocket.startConnect (dart:io-patch/socket_patch.dart:27)
I/flutter ( 3588): #3 Socket._startConnect (dart:io-patch/socket_patch.dart:2038)
I/flutter ( 3588): #4 Socket.startConnect (dart:io/socket.dart:792)
I/flutter ( 3588): #5 _ConnectionTarget.connect (dart:_http/http_impl.dart:2440)
I/flutter ( 3588): #6 _HttpClient._getConnection.connect (dart:_http/http_impl.dart:2834)
I/flutter ( 3588): #7 _HttpClient._getConnection (dart:_http/http_impl.dart:2839)
I/flutter ( 3588): #8 _HttpClient._openUrl (dart:_http/http_impl.dart:2698)
I/flutter ( 3588): #9 _HttpClient.openUrl (dart:_http/http_impl.dart:2570)
I/flutter ( 3588): #10 _WebSocketImpl.connect (dart:_http/websocket_impl.dart:1021)
I/flutter ( 3588): #11 WebSocket.connect (dart:_http/websocket.dart:360)
I/flutter ( 3588): #12 vmServiceConnectUri (package:vm_service/vm_service_io.dart:32)
I/flutter ( 3588): #13 IntegrationTestWidgetsFlutterBinding.enableTimeline (package:integration_test/integration_test.dart:247)
I/flutter ( 3588): <asynchronous suspension>
I/flutter ( 3588): #14 IntegrationTestWidgetsFlutterBinding.traceTimeline (package:integration_test/integration_test.dart:272)
I/flutter ( 3588): <asynchronous suspension>
I/flutter ( 3588): #15 IntegrationTestWidgetsFlutterBinding._runAndGetGCInfo (package:integration_test/integration_test.dart:347)
I/flutter ( 3588): <asynchronous suspension>
I/flutter ( 3588): #16 IntegrationTestWidgetsFlutterBinding.watchPerformance (package:integration_test/integration_test.dart:402)
I/flutter ( 3588): <asynchronous suspension>
I/flutter ( 3588): #17 main.<anonymous closure>.<anonymous closure> (file:///D:/FlutterProjects/codelabs/testing_codelab/step_07/integration_test/app_test.dart:22)
I/flutter ( 3588): <asynchronous suspension>
I/flutter ( 3588): #18 testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:170)
I/flutter ( 3588): <asynchronous suspension>
I/flutter ( 3588): #19 TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:806)
I/flutter ( 3588): <asynchronous suspension>
I/flutter ( 3588): 00:02 +0: Testing App Performance Tests Scrolling test [E]
I/flutter ( 3588): Test failed. See exception logs above.
I/flutter ( 3588): The test description was: Scrolling test
I/flutter ( 3588):
I/flutter ( 3588): 00:02 +0 -1: Testing App Performance Tests Favorites operations test
I/ple.testing_ap( 3588): Thread[7,tid=3630,WaitingInMainSignalCatcherLoop,Thread*=0xeb498600,peer=0x13201808,"Signal Catcher"]: reacting to signal 28
I/ple.testing_ap( 3588):
I/ple.testing_ap( 3588): SIGSAVEPRF profile save
I/flutter ( 3588): 00:11 +1 -1: Testing App Performance Tests (tearDownAll)
W/ple.testing_ap( 3588): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
I/flutter ( 3588): 00:11 +2 -1: Some tests failed.
Failure Details:
Failure in method: Scrolling test
end of failure 1
The command is:
flutter drive --driver integration_test/driver.dart --target integration_test/app_test.dart --profile
flutter --version:
Flutter 2.10.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision db747aa133 (7 weeks ago) • 2022-02-09 13:57:35 -0600
Engine • revision ab46186b24
Tools • Dart 2.16.1 • DevTools 2.9.2
Hi @nickf2k, please provide a link to the documentation that you are following.
Thank you
hi @danagbemava-nc , this is my link to the codelab step #7 https://codelabs.developers.google.com/codelabs/flutter-app-testing#6
Hi @nickf2k, kindly see https://github.com/flutter/website/issues/6508 and check if this comment helps. This is actually due to an issue in the integration test package, see https://github.com/flutter/flutter/issues/90410.
We probably need to add that this should be run with --no-dds when targeting mobile tho.
@domesticmouse, is this still true?
Hey @miquelbeltran I think you have more up to date knowledge here. Do you know the state of play on this issue?
danagbemava-nc is correct, since running on mobile they need to use the --no-dds param, and the param is present in the updated version of the codelab, this ticket can be closed :)