Travis CI的iOS排毒测试失败
我的排毒测试在本地运行良好,但每当我从Travis运行它们时,似乎都失败了。例如,以下各项在本地计算机上运行良好:Travis CI的iOS排毒测试失败,ios,react-native,continuous-integration,travis-ci,detox,Ios,React Native,Continuous Integration,Travis Ci,Detox,我的排毒测试在本地运行良好,但每当我从Travis运行它们时,似乎都失败了。例如,以下各项在本地计算机上运行良好: test('should have welcome screen and skip button hides on last frame', async() => { await expect(element(by.id('WelcomeScreen_Skip'))).toBeVisible(); await expect(element(by.id('Wel
test('should have welcome screen and skip button hides on last frame', async() => {
await expect(element(by.id('WelcomeScreen_Skip'))).toBeVisible();
await expect(element(by.id('WelcomeScreen_Carousel'))).toBeVisible();
await element(by.id('WelcomeScreen_Carousel')).swipe('left');
});
但是,Travis上的相同代码块失败,出现以下错误:
Welcome Screen › should have welcome screen and skip button hides on last frame
An assertion failed.
Exception with Assertion: {
"Assertion Criteria": "assertWithMatcher:matcherForSufficientlyVisible(>=0.750000)",
"Element Matcher": "((!(kindOfClass('RCTScrollView')) && ((respondsToSelector(accessibilityIdentifier) && accessibilityID('WelcomeScreen_Skip')) && !(kindOfClass('UIAccessibilityTextFieldElement')))) || (((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && parentThatMatches(kindOfClass('RCTScrollView'))) && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && parentThatMatches(((respondsToSelector(accessibilityIdentifier) && accessibilityID('WelcomeScreen_Skip')) && !(kindOfClass('UIAccessibilityTextFieldElement')))))))"
}
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": "<RCTTextView:0x7fa8cac55c10; AX=Y; AX.id='WelcomeScreen_Skip'; AX.label='Skip'; AX.frame={{320.66665649414062, 60}, {38.666656494140625, 24.333335876464844}}; AX.activationPoint={339.99998474121094, 72.166667938232422}; AX.traits='UIAccessibilityTraitStaticText'; AX.focused='N'; frame={{0, 0}, {38.666656494140625, 24.333335876464844}}; alpha=1>",
"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"
}
]
刷卡失败,这是没有意义的,因为测试表明相同的id在之前的线路上通过。以下是错误:
Cannot perform action due to constraint(s) failure.
Exception with Action: {
"Action Name": "Swipe Left for duration 0.1",
"Element Description": "<RCTCustomScrollView:0x7f967a1e0800; AX=N; AX.frame={{0, 126}, {375, 654}}; AX.activationPoint={187.5, 453}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 654}}; opaque; alpha=1>",
"Failed Constraint(s)": "interactable",
"All Constraint(s)": "(interactable && !(isSystemAlertViewShown) && kindOfClass('UIView') && respondsToSelector(accessibilityFrame))",
"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"
}
]
Cannot perform action due to constraint(s) failure.
Exception with Action: {
"Action Name": "Swipe Left for duration 0.1",
"Element Description": "<RCTCustomScrollView:0x7f967a1e0800; AX=N; AX.frame={{0, 126}, {375, 654}}; AX.activationPoint={187.5, 453}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 654}}; opaque; alpha=1>",
"Failed Constraint(s)": "interactable",
"All Constraint(s)": "(interactable && !(isSystemAlertViewShown) && kindOfClass('UIView') && respondsToSelector(accessibilityFrame))",
"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"
}
]
Detox: 15.5.0
React Native: 0.61.2
Node: 13.0.1
Device: iPhone 11
Xcode: Xcode 10.2.1
macOS: 10.14.4
Test Runner: Jest