【问题标题】:Detox: iOS Simulator how to press Next on keyboard排毒:iOS 模拟器如何在键盘上按 Next
【发布时间】:2018-05-08 11:16:17
【问题描述】:

输入用户电子邮件地址后,我希望 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 应用程序。

谢谢。

【问题讨论】:

    标签: ios react-native ios-simulator detox


    【解决方案1】:

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

    const email = 'test@email.com';
    await element(by.id('email_input')).typeText(`${email}\n`);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-18
      • 2018-06-17
      • 1970-01-01
      • 2018-05-11
      • 2011-09-20
      • 2020-01-20
      • 2023-03-23
      • 1970-01-01
      相关资源
      最近更新 更多