You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[auick_action_ios] Retries multiple times to not fail ci when there is a flake (#3823)
The only way that we found to test quick action menu is to long press for a x second. Previously, we pressed it for 2 seconds but it is sometimes too long and the quick action menu is disappeared.
In this PR, we:
1. Reduce the press time to 1.5 seconds.
2. Retry 3 times.
fixesflutter/flutter#125509
if !quickActionsAppIcon.waitForExistence(timeout: elementWaitingTime){
29
-
XCTFail(
30
-
"Failed due to not able to find the example app from springboard with \(elementWaitingTime) seconds. Springboard debug description: \(springboard.debugDescription)"
31
-
)
32
-
}
33
-
34
-
quickActionsAppIcon.press(forDuration:2)
35
-
36
-
letactionTwo= springboard.buttons["Action two"]
37
-
if !actionTwo.waitForExistence(timeout: elementWaitingTime){
38
-
XCTFail(
39
-
"Failed due to not able to find the actionTwo button from springboard with \(elementWaitingTime) seconds. Springboard debug description: \(springboard.debugDescription)"
if !actionOneConfirmation.waitForExistence(timeout: elementWaitingTime){
80
80
XCTFail(
81
-
"Failed due to not able to find the actionOne button from springboard with \(elementWaitingTime) seconds. Springboard debug description: \(springboard.debugDescription)"
81
+
"Failed due to not able to find the actionOneConfirmation in the app with \(elementWaitingTime) seconds. Springboard debug description: \(springboard.debugDescription)"
if !quickActionsAppIcon.waitForExistence(timeout: elementWaitingTime){
93
+
XCTFail(
94
+
"Failed due to not able to find the example app from springboard with \(elementWaitingTime) seconds. Springboard debug description: \(springboard.debugDescription)"
if deleteButton.waitForExistence(timeout: elementWaitingTime){
105
+
// Found delete button instead, we pressed too long, reduce the press time.
106
+
pressDuration -= pressDurationRetryAdjustment
107
+
}else{
108
+
// Neither action button nor delete button was found, we need a longer press.
109
+
pressDuration += pressDurationRetryAdjustment
110
+
}
111
+
// Reset to previous state.
112
+
XCUIDevice.shared.press(XCUIDevice.Button.home)
113
+
}
114
+
if(!actionButton!.exists){
89
115
XCTFail(
90
-
"Failed due to not able to find the actionOneConfirmation in the app with \(elementWaitingTime) seconds. Springboard debug description: \(springboard.debugDescription)"
116
+
"Failed due to not able to find the \(buttonName) button from springboard with \(elementWaitingTime) seconds. Springboard debug description: \(springboard.debugDescription)"
0 commit comments