Skip to content

Increase timeouts in attempt to eliminate travis flakes #2016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class InAppMessagingImageOnlyViewUITests: InAppMessagingDisplayUITestsBase {
app.buttons["High Dimension Image"].tap()

// wait time longer due to large image
waitForElementToAppear(closeButton, 10)
waitForElementToAppear(closeButton, 30)

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

// wait time longer due to large image
waitForElementToAppear(closeButton, 10)
waitForElementToAppear(closeButton, 30)

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

// wait time longer due to large image
waitForElementToAppear(closeButton, 10)
waitForElementToAppear(closeButton, 30)

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

// wait time longer due to large image
waitForElementToAppear(closeButton, 10)
waitForElementToAppear(closeButton, 30)

XCTAssert(isElementExistentAndHavingSize(imageView))
XCTAssert(isUIElementWithinUIWindow(imageView))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import Foundation
import XCTest

class InAppMessagingDisplayUITestsBase: XCTestCase {
func waitForElementToAppear(_ element: XCUIElement, _ timeoutInSeconds: TimeInterval = 5) {
func waitForElementToAppear(_ element: XCUIElement, _ timeoutInSeconds: TimeInterval = 20) {
let existsPredicate = NSPredicate(format: "exists == true")
expectation(for: existsPredicate, evaluatedWith: element, handler: nil)
waitForExpectations(timeout: timeoutInSeconds, handler: nil)
}

func waitForElementToDisappear(_ element: XCUIElement, _ timeoutInSeconds: TimeInterval = 5) {
func waitForElementToDisappear(_ element: XCUIElement, _ timeoutInSeconds: TimeInterval = 20) {
let existsPredicate = NSPredicate(format: "exists == false")
expectation(for: existsPredicate, evaluatedWith: element, handler: nil)
waitForExpectations(timeout: timeoutInSeconds, handler: nil)
Expand Down