oficina / sheets Public

Clone
git clone https://amadan.net/oficina/sheets

Plain git — no account needed to clone.

Download

Download this file

1# Isolated native review
2
3The review targets are separate from the production applications. They accept
4only a loopback fixture, use real magic-link sign-in followed by the shared
5native approval/exchange, and never access a production account. The Go test
6creates and removes its own database. Mac credentials travel over stdin;
7simulator credentials use a mode-0600 `Documents/review.json` that the fixture
8removes after success or failure.
9
10From the repository root, build the simulator review app and UI test runner:
11
12```sh
13xcodegen generate --spec native/ios/project.yml
14xcodebuild -project native/ios/SheetsPhone.xcodeproj \
15 -scheme SheetsReviewPhone -sdk iphonesimulator \
16 -destination 'generic/platform=iOS Simulator' \
17 -derivedDataPath native/build/review-ios CODE_SIGNING_ALLOWED=NO build-for-testing
18```
19
20Set `NATIVE_REVIEW_SIMULATOR` to a booted iPhone or iPad simulator UUID, then run:
21
22```sh
23xcrun simctl install "$NATIVE_REVIEW_SIMULATOR" \
24 native/build/review-ios/Build/Products/Debug-iphonesimulator/SheetsReviewPhone.app
25NATIVE_REVIEW_UI_TESTS=1 NATIVE_REVIEW_OUTPUT=/tmp/sheets-native-review.png \
26 go test ./internal/sheets -run '^TestNativeReview$' -count=1 -timeout 8m
27```
28
29The UI cases create a sheet, enter `=2+3`, check `5`, select the cell to read its
30formula, change it to `=7*6`, and check `42`. They then exercise fill down,
31range copy/paste, number formatting, own input undo and version-history restore.
32A separate case injects one HTTP 503 for the exact synthetic formula `=6*7`,
33checks that its draft remains visible and protected, and retries it. Export
34opens the real system destination picker and cancels; the fixture verifies
35the export request reached the server and no staged XLSX remains afterward.
36It does not test saving a file to an external destination.
37A fresh authenticated server read verifies the resulting raw formulas and
38computed values. To isolate a case, set `NATIVE_REVIEW_UI_ONLY` to
39`NativeUITests/testCreateAndEditFormula`,
40`NativeUITests/testFailedCellEditCanBeRetriedWithoutLosingDraft`, or
41`NativeUITests/testExportWorkbookOpensNativeDestinationAndCancels`.
42The fixture exports the test's screenshot attachment to `NATIVE_REVIEW_OUTPUT`.
43Its xcodebuild log is stored under the operating system temporary directory
44as `sheets-native-ui-<simulator UUID>.log`.
45
46For a Mac window capture:
47
48```sh
49swift build --package-path native/apple --product SheetsReview
50NATIVE_REVIEW_BINARY="$PWD/native/apple/.build/debug/SheetsReview" \
51 NATIVE_REVIEW_OUTPUT=/tmp/sheets-native-mac.png \
52 go test ./internal/sheets -run '^TestNativeReview$' -count=1 -timeout 90s
53```
54
55Mac window capture requires existing macOS screen-recording access. The helper
56checks access and does not request it automatically. On 2026-09-13, the review
57executable compiled and authenticated, but this environment lacked capture
58access; no Mac screenshot was accepted as verification.
59
60On 2026-09-13 the initial formula UI flow and server persistence check passed on iPhone 17 Pro
61and iPad Pro 13-inch (M5), iOS 26.5. The same test first exposed compact-screen
62navigation and cell-selection failures before their fixes. This exercises the
63named flow, not every feature in the parity inventory.
64The expanded three-case iPad UI suite passed after exposing a blank history
65panel and an export filename crash. Its combined Xcode result finalization
66then timed out; separate fixture runs distinguish UI assertions from complete
67server-persistence and cleanup verification. The isolated export case passed
68including its server and temporary-file checks.
69The isolated expanded editing case subsequently passed in 192.565 seconds,
70including its fresh 2×2 formula/format/history checks; the isolated refused-write
71retry passed in 45.066 seconds, including verification that `=6*7` persisted.
72The final export stores the workbook under its title inside a private unique
73directory. Its isolated test passed in 58.071 seconds after a simulator restart,
74including removal of that directory after cancellation. The screenshot was
75visually checked: the system picker displays “Native review workbook”.
76