简体   繁体   English

如何与来自 flutter integration_test 的本机 UI 元素进行交互?

[英]How to interact with native UI elements from flutter integration_test?

I am trying to do an automated testing of the user flow in a flutter app.我正在尝试对 flutter 应用程序中的用户流进行自动测试。 For this I am using flutter integration test package ( https://flutter.dev/docs/testing/integration-tests ).为此,我正在使用 flutter 集成测试 package ( https://flutter.dev/docs/testing/integration-tests )。 I have written tests using integration_test package. Though these tests run on a physical device, there are situation where I have to interact with native UI elements (for example, clicking on a permission button to give permission to camera etc.) However, I am not able to interact with the native UI elements specifically:我已经使用 integration_test package 编写了测试。虽然这些测试在物理设备上运行,但在某些情况下我必须与本机 UI 元素交互(例如,单击权限按钮以授予相机权限等)。但是,我是无法专门与本机 UI 元素交互:

1.Tapping Allow on System permission dialog 1.在系统权限对话框中点击允许
2.Tapping on Capture button when camera is opened 2.打开相机时点击拍摄按钮
3.Selecting an image from gallery 3.从图库中选择图像

I would like to understand how the above situations can be achieved through a script and hence automated.我想了解如何通过脚本实现上述情况并因此实现自动化。 Also, can frameworks like appium-flutter-driver or flutter-driver be used in conjunction with flutter_integration to achieve this.此外,是否可以将 appium-flutter-driver 或 flutter-driver 等框架与 flutter_integration 结合使用以实现此目的。 Any pointers would be helpful.任何指针都会有所帮助。

Long story short, it is likely not currently possible.长话短说,目前可能不可能。

These two GitHub issues are pretty much our concern:这两个 GitHub 问题几乎是我们关心的问题:

But, so far, every comment about the matter has been a remark about how difficult it is.但是,到目前为止,关于此事的每条评论都是关于这件事有多么困难的评论。 The only "solution" from the Android side is to use Android ADB—but, at that point, it isn't even an integration_test anymore. Android 方面的唯一“解决方案”是使用 Android ADB——但是,到那时,它甚至不再是integration_test

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将参数传递给flutter integration_test? - How to pass parameters into flutter integration_test? integration_test package 可以与 webview 交互吗? - Can integration_test package interact with webview? Flutter integration_test:如何模拟键盘操作以从 TextField() 中清除文本? - Flutter integration_test: How to simulate keyboard action to clear text from TextField()? Flutter integration_test - 截图 - Flutter integration_test - Making screenshot 使用integration_test包在flutter集成测试中设置语言环境 - Setting locale in flutter integration test using integration_test package 使用 Flutter 新的 integration_test 的示例集成测试? - Sample integration test with Flutter new integration_test? Flutter 集成测试调试同时使用 integration_test package - Flutter integration test debugging while using integration_test package 每个版本的 integration_test 都依赖于来自 sdk 的flutter_driver,它依赖于 crypto 2.1.5 - Every version of integration_test depends on flutter_driver any from sdk which depends on crypto 2.1.5 Flutter integration_test:如何通过长按 shift 键和鼠标拖动来自动选择多个小部件 - Flutter integration_test: How to automate multiple selection of widgets by long pressing shift key and mouse drag Flutter integration_test:如何模拟鼠标右键/滚动/左键操作? - Flutter integration_test: How to simulate mouse operation like right/scroll/left clicks?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM