From bf47179054020140157357893357972ac8d72a7e Mon Sep 17 00:00:00 2001 From: Joel Arvidsson Date: Tue, 24 Sep 2024 22:48:59 +0200 Subject: [PATCH] Adapt UI tests to iOS 18 --- .github/workflows/tests.yml | 3 +++ HushUITests/HushUITests.swift | 12 ++++++++---- Makefile | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5523a60..9f4c4d3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,6 +26,9 @@ jobs: - uses: denolib/setup-deno@v2 with: deno-version: v1.x + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: "16.0" - run: | make test_ui diff --git a/HushUITests/HushUITests.swift b/HushUITests/HushUITests.swift index 96c9034..f87d626 100644 --- a/HushUITests/HushUITests.swift +++ b/HushUITests/HushUITests.swift @@ -17,10 +17,14 @@ class HushUITests: XCTestCase { private func toggleContentBlockerEnabled(isOn: Bool) throws { settingsApp.launch() - settingsApp.tables.cells.staticTexts["Safari"].tap() - settingsApp.tables.cells.staticTexts["Extensions"].firstMatch.tap() - if settingsApp.switches["Hush"].value as? String != (isOn ? "1" : "0") { - settingsApp.switches["Hush"].tap() + settingsApp.swipeUp() + settingsApp.staticTexts["Apps"].tap() + settingsApp.swipeUp() + settingsApp.staticTexts["Safari"].tap() + settingsApp.staticTexts["Extensions"].tap() + settingsApp.staticTexts["Hush"].tap() + if settingsApp.switches["Allow Extension"].value as? String != (isOn ? "1" : "0") { + settingsApp.switches["Allow Extension"].tap() } settingsApp.terminate() } diff --git a/Makefile b/Makefile index 09942ac..b404ff3 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ test_unit: deno test test_ui: - xcodebuild test -project Hush.xcodeproj -scheme 'Hush iOS' -destination 'platform=iOS Simulator,name=iPhone 8' + xcodebuild test -project Hush.xcodeproj -scheme 'Hush iOS' -destination 'platform=iOS Simulator,name=iPhone 16' fetch_external: deno run --allow-write=./data --allow-net scripts/fetch-external.js