在模拟器中查看Flutter小部件测试 [英] View Flutter widget tests in simulator

查看:66
本文介绍了在模拟器中查看Flutter小部件测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在模拟器中查看UI测试?

Is there a way to see the UI tests in the simulator?

我正在为具有动画的小部件编写一些测试,并希望验证我的测试是否正确触发了动画.

I am writing some tests for a widget which has animation and want to verify my tests are triggering the animation correctly.

推荐答案

找到了 answer 在文档"页面上:

Found the answer from the Docs page:

为帮助调试窗口小部件测试,您可以使用debugDumpApp()函数可视化测试的UI状态,或简单地按一下flift run test/widget_test.dart即可在首选的运行时环境(例如模拟器或测试环境)中查看测试运行设备.在窗口小部件测试的Flutter运行会话期间,您还可以交互地点击屏幕上的Flutter工具部分以打印建议的Finder.

To help debug widget tests, you can use the debugDumpApp() function to visualize the UI state of your test or simply flutter run test/widget_test.dart to see your test run in your preferred runtime environment such as a simulator or a device. During a flutter run session on a widget test, you can also interactively tap parts of the screen for the Flutter tool to print the suggested Finder.

这篇关于在模拟器中查看Flutter小部件测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆