前提・実現したいこと
codelabsのサイトのコードを写経しながらFlutterアプリのテスト技法を学習しています。
7:integration testの最後の項目Run the test
まで問題なく進んでる状況です。
以下のコマンドをターミナルで実行し、integration testを行いました。
terminal
1$ flutter drive --driver integration_test/driver.dart --target integration_test/app_test.dart --profile
######お題のアプリ
・シンプルなリスト。右のハートボタンをタップし、お気に入り登録する。
・お気に入りリストから×ボタンを押すとお気に入りを解除できる。
######テスト内容
・ Scrolling test
: ListViewを上下にスクロールし、その時の挙動のパフォーマンスを確認
・ Favorites operations test
: 3つのリストをお気に入り登録し、解除する
###起きている問題
2つのテストの内、Scrolling test
が通らずにエラーが発生しました。
発生している問題・エラーメッセージ
% flutter drive --driver integration_test/driver.dart --target integration_test/app_test.dart --profile Running "flutter pub get" in step_07... 1,299ms Updating project for Xcode compatibility. Upgrading project.pbxproj Upgrading Runner.xcscheme Signing iOS app for device deployment using developer identity: "Apple Development: my name" Running pod install... 2,039ms Running Xcode build... └─Compiling, linking and signing... 78.0s Xcode build done. 155.3s Installing and launching... 18.9s VMServiceFlutterDriver: Connecting to Flutter application at http://127.0.0.1:51042/2J6xWDG1lU0=/ VMServiceFlutterDriver: Isolate found with number: 3783644604528647 VMServiceFlutterDriver: Isolate is paused at start. VMServiceFlutterDriver: Attempting to resume isolate flutter: 00:00 +0: Testing App Performance Tests Scrolling test fopen failed for data file: errno = 2 (No such file or directory) Errors found! Invalidating cache... VMServiceFlutterDriver: Connected to Flutter application. fopen failed for data file: errno = 2 (No such file or directory) Errors found! Invalidating cache... flutter: SocketException: OS Error: Connection refused, errno = 61, address = localhost, port = 49636 flutter: #0 _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:681) flutter: #1 _RawSocket.startConnect (dart:io-patch/socket_patch.dart:1808) flutter: #2 RawSocket.startConnect (dart:io-patch/socket_patch.dart:27) flutter: #3 Socket._startConnect (dart:io-patch/socket_patch.dart:2027) flutter: #4 Socket.startConnect (dart:io/socket.dart:784) flutter: #5 _ConnectionTarget.connect (dart:_http/http_impl.dart:2439) flutter: #6 _HttpClient._getConnection.connect (dart:_http/http_impl.dart:2808) flutter: #7 _HttpClient._getConnection (dart:_http/http_impl.dart:2813) flutter: #8 _HttpClient._openUrl (dart:_http/http_impl.dart:2697) flutter: #9 _HttpClient.openUrl (dart:_http/http_impl.dart:2569) flutter: #10 _WebSocketImpl.connect (dart:_http/websocket_impl.dart:1021) flutter: #11 WebSocket.connect (dart:_http/websocket.dart:360) flutter: #12 vmServiceConnectUri (package:vm_service/vm_service_io.dart:32) flutter: #13 IntegrationTestWidgetsFlutterBinding.enableTimeline (package:integration_test/integration_test.dart:247) flutter: <asynchronous suspension> flutter: #14 IntegrationTestWidgetsFlutterBinding.traceTimeline (package:integration_test/integration_test.dart:272) flutter: <asynchronous suspension> flutter: #15 IntegrationTestWidgetsFlutterBinding._runAndGetGCInfo (package:integration_test/integration_test.dart:347) flutter: <asynchronous suspension> flutter: #16 IntegrationTestWidgetsFlutterBinding.watchPerformance (package:integration_test/integration_test.dart:402) flutter: <asynchronous suspension> flutter: #17 main.<anonymous closure>.<anonymous closure> (file:///Users/kudokoki/AndroidStudioProjects/Flutter/codelabs/testing_codelab/s tep_07/integration_test/app_test.dart:22) flutter: <asynchronous suspension> flutter: #18 testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:170) flutter: <asynchronous suspension> flutter: #19 TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:806) flutter: <asynchronous suspension> flutter: 00:02 +0: Testing App Performance Tests Scrolling test [E] flutter: Test failed. See exception logs above. The test description was: Scrolling test flutter: flutter: Consider enabling the flag chain-stack-traces to receive more detailed exceptions. For example, 'dart test --chain-stack-traces'. flutter: 00:02 +0 -1: Testing App Performance Tests Favorites operations test flutter: 00:10 +1 -1: Testing App Performance Tests (tearDownAll) flutter: Warning: integration_test plugin was not detected. flutter: flutter: If you're running the tests with `flutter drive`, please make sure your tests flutter: are in the `integration_test/` directory of your package and use flutter: `flutter test $path_to_test` to run it instead. flutter: flutter: If you're running the tests with Android instrumentation or XCTest, this means flutter: that you are not capturing test results properly! See the following link for flutter: how to set up the integration_test plugin: flutter: flutter: https://flutter.dev/docs/testing/integration-tests#testing-on-firebase-test-lab flutter: flutter: 00:10 +2 -1: Some tests failed. Failure Details: Failure in method: Scrolling test end of failure 1
ソースコードについて
自分のコードが悪いと思い、試しに公式のコードをフォーク&クローンして実行しましたが全く同じエラーが発生しました。
公式のコード
補足情報
・ テスト端末 : iPhone8(ios15.1)実機
・ flutter doctor
% flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel master, 2.6.0-12.0.pre.522, on macOS 12.0.1 21A559 darwin-x64, locale ja-JP) [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 13.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] VS Code (version 1.62.3) [✓] VS Code (version 1.47.3) [✓] Connected device (2 available) • No issues found!
ネットで調べても同じケースに関する情報がなかったので困っております。
ご助力お願いします。
あなたの回答
tips
プレビュー