调整元素属性,使其与失败的约束相匹配
Adjust element properties so that it matches the failed constraint(s)
使用 detox 测试 ios
的 react-native
我有一个link
<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
为什么我不能点击它?
已变成 link 不可见(必须向下滚动才能显示在屏幕上)
使用 detox 测试 ios
的 react-native我有一个link
<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
为什么我不能点击它?
已变成 link 不可见(必须向下滚动才能显示在屏幕上)