Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

flutter - Test error log from CodeMagic interpretation

I need help with this codemagic test log. Is anyone familiar with CodeMagic and flutter? This is my first attemp at building on codemagic and I don't know how to make sense of this test log.

{"testID":3,"messageType":"print","message":"══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════ The following TestFailure object was thrown running a test: Expected: exactly one matching node in the widget tree Actual: _TextFinder:<zero widgets with text "0" (ignoring offstage widgets)> Which: means none were found but one was expected When the exception was thrown, this was the stack: #4 main. (file:///Users/builder/clone/test/widget_test.dart:19:5) #5 testWidgets.. (package:flutter_test/src/widget_tester.dart:146:29) #6 testWidgets.. (package:flutter_test/src/widget_tester.dart) #7 TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:784:19) #10 TestWidgetsFlutterBinding._runTest (package:flutter_test/src/binding.dart:764:14) #11 AutomatedTestWidgetsFlutterBinding.runTest. (package:flutter_test/src/binding.dart:1173:24) #12 FakeAsync.run.. (package:fake_async/fake_async.dart:178:54) #17 withClock (package:clock/src/default.dart:48:10) #18 FakeAsync.run. (package:fake_async/fake_async.dart:178:22) #23 FakeAsync.run (package:fake_async/fake_async.dart:178:7) #24 AutomatedTestWidgetsFlutterBinding.runTest (package:flutter_test/src/binding.dart:1170:15) #25 testWidgets. (package:flutter_test/src/widget_tester.dart:138:24) #26 Declarer.test.. (package:test_api/src/backend/declarer.dart:175:19) #27 Declarer.test.. (package:test_api/src/backend/declarer.dart) #32 Declarer.test. (package:test_api/src/backend/declarer.dart:173:13) #33 Invoker.waitForOutstandingCallbacks. (package:test_api/src/backend/invoker.dart:231:15) #38 Invoker.waitForOutstandingCallbacks (package:test_api/src/backend/invoker.dart:228:5) #39 Invoker._onRun... (package:test_api/src/backend/invoker.dart:383:17) #40 Invoker._onRun... (package:test_api/src/backend/invoker.dart) #45 Invoker._onRun.. (package:test_api/src/backend/invoker.dart:370:9) #46 Invoker._guardIfGuarded (package:test_api/src/backend/invoker.dart:415:15) #47 Invoker._onRun. (package:test_api/src/backend/invoker.dart:369:7) #54 Invoker._onRun (package:test_api/src/backend/invoker.dart:368:11) #55 LiveTestController.run (package:test_api/src/backend/live_test_controller.dart:153:11) #56 RemoteListener._runLiveTest. (package:test_api/src/remote_listener.dart:256:16) #61 RemoteListener._runLiveTest (package:test_api/src/remote_listener.dart:255:5) #62 RemoteListener._serializeTest. (package:test_api/src/remote_listener.dart:208:7) #80 _GuaranteeSink.add (package:stream_channel/src/guarantee_channel.dart:125:12) #81 new _MultiChannel. (package:stream_channel/src/multi_channel.dart:159:31) #85 CastStreamSubscription._onData (dart:_internal/async_cast.dart:85:11) #119 new _WebSocketImpl._fromSocket. (dart:_http/websocket_impl.dart:1145:21) #127 _WebSocketProtocolTransformer._messageFrameEnd (dart:_http/websocket_impl.dart:338:23) #128 _WebSocketProtocolTransformer.add (dart:_http/websocket_impl.dart:232:46) #138 _Socket._onData (dart:io-patch/socket_patch.dart:2044:41) #147 new _RawSocket. (dart:io-patch/socket_patch.dart:1580:33) #148 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1076:14) (elided 111 frames from dart:async and package:stack_trace) This was caught by the test expectation on the following line: file:///Users/builder/clone/test/widget_test.dart line 19 The test description was: Counter increments smoke


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you didn't add a test, which I assume u didn't since it includes Counter increments smoke, so I assume that it is the one that is created by flutter when creating a new app. To fix this issue, just delete the test directory in your project.


A note about test, tests are really important when working on big projects for example since they enable you to spot bugs that you didn't anticipate, because in such projects it will be very tedious and time consuming to check every feature whenever we change a small part. Thus tests can help us with that.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...