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