Skip to content
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

Update supported Xcode version to 16.0 #3320

Closed
wants to merge 70 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
c7eed7e
Update supported Xcode version to 16.0
ayoy Sep 20, 2024
5924439
Update BSK
ayoy Sep 21, 2024
c77ca9c
Fix DataBrokerProtectionOperationQueue protocol
ayoy Sep 21, 2024
42ad38b
Update MockDataBrokerProtectionOperationQueue
ayoy Sep 21, 2024
fa02793
Fix failing ErrorPageTests
ayoy Sep 21, 2024
92c85be
Update to macos-15 runners
ayoy Sep 25, 2024
82b536f
Update BSK ref
ayoy Sep 25, 2024
0d87645
Don't build SPM dependencies for UI tests
ayoy Sep 26, 2024
a5c86ac
Disable buildImplicitDependencies
ayoy Sep 26, 2024
ee85d30
Update ui tests workflows
ayoy Sep 26, 2024
3e205b6
Make TestsURLExtension.swift independent of BSK
ayoy Sep 26, 2024
bf9875e
Make BookmarksBarTests.swift independent of BSK
ayoy Sep 26, 2024
e919ef2
Remove StringExtension from UI Tests target
ayoy Sep 26, 2024
f2c3627
Make UI Tests independent of BSK
ayoy Sep 26, 2024
1552f80
Temporarily add dependencies.patch
ayoy Sep 26, 2024
dce247c
Update BSK ref
ayoy Oct 14, 2024
d5f6a5e
Fix BrowserTabViewControllerOnboardingTests compilation
ayoy Oct 14, 2024
83aa5a2
Merge branch 'main' into dominik/xcode-16
jotaemepereira Oct 21, 2024
1ba57c0
Fix testDragAndDropToReorderIsNotPossibleWhenInSearchOnBookmarksManager
jotaemepereira Oct 22, 2024
532d364
Fix BookmarksBarTests
jotaemepereira Oct 22, 2024
f2906d5
WIP: Fix BookmarksAndFavoriteTests
jotaemepereira Oct 22, 2024
395bf26
Insert favorites when bookmark is favorite and no index (#3442)
jotaemepereira Oct 23, 2024
dffa3eb
Fix restoration and pinned tab tests
jotaemepereira Oct 23, 2024
45b3fc7
Point to specific commit
jotaemepereira Oct 23, 2024
52a0617
Update dependencies.patch
jotaemepereira Oct 24, 2024
6af0614
Force apply the patch
jotaemepereira Oct 24, 2024
73a1071
Revert force apply patch
jotaemepereira Oct 24, 2024
f8cfabc
Update dependencies patch
jotaemepereira Oct 24, 2024
22fcba4
Remove step of deleting packages
jotaemepereira Oct 24, 2024
8f9bdf8
Fix opening settings page
jotaemepereira Oct 24, 2024
e71804d
Fix more UI tests
jotaemepereira Oct 25, 2024
38a878b
Fix tests for macOS 14 and 13
jotaemepereira Oct 25, 2024
5eadd4a
Add new step to have screenshot
jotaemepereira Oct 25, 2024
5e0f1f0
Fix report
jotaemepereira Oct 25, 2024
c54ceb3
Disable some UI tests for the CI to fail faster
jotaemepereira Oct 25, 2024
dab8bff
Fix workflow
jotaemepereira Oct 25, 2024
5e75673
Fix workflow
jotaemepereira Oct 25, 2024
b275b90
Only run on macOS 15
jotaemepereira Oct 25, 2024
f7a2e24
Used fork that works with Xcode16
jotaemepereira Oct 25, 2024
e0c07b4
Update workflow
jotaemepereira Oct 25, 2024
6f1b641
Run all tests
jotaemepereira Oct 25, 2024
648ebc6
Try to dismiss system notification
jotaemepereira Oct 26, 2024
0d51e21
Revert "Try to dismiss system notification"
jotaemepereira Oct 26, 2024
3974226
Revert screenshot
jotaemepereira Oct 29, 2024
cf4fb30
Revert "Revert screenshot"
jotaemepereira Oct 29, 2024
db87e70
Update screen resolution
jotaemepereira Oct 29, 2024
2bbe27b
Set window width
jotaemepereira Oct 29, 2024
ab1d61b
Change new window size
jotaemepereira Oct 29, 2024
7d53a9b
Try other width
jotaemepereira Oct 30, 2024
37b2a59
Resize window
jotaemepereira Oct 30, 2024
add15a2
Revert window sizing and use screen resolution on workflow
jotaemepereira Oct 30, 2024
8015e37
Create test screen size workflow
jotaemepereira Oct 30, 2024
540fcf2
Test Screen size
jotaemepereira Oct 30, 2024
0d474ee
Improve log verbose
jotaemepereira Oct 30, 2024
779e318
Another try
jotaemepereira Oct 30, 2024
f56f30f
Test on macOS 14
jotaemepereira Oct 30, 2024
8961b83
Test on macOS 13
jotaemepereira Oct 30, 2024
8742776
Test command
jotaemepereira Oct 30, 2024
5a70f9e
Another test
jotaemepereira Oct 30, 2024
8e485ae
Test adding logs
jotaemepereira Oct 30, 2024
fef8186
Use screen resolution
jotaemepereira Oct 30, 2024
aebcf2a
Test using new library to set resolution
jotaemepereira Oct 30, 2024
ad4a622
Update display
jotaemepereira Oct 30, 2024
ece0ad1
List available resolutions
jotaemepereira Oct 30, 2024
3fedae8
Update resolution with available ones
jotaemepereira Oct 30, 2024
7b5d657
Change resolution before UI tests
jotaemepereira Oct 30, 2024
5ebab3e
Add macOS 13 and macOS 14 runners
jotaemepereira Oct 31, 2024
5aa1c0f
Merge branch 'main' into dominik/xcode-16
jotaemepereira Nov 1, 2024
02b5a06
Merge branch 'main' into dominik/xcode-16
jotaemepereira Nov 1, 2024
b47ef24
Fix bad merge
jotaemepereira Nov 1, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/build_notarized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:

name: Export Notarized App

runs-on: macos-14-xlarge
runs-on: macos-15-xlarge

outputs:
app-version: ${{ steps.set-outputs.outputs.app-version }}
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
needs: export-notarized-app
if: ${{ github.event.inputs.create-dmg == true || inputs.create-dmg == true }}

runs-on: macos-14
runs-on: macos-15

env:
app-version: ${{ needs.export-notarized-app.outputs.app-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bump_internal_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

# This doesn't need Xcode, so could technically run on Ubuntu, but find_asana_release_task.sh
# uses BSD-specific `date` syntax, that doesn't work with GNU `date` (available on Linux).
runs-on: macos-14
runs-on: macos-15
timeout-minutes: 10

outputs:
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
name: Increment Build Number

needs: [ validate_input_conditions, run_tests ]
runs-on: macos-14-xlarge
runs-on: macos-15-xlarge
timeout-minutes: 10

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/code_freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

name: Create Release Branch

runs-on: macos-14-xlarge
runs-on: macos-15-xlarge
timeout-minutes: 10

outputs:
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
name: Increment Build Number

needs: [ create_release_branch, run_tests ]
runs-on: macos-14-xlarge
runs-on: macos-15-xlarge
timeout-minutes: 10

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_variant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
ATB_VARIANT_NAME: ${{ inputs.atb-variant || github.event.inputs.atb-variant }}
ORIGIN_VARIANT_NAME: ${{ inputs.origin-variant || github.event.inputs.origin-variant }}

runs-on: macos-14
runs-on: macos-15
timeout-minutes: 15

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

name: Create Release Branch

runs-on: macos-14-xlarge
runs-on: macos-15-xlarge
timeout-minutes: 10

outputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_dmg_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
# or failed (for public releases or hotfixes), because tagging doesn't block publishing the release
if: always()

runs-on: macos-14-xlarge
runs-on: macos-15-xlarge
timeout-minutes: 10

steps:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/screen_size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This is a basic workflow to help you get started with Actions

name: Screen Size Tests

# Controls when the action will run.
on:
workflow_dispatch:
jobs:
screentest:
name: UI tests
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: [macos-15-xlarge]
include:
- xcode-version: "16.0"
runner: macos-15-xlarge

steps:
- name: default screen resolution
run: system_profiler SPDisplaysDataType | grep Resolution

- name: change screen resolution
run: |
"/Library/Application Support/VMware Tools/vmware-resolutionSet" 1080 2160

- name: new screen resolution
run: system_profiler SPDisplaysDataType | grep Resolution
14 changes: 13 additions & 1 deletion .github/workflows/sync_end_to_end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ jobs:
strategy:
fail-fast: false
matrix:
runner: [macos-13-xlarge, macos-14-xlarge]
runner: [macos-13-xlarge, macos-14-xlarge, macos-15-xlarge]
include:
- xcode-version: "15.2"
runner: macos-13-xlarge
- xcode-version: "15.4"
runner: macos-14-xlarge
- xcode-version: "16.0"
runner: macos-15-xlarge

timeout-minutes: 60

Expand Down Expand Up @@ -100,6 +102,16 @@ jobs:
with:
debug: true

# This first bit is a hack to stop the app building package dependencies that isn't needed by the test runner
# Otherwise xcodebuild will attempt building BSK and linking GRDB framework that is incompatible with Xcode 15
- name: Build test runner
run: |
rm -rf LocalPackages
rm -rf DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
git apply dependencies.patch
# sed -i '' '/\/\* Begin XCSwiftPackageProductDependency section \*\//,/\/\* End XCSwiftPackageProductDependency section \*\//d' DuckDuckGo.xcodeproj/project.pbxproj
# sed -i '' '/\/\* Begin XCRemoteSwiftPackageReference section \*\//,/\/\* End XCRemoteSwiftPackageReference section \*\//d' DuckDuckGo.xcodeproj/project.pbxproj

- name: Build Sync e2e tests
run: |
set -o pipefail && xcodebuild build-for-testing \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

# This doesn't need Xcode, so could technically run on Ubuntu, but actions that add comments and tasks
# in Asana use BSD-specific sed syntax, that doesn't work with GNU sed (available on Linux).
runs-on: macos-14
runs-on: macos-15

env:
asana-task-url: ${{ github.event.inputs.asana-task-url || inputs.asana-task-url }}
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ jobs:
strategy:
fail-fast: false
matrix:
runner: [macos-13-xlarge, macos-14-xlarge]
runner: [macos-13-xlarge, macos-14-xlarge, macos-15-xlarge]
include:
- xcode-version: "15.2"
runner: macos-13-xlarge
- xcode-version: "15.4"
runner: macos-14-xlarge
- xcode-version: "16"
runner: macos-15-xlarge

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.runner }}
Expand All @@ -52,6 +54,20 @@ jobs:
timeout-minutes: 120

steps:
- name: Install screenresolution
run: brew install screenresolution

- name: List available resolution
run: |
screenresolution list

- name: change screen resolution
run: screenresolution set 1920x1080x32@60

- name: Get New Screen Resolution
run: |
screenresolution get || echo "Screen resolution data not available"

- name: Register SSH key for certificates repository access
uses: webfactory/[email protected]
with:
Expand Down Expand Up @@ -167,4 +183,4 @@ jobs:
asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
asana-project: ${{ vars.MACOS_APP_DEVELOPMENT_ASANA_PROJECT_ID }}
asana-task-name: GH Workflow Failure - UI Tests
asana-task-description: The UI Tests workflow has failed. See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
asana-task-description: The UI Tests workflow has failed. See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
2 changes: 1 addition & 1 deletion .xcode-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.4
16.0
10 changes: 4 additions & 6 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2737,6 +2737,7 @@
B6F9BDE52B45CD1900677B33 /* ModalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6F9BDE32B45CD1900677B33 /* ModalView.swift */; };
B6FA893F269C424500588ECD /* PrivacyDashboardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6FA893E269C424500588ECD /* PrivacyDashboardViewController.swift */; };
B6FA8941269C425400588ECD /* PrivacyDashboardPopover.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6FA8940269C425400588ECD /* PrivacyDashboardPopover.swift */; };
BB1AD7232CC94F1D00210797 /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = EE02D41F2BB460C000DBE6B3 /* BrowserServicesKit */; };
BB4339DB2C7F9606005D7ED7 /* PinnedTabsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4339DA2C7F9606005D7ED7 /* PinnedTabsTests.swift */; };
BB470EBB2C5A66D6002EE91D /* BookmarkManagementDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB470EBA2C5A66D6002EE91D /* BookmarkManagementDetailViewModel.swift */; };
BB470EBC2C5A66D6002EE91D /* BookmarkManagementDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB470EBA2C5A66D6002EE91D /* BookmarkManagementDetailViewModel.swift */; };
Expand Down Expand Up @@ -2926,8 +2927,6 @@
EA8AE76A279FBDB20078943E /* ClickToLoadTDSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA8AE769279FBDB20078943E /* ClickToLoadTDSTests.swift */; };
EE02D41A2BB4609900DBE6B3 /* UITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE02D4192BB4609900DBE6B3 /* UITests.swift */; };
EE02D41C2BB460A600DBE6B3 /* BrowsingHistoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE02D41B2BB460A600DBE6B3 /* BrowsingHistoryTests.swift */; };
EE02D4202BB460C000DBE6B3 /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = EE02D41F2BB460C000DBE6B3 /* BrowserServicesKit */; };
EE02D4212BB460FE00DBE6B3 /* StringExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA8EDF2624923EC70071C2E8 /* StringExtension.swift */; };
EE02D4222BB4611A00DBE6B3 /* TestsURLExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6EC37FB29B83E99001ACE79 /* TestsURLExtension.swift */; };
EE0429E02BA31D2F009EB20F /* FindInPageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0429DF2BA31D2F009EB20F /* FindInPageTests.swift */; };
EE098E772C8EDE2C009EBA7F /* AutofillCredentialsImportManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE098E762C8EDE2C009EBA7F /* AutofillCredentialsImportManager.swift */; };
Expand Down Expand Up @@ -4998,7 +4997,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
EE02D4202BB460C000DBE6B3 /* BrowserServicesKit in Frameworks */,
BB1AD7232CC94F1D00210797 /* BrowserServicesKit in Frameworks */,
9D9DE57F2C63B64F00D20B15 /* AppKitExtensions in Frameworks */,
B64E42872B908501006C1346 /* SnapshotTesting in Frameworks */,
);
Expand Down Expand Up @@ -12347,7 +12346,6 @@
EE02D41A2BB4609900DBE6B3 /* UITests.swift in Sources */,
EE0429E02BA31D2F009EB20F /* FindInPageTests.swift in Sources */,
BBCD467A2C8643EC004DB483 /* XCUIApplicationExtension.swift in Sources */,
EE02D4212BB460FE00DBE6B3 /* StringExtension.swift in Sources */,
BBBB65402C77BB9400E69AC6 /* BookmarkSearchTests.swift in Sources */,
56A054532C2592CE007D8FAB /* OnboardingUITests.swift in Sources */,
EE9D81C32BC57A3700338BE3 /* StateRestorationTests.swift in Sources */,
Expand Down Expand Up @@ -14683,8 +14681,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 202.3.0;
branch = "dominik/xcode-16";
kind = branch;
};
};
9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "7b78b46340c9981b9774352be08c3c28b3a19011",
"version" : "202.3.0"
"branch" : "dominik/xcode-16",
"revision" : "8fb01fbcaf16035d41f543e74c34c3df011847eb"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
buildImplicitDependencies = "NO">
</BuildAction>
<TestAction
buildConfiguration = "Review"
Expand Down
1 change: 0 additions & 1 deletion DuckDuckGo/Windows/View/WindowsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ final class WindowsManager {

if let droppingPoint {
mainWindowController.window?.setFrameOrigin(droppingPoint: droppingPoint)

} else if let sourceWindow = self.findPositioningSourceWindow(for: tabCollectionViewModel?.tabs.first) {
mainWindowController.window?.setFrameOrigin(cascadedFrom: sourceWindow)
}
Expand Down
81 changes: 80 additions & 1 deletion IntegrationTests/Common/TestsURLExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
//

import Foundation
import Common

// Integration Tests helpers
extension URL {
Expand Down Expand Up @@ -62,4 +61,84 @@ extension URL {
return url
}

private func appendingParameters<QueryParams: Collection>(_ parameters: QueryParams, allowedReservedCharacters: CharacterSet? = nil) -> URL
where QueryParams.Element == (key: String, value: String) {

return parameters.reduce(self) { partialResult, parameter in
partialResult.appendingParameter(
name: parameter.key,
value: parameter.value,
allowedReservedCharacters: allowedReservedCharacters
)
}
}

private func appendingParameter(name: String, value: String, allowedReservedCharacters: CharacterSet? = nil) -> URL {
let queryItem = URLQueryItem(percentEncodingName: name,
value: value,
withAllowedCharacters: allowedReservedCharacters)
return self.appending(percentEncodedQueryItem: queryItem)
}

private func appending(percentEncodedQueryItem: URLQueryItem) -> URL {
appending(percentEncodedQueryItems: [percentEncodedQueryItem])
}

private func appending(percentEncodedQueryItems: [URLQueryItem]) -> URL {
guard var components = URLComponents(url: self, resolvingAgainstBaseURL: true) else { return self }

var existingPercentEncodedQueryItems = components.percentEncodedQueryItems ?? [URLQueryItem]()
existingPercentEncodedQueryItems.append(contentsOf: percentEncodedQueryItems)
components.percentEncodedQueryItems = existingPercentEncodedQueryItems

return components.url ?? self
}
}

fileprivate extension URLQueryItem {

init(percentEncodingName name: String, value: String, withAllowedCharacters allowedReservedCharacters: CharacterSet? = nil) {
let allowedCharacters: CharacterSet = {
if let allowedReservedCharacters = allowedReservedCharacters {
return .urlQueryParameterAllowed.union(allowedReservedCharacters)
}
return .urlQueryParameterAllowed
}()

let percentEncodedName = name.percentEncoded(withAllowedCharacters: allowedCharacters)
let percentEncodedValue = value.percentEncoded(withAllowedCharacters: allowedCharacters)

self.init(name: percentEncodedName, value: percentEncodedValue)
}

}

extension StringProtocol {

fileprivate func percentEncoded(withAllowedCharacters allowedCharacters: CharacterSet) -> String {
if let percentEncoded = self.addingPercentEncoding(withAllowedCharacters: allowedCharacters) {
return percentEncoded
}
assertionFailure("Unexpected failure")
return components(separatedBy: allowedCharacters.inverted).joined()
}

var utf8data: Data {
data(using: .utf8)!
}
}

public extension CharacterSet {

/**
* As per [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986#section-2.2).
*
* This set contains all reserved characters that are otherwise
* included in `CharacterSet.urlQueryAllowed` but still need to be percent-escaped.
*/
static let urlQueryReserved = CharacterSet(charactersIn: ":/?#[]@!$&'()*+,;=")

static let urlQueryParameterAllowed = CharacterSet.urlQueryAllowed.subtracting(Self.urlQueryReserved)
static let urlQueryStringAllowed = CharacterSet(charactersIn: "%+?").union(.urlQueryParameterAllowed)

}
10 changes: 8 additions & 2 deletions IntegrationTests/Tab/ErrorPageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,12 @@ class ErrorPageTests: XCTestCase {
eServerQueried.fulfill()
return .failure(NSError.connectionLost)
}]
let eNavigationFailed2 = tab.$error.compactMap { $0 }.timeout(5).first().promise()

/// Set content before subscribing to `tab.$error.compactMap { $0 }` to allow
/// for error to be nullified first by the call to `setContent`.
tab.setContent(.url(.test, source: .userEntered(URL.test.absoluteString)))
let eNavigationFailed2 = tab.$error.compactMap { $0 }.timeout(5).first().promise()

_=try await eNavigationFailed2.value
await fulfillment(of: [eServerQueried])

Expand Down Expand Up @@ -698,9 +701,12 @@ class ErrorPageTests: XCTestCase {
eServerQueried.fulfill()
return .failure(NSError.connectionLost)
}]
let eNavigationFailed2 = tab.$error.compactMap { $0 }.timeout(5).first().promise()

/// Set content before subscribing to `tab.$error.compactMap { $0 }` to allow
/// for error to be nullified first by the call to `setContent`.
tab.setContent(.url(.alternative, source: .userEntered(URL.alternative.absoluteString)))
let eNavigationFailed2 = tab.$error.compactMap { $0 }.timeout(5).first().promise()

_=try await eNavigationFailed2.value
await fulfillment(of: [eServerQueried])

Expand Down
Loading
Loading