Skip to content

Commit

Permalink
Adapt UI tests to iOS 18
Browse files Browse the repository at this point in the history
  • Loading branch information
oblador committed Sep 24, 2024
1 parent e56302a commit bf47179
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions HushUITests/HushUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf47179

Please sign in to comment.