调整元素属性,使其与失败的约束匹配

时间:2018-02-26 15:39:54

标签: react-native detox

使用detox进行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

为什么我不能点击它?

0 个答案:

没有答案