ios - Flutter 驱动程序与原生元素交互
问题描述
我很难使用 Flutter Driver 进行测试,我认为这可能是一个限制,问题是因为我无法与原生元素交互,我的意思是,我正在使用 Google 构建登录,并且在调用函数后iOS它显示一个确认登录的对话框
但是在集成测试中我不知道如何与之交互
final buttonLoginFinder = find.byValueKey('login_button');
final buttonContinueFinder = find.text('Continue');
// ...
await driver.tap(buttonLoginFinder);
await driver.waitFor(buttonContinueFinder);
await driver.tap(buttonContinueFinder);
解决方案
从我的角度来看,这不是测试您的应用程序的正确方法。Google 登录应被视为一个黑匣子。因此,在集成测试期间,应该对其进行模拟,并在尝试登录而无需特定对话交互时仅返回真/假。这样,您可以假设 Google Sign In 作为第三方库正常工作,并跳过外部组件的集成测试。
推荐阅读
- sql-server - 如何将oracle函数“trunc”转换为sql server (MSSQL)
- python - 如何通过 python 获取 Selenium 的价值
- vue.js - Nuxt js的异步方法中的“Vue”类型上不存在属性“信息”
- jsf - 通过 HTTPS 下载的 JSF 无法正常工作,即使在 HTTP 下工作正常
- pytorch - Pytorch nn.Module 的派生类无法通过 Python 中的模块导入加载
- azure - Azure 数据库和架构更改跟踪
- angular - 如何在 Visual Studio Code 中复制非类型化函数(TypeScript)的推断类型很长
- html - 来自模型 django ModelForm 的图像下拉列表
- java - 'android.useAndroidX' 属性未启用
- linux - 我想使用期望脚本将数据发送到流入数据库