1

输入用户电子邮件地址后,我希望 Detox 按下一步移动到密码字段。

我试图通过元素 ID 查找密码字段并要求.tap()焦点,但键盘部分遮挡了密码字段,并且未能通过 75% 的可见性标准。

Error Trace: [
  {
    "Description" : "Assertion with matcher [M] failed: UI element [E] failed to match the following matcher(s): [S]",
    "Description Glossary" :     {
      "M" : "matcherForSufficientlyVisible(>=0.750000)",
      "E" : "<RCTUITextField:0x7f9abd45f190; AX=Y; AX.id='Password Input'; AX.value='your new password'; AX.frame={{42.5, 342.5}, {235, 40}}; AX.activationPoint={160, 362.5}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {235, 40}}; alpha=1; text=''>",
      "S" : "matcherForSufficientlyVisible(>=0.750000)"
    },
    "Error Domain" : "com.google.earlgrey.ElementInteractionErrorDomain",
    "Error Code" : "3",
    "File Name" : "GREYAssertions.m",
    "Function Name" : "+[GREYAssertions grey_createAssertionWithMatcher:]_block_invoke",
    "Line" : "75"
  }
]

知道如何解决这个问题吗?我正在使用 detox 来测试一个 react-native 应用程序。

谢谢。

4

1 回答 1

3

原来它就像添加\n到文本输入的末尾一样简单,如下所示:

const email = 'test@email.com';
await element(by.id('email_input')).typeText(`${email}\n`);
于 2017-11-24T12:38:14.583 回答