[英]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.