Flutter驱动程序与本机元素交互

时间:2019-04-02 18:26:42

标签: ios flutter flutter-test

我很难使用Flutter Driver进行测试,我认为这可能是一个限制,问题是因为我无法与本机元素进行交互,我的意思是,我正在与Google建立联系,并在致电后iOS上的一个功能,它显示一个对话框以确认登录

enter image description here

但是在集成测试中,我不知道如何与之交互

final buttonLoginFinder = find.byValueKey('login_button');
final buttonContinueFinder = find.text('Continue');
// ...

await driver.tap(buttonLoginFinder);
await driver.waitFor(buttonContinueFinder);
await driver.tap(buttonContinueFinder);

1 个答案:

答案 0 :(得分:-1)

从我的角度来看,这不是测试应用程序的正确方法。 Google登录应该被视为黑匣子。 因此,在集成测试期间,应该对其进行模拟,并且在尝试登录时无需进行特殊对话框交互就只返回true / false。 这样,您可以假定Google登录作为第三方库可以正常工作,并跳过外部组件的集成测试。