Skip to content

Commit

Permalink
extend timeout for webview tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IhmeHippi committed Jun 1, 2020
1 parent bccd3ae commit 4e6c61e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions SwedbankPaySDKTests/SwedbankPaySDKControllerTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import WebKit
@testable import SwedbankPaySDK

class SwedbankPaySDKControllerTestCase : XCTestCase {
private let webviewLoadingTimeout = 5 as TimeInterval

private var window: UIWindow?

var viewController: SwedbankPaySDKController! {
Expand Down Expand Up @@ -66,9 +68,9 @@ class SwedbankPaySDKControllerTestCase : XCTestCase {
func waitForWebViewLoaded() {
let webView = self.webView
let loadingStarted = XCTKVOExpectation(keyPath: #keyPath(WKWebView.isLoading), object: webView, expectedValue: true)
wait(for: [loadingStarted], timeout: 1)
wait(for: [loadingStarted], timeout: webviewLoadingTimeout)
let loadingFinished = XCTKVOExpectation(keyPath: #keyPath(WKWebView.isLoading), object: webView, expectedValue: false)
wait(for: [loadingFinished], timeout: 1)
wait(for: [loadingFinished], timeout: webviewLoadingTimeout)
}

func expectEmptyWebView() -> XCTestExpectation {
Expand Down

0 comments on commit 4e6c61e

Please sign in to comment.