0

使用 detox 测试 react-native for ios

我有一个链接

<TouchableOpacity onPress={() => onLinkPress(url)} testID={'someId'}>
  <Text>asd</Text>
</TouchableOpacity>

但不能点击它element(by.id('someId')).tap()

错误

  Error: Error: Cannot perform action due to constraint(s) failure.
Exception with Action: {
  "Action Name" : "Tap",
  "Element Description" : "<RCTView:0x7f8d8fa34c30; AX=Y; AX.id='clade-member-profile-org-link-apple.com'; AX.label='Apple Investor apple.com'; AX.frame={{20, 699}, {280, 72}}; AX.activationPoint={160, 735}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {280, 72}}; opaque; alpha=1>",
  "Failed Constraint(s)" : "interactable",
  "All Constraint(s)" : "(!(isSystemAlertViewShown) && ((respondsToSelector(isAccessibilityElement) && isAccessibilityElement) || kindOfClass('UIView')) && (enabled && !(((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches(!(enabled))))) && interactable)",
  "Recovery Suggestion" : "Adjust element properties so that it matches the failed constraint(s)."
}

[
  {
    "Description" : "Cannot perform action due to constraint(s) failure.",
    "Error Domain" : "com.google.earlgrey.ElementInteractionErrorDomain",
    "Error Code" : "1",
    "File Name" : "GREYBaseAction.m",
    "Function Name" : "-[GREYBaseAction satisfiesConstraintsForElement:error:]",
    "Line" : "66"
  }
]

排毒 7.1.0

为什么我不能点击它?

4

1 回答 1

0

那个链接不可见(必须向下滚动才能显示在屏幕上)

于 2018-02-26T16:50:27.323 回答