Done in https://github.com/badbundle/vault-app/pull/676, merged as a0b23861. make validate now builds and runs the VaultAppUITests plan after the unit tests.
Add a UI test target with launch tests
Description
Part of VAULT-83.
Why
Vault has no UI tests. VaultApp.xcodeproj has only three targets: the app and its two extensions. Snapshot tests render views in isolation, so nothing checks that the real app launches, shows the vault and responds to taps. There's also some leftover scaffolding:
Vault/.swiftpm/.../VaultUITests.xcschemepoints at aVaultUITeststarget that doesn't exist.CI_iOS.xcschemerefers to aCI/ios_alltests.xctestplanand aCryptoDocumentExporterTeststarget that don't exist. It also has a wrong path tomacOS_SupportedTests.xctestplan.
Plan
-
Add a
VaultAppUITestsXCUITest target toVaultApp.xcodeproj. Swift packages can't host UI tests. -
Run it from
make validate. Either:- add it to
iOSAllTests, which meansCI_iOShas to build the app; or - give it its own test plan and its own
ios.buildForTesting/testWithoutBuildingcheck inlocal-check.config.ts.
Choose whichever keeps validate reliable. The UI tests don't need the TSAN configuration.
- add it to
-
Delete the stale
VaultUITests.xcscheme, and fix or remove the broken references inCI_iOS.xcscheme. -
Find elements by accessibility identifier, not by localised text. Add identifiers where they're missing.
-
Add a line to AGENTS.md on how to run only the UI tests.
Tests
Both tests launch with -screenshot-scene feed. That flag gives an in-memory demo vault, with App Lock off, that never touches the simulator's real vault.
- Launch smoke test:
- The app launches to the feed, and the demo codes are visible.
- Open a code's detail and go back.
- Open Settings and go back.
- Background the app (
XCUIDevice.shared.press(.home)), bring it back, and it's still on the feed.
- Encrypted note:
- Open the demo vault's encrypted note, "Recovery codes" (password "hello").
- A wrong password shows the error and keeps the contents hidden.
- The right password shows the contents.
- Close the note and open it again: it's locked again.
Done when
- Both tests pass in
make validate. - The stale schemes are gone.
- The whole UI test target adds well under a minute to validate.
Linked issues
1GitHub
0No branches or pull requests linked.
Comments
2PR: https://github.com/badbundle/vault-app/pull/676. It's validated, and make validate now builds and runs the UI tests too. It's waiting to be merged.
Notes:
- Scheme: the UI tests have their own scheme (
VaultAppUITests) and test plan, rather than being part ofiOSAllTests. That plan runs everything twice, once under the thread sanitizer, and a package scheme can't cleanly point at a target in the app project. They share DerivedData with the unit tests, so only the app and the tests are rebuilt. - Timing: in validation the UI tests step took 47 s. The ticket asked for "well under a minute", so it's close rather than well under.
- Code details: the launch test reaches a code's details through Settings → Tap a Code To → Show Details. Once a code's touch-and-hold menu is open, XCUITest never sees the app go idle, so the test can't use that menu.