Skip to content

Commit

Permalink
Increase timeouts on autoconsent tests (#2025)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/414709148257752/1205538431071019/f

Description:
Increase timeouts on autoconsent tests
  • Loading branch information
miasma13 authored Sep 20, 2023
1 parent 52db6db commit 92dfd88
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions IntegrationTests/AutoconsentBackgroundTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ final class AutoconsentBackgroundTests: XCTestCase {
webview.navigationDelegate = navigationDelegate
let url = Bundle(for: type(of: self)).url(forResource: "autoconsent-test-page", withExtension: "html")!
webview.loadFileURL(url, allowingReadAccessTo: url.deletingLastPathComponent())
waitForExpectations(timeout: 4)
waitForExpectations(timeout: 10)

let expectation = expectation(description: "Async call")
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
webview.evaluateJavaScript("results.results.includes('button_clicked')", in: nil, in: .page,
completionHandler: { result in
switch result {
Expand All @@ -92,7 +92,7 @@ final class AutoconsentBackgroundTests: XCTestCase {
expectation.fulfill()
})
}
waitForExpectations(timeout: 4)
waitForExpectations(timeout: 10)
}

@MainActor
Expand All @@ -113,10 +113,10 @@ final class AutoconsentBackgroundTests: XCTestCase {
webview.navigationDelegate = navigationDelegate
let url = Bundle(for: type(of: self)).url(forResource: "autoconsent-test-page-banner", withExtension: "html")!
webview.loadFileURL(url, allowingReadAccessTo: url.deletingLastPathComponent())
waitForExpectations(timeout: 4)
waitForExpectations(timeout: 10)

let expectation = expectation(description: "Async call")
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
webview.evaluateJavaScript("window.getComputedStyle(banner).display === 'none'", in: nil, in: .page,
completionHandler: { result in
switch result {
Expand All @@ -130,7 +130,7 @@ final class AutoconsentBackgroundTests: XCTestCase {
expectation.fulfill()
})
}
waitForExpectations(timeout: 4)
waitForExpectations(timeout: 10)
}
}

Expand Down

0 comments on commit 92dfd88

Please sign in to comment.