Skip to content

Speed up UI tests#218

Merged
pascalpp merged 5 commits into
mainfrom
pascal/speed-up-ui-tests
Jun 14, 2026
Merged

Speed up UI tests#218
pascalpp merged 5 commits into
mainfrom
pascal/speed-up-ui-tests

Conversation

@pascalpp

Copy link
Copy Markdown
Owner

Summary

  • Replace repeated Preferences-window state reads in UI tests with UI-test-only state files.
  • Move UI-test support out of AppDelegate into UITestSupport and an app-only extension.
  • Remove redundant cursor interaction cycles while preserving cursor state coverage.

Why

The UI suite was spending time on repeated Preferences interactions and duplicated cursor action sequences. The new support helper lets tests observe app state through deterministic files, which keeps the suite faster and keeps test-only plumbing out of AppDelegate.

Validation

  • xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" test -only-testing:FreeRulerUITests/FreeRulerUITests/testFloatShadowAndUnitKeyboardCommands
  • xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" test -only-testing:FreeRulerTests
  • xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" test -only-testing:FreeRulerUITests
  • xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler GitHub" build

@pascalpp pascalpp changed the title [codex] Speed up UI tests Speed up UI tests Jun 14, 2026
@pascalpp pascalpp marked this pull request as ready for review June 14, 2026 18:02

pascalpp commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

Local UI test timing, measured with xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" test -only-testing:FreeRulerUITests.

Before is the branch base, 22de890; after is current PR head, 5fb1f79. Durations below are Xcode test execution durations, excluding build/package resolution time. The latest after run includes the cursor press-duration change from 0.4s to 0.2s.

Scope Before After Delta
Full FreeRulerUITests target 15 tests / 148.1s 13 tests / 105.7s -42.4s (-29%)
Cursor coverage 3 tests / 56.6s 1 test / 23.8s -32.7s (-58%)
Cursor app launches 3 1 -2 launches
Cursor press duration 0.4s 0.2s -0.2s per press
testFloatShadowAndUnitKeyboardCommands 9.8s 5.1s -4.7s
testGroupedRulerToggleUngroupsAndHidesRequestedRuler 9.0s 6.7s -2.4s
testGroupRulersKeyboardCommandUngroupsOnFirstAttempt 7.8s 5.4s -2.4s

Cursor before total is the sum of the old grouped/horizontal/vertical cursor tests: 26.2s + 14.1s + 16.2s. The new combined cursor test keeps those cases as XCTContext activities inside one app launch.

@pascalpp pascalpp merged commit a8a45a0 into main Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant