使用 Flutterintegration_test
包时,由于无法从测试环境访问的 iOS 权限请求,我遇到了测试不断失败的问题。
我applesimutils
从github.com/wix/AppleSimulatorUtils尝试过,但是在尝试在颤动驱动器之前设置权限时,应用程序的包标识符尚未注册:
Got error:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
The operation couldn’t be completed. No such file or directory
No such file or directory
也许可以通过不每次都创建一个新的 Simulator 实例来避免这种情况,但是我通过在命令flutter drive ... & sleep 10
之前运行applesimutils --setPermissions
以允许应用程序首先启动来解决这个问题,但这仍然给了我:
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════
The following LocationError object was thrown running a test:
[LocationError code: 0, message: null]
When the exception was thrown, this was the stack:
#2 BackgroundGeolocation.getCurrentPosition.<anonymous closure>
(package:flutter_background_geolocation/models/background_geolocation.dart:497:17)
...