Skip to content

Commit 92a57d7

Browse files
authored
Increase timeouts in attempt to eliminate travis flakes (#2016)
1 parent 5e37beb commit 92a57d7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

InAppMessagingDisplay/Example/InAppMessagingDisplay-UITests/InAppMessagingDisplayImageOnlyViewUITests.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class InAppMessagingImageOnlyViewUITests: InAppMessagingDisplayUITestsBase {
7676
app.buttons["High Dimension Image"].tap()
7777

7878
// wait time longer due to large image
79-
waitForElementToAppear(closeButton, 10)
79+
waitForElementToAppear(closeButton, 30)
8080

8181
XCTAssert(isElementExistentAndHavingSize(imageView))
8282
XCTAssert(isUIElementWithinUIWindow(imageView))
@@ -101,7 +101,7 @@ class InAppMessagingImageOnlyViewUITests: InAppMessagingDisplayUITestsBase {
101101
app.buttons["Low Dimension Image"].tap()
102102

103103
// wait time longer due to large image
104-
waitForElementToAppear(closeButton, 10)
104+
waitForElementToAppear(closeButton, 30)
105105

106106
XCTAssert(isElementExistentAndHavingSize(imageView))
107107
XCTAssert(isUIElementWithinUIWindow(imageView))
@@ -123,7 +123,7 @@ class InAppMessagingImageOnlyViewUITests: InAppMessagingDisplayUITestsBase {
123123
app.buttons["Wide Image"].tap()
124124

125125
// wait time longer due to large image
126-
waitForElementToAppear(closeButton, 10)
126+
waitForElementToAppear(closeButton, 30)
127127

128128
XCTAssert(isElementExistentAndHavingSize(imageView))
129129
XCTAssert(isUIElementWithinUIWindow(imageView))
@@ -145,7 +145,7 @@ class InAppMessagingImageOnlyViewUITests: InAppMessagingDisplayUITestsBase {
145145
app.buttons["Narrow Image"].tap()
146146

147147
// wait time longer due to large image
148-
waitForElementToAppear(closeButton, 10)
148+
waitForElementToAppear(closeButton, 30)
149149

150150
XCTAssert(isElementExistentAndHavingSize(imageView))
151151
XCTAssert(isUIElementWithinUIWindow(imageView))

InAppMessagingDisplay/Example/InAppMessagingDisplay-UITests/InAppMessagingDisplayUITestsBase.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import Foundation
1919
import XCTest
2020

2121
class InAppMessagingDisplayUITestsBase: XCTestCase {
22-
func waitForElementToAppear(_ element: XCUIElement, _ timeoutInSeconds: TimeInterval = 5) {
22+
func waitForElementToAppear(_ element: XCUIElement, _ timeoutInSeconds: TimeInterval = 20) {
2323
let existsPredicate = NSPredicate(format: "exists == true")
2424
expectation(for: existsPredicate, evaluatedWith: element, handler: nil)
2525
waitForExpectations(timeout: timeoutInSeconds, handler: nil)
2626
}
2727

28-
func waitForElementToDisappear(_ element: XCUIElement, _ timeoutInSeconds: TimeInterval = 5) {
28+
func waitForElementToDisappear(_ element: XCUIElement, _ timeoutInSeconds: TimeInterval = 20) {
2929
let existsPredicate = NSPredicate(format: "exists == false")
3030
expectation(for: existsPredicate, evaluatedWith: element, handler: nil)
3131
waitForExpectations(timeout: timeoutInSeconds, handler: nil)

0 commit comments

Comments
 (0)