Skip to content

test(e2e): cover daily re-view completion close N12/N13 (#935) - #942

Merged
wei18 merged 2 commits into
mainfrom
test/e2e-negative-nav-935-b3
Jul 23, 2026
Merged

wei18 merged 2 commits into
mainfrom
test/e2e-negative-nav-935-b3

Conversation

@wei18

@wei18 wei18 commented Jul 22, 2026 •

Copy link
Copy Markdown
Owner

Part of #935 (batch 3 — N12/N13; the issue stays open for the remaining N-row batches).

Summary

  • Host-driven XCUITest E2E coverage for N12 (Sudoku) / N13 (MS): Close on the
    daily re-view SUD-COMPLETION-REVIEW / MS-COMPLETION-REVIEW route pops
    exactly one path entry back to the Daily hub.
  • Completed-daily state lives in CloudKit Private DB and can't be produced by
    real play on the CI simulator (signed-out CK degrades to "no cards"; the
    near-win boards use no-op persistence). A new DEBUG-only
    -uitest-seed-completed-daily launch arg seeds today's daily trio as
    already completed:
    • Sudoku: UITestSeededCompletedDailyPersistence wraps the live
      PersistenceProtocol, since DailyHubViewModel.openCompleted does an
      async loadIfExists round trip before pushing .completion.
    • Minesweeper: MinesweeperDailyHubViewModel.cardTapped pushes
      .completion synchronously off card.isCompleted alone — no snapshot
      fetch. MinesweeperSavedGameStore had no protocol seam, so this extracts
      MinesweeperDailyOverlayReading, narrowed to exactly the two methods the
      VM's phase-2 overlay actually calls (fetchFailedDailyIds(for:) /
      fetchCompletedDailyIdsByDay() — verified by reading the VM's real call
      sites, not assumed). LiveRouteFactory threads the DEBUG fake as a
      separate dailyOverlayReading param alongside the existing concrete
      savedGameStore, so board save/resume/replay and
      MinesweeperDailyOpenGuardView keep using the concrete store unchanged.
  • New stable a11y ids: sudoku.dailyHub.root / minesweeper.dailyHub.root
    (a zero-size .background marker sibling to the week-strip header — not an
    ancestor of its day-dot elements, avoiding the test(e2e): cover sudoku hub failure flows N3-N5 (#935) #937 "container id clobbers
    descendant ids" cascade) and sudoku.dailyHub.card.completed /
    minesweeper.dailyHub.card.completed (on the card's own
    accessibilityElement, alongside its existing combined label).
  • docs/navigation-flows.md's N12/N13 code anchors were stale (:226/:282
    — pre-fix(minesweeper): completion re-view Close should pop one level to mirror sudoku #697 line numbers); corrected to :260/:326 and cross-referenced to
    the new tests. docs/screen-contracts.md documents the new ids + E2E
    coverage note.
  • Rebased onto f1aee21 after perf(daily): parallelize best-time fetches and enable difficulty cards before phase-2 lands #943 (parallelized daily best-time fetches)
    and fix(sudoku): sticky digit-first — armed digit survives taps on non-empty cells #944 landed concurrently; conflicts in the two DailyHubView files were
    resolved preserving both perf(daily): parallelize best-time fetches and enable difficulty cards before phase-2 lands #943's changes and the new a11y markers, and both
    E2E suites re-ran green post-rebase.

Test plan

  • swift test --package-path Packages/GameAppKit — 50/50 passed
  • swift test --package-path Packages/MinesweeperKit — 370/370 passed
    (protocol conformance change → full suite per repo rule)
  • swift test --package-path Packages/SudokuKit — hit the known local
    full-suite segfault flake (unrelated to this diff, see
    reference/sudokukit-full-suite-segfault-local.md); filtered
    --filter "DailyHub|SudokuAppComposition|RouteFactory" → 101/101 passed
  • mise run test:ui sudoku → 13/13 including test_completionReviewCloseLandsOnDailyHub_N12 (re-run green post-rebase)
  • mise run test:ui minesweeper → 9/9 including test_completionReviewCloseLandsOnDailyHub_N13 (re-run green post-rebase)
  • mise run lint:swift_strict <changed files> → 0 violations
  • Negative proof (both apps): temporarily forced the DEBUG resolver to
    skip the fake (seed off) → both new tests FAIL (no completed card to
    tap) → restored → both pass again

🤖 Generated with Claude Code

wei18 added a commit that referenced this pull request Jul 22, 2026
…nt (#935)

CR round 1 on PR #942: MinesweeperAppComposition/LiveRouteFactory.swift:311
is the #697 comment block; the actual
`onClose: { closePath?.wrappedValue.removeLast() }` sits at :326, matching
the Sudoku N12 convention of anchoring the code line.

Co-Authored-By: Claude <[email protected]>
wei18 and others added 2 commits July 23, 2026 11:04
Adds host-driven XCUITest E2E coverage for N12 (Sudoku) / N13 (MS): Close
on the daily re-view Completion route (SUD-COMPLETION-REVIEW /
MS-COMPLETION-REVIEW, pushed from a completed daily card) pops exactly
one path entry back to the Daily hub.

Completed-daily state lives in CloudKit Private DB and cannot be
produced by real play on the CI simulator (signed-out CK degrades to
"no cards"; the near-win boards use no-op persistence and write
nothing), so a new DEBUG-only -uitest-seed-completed-daily launch arg
(GameAppKit.UITestLaunchArg) seeds today's daily trio as already
completed:

- Sudoku: UITestSeededCompletedDailyPersistence (SudokuAppComposition)
  wraps the live PersistenceProtocol, reporting today's three daily
  puzzleIds as completed (fetchCompletedDailyIds/ByDay) with a frozen
  loadIfExists snapshot built from the real Puzzle the puzzleProvider
  reverse-derives for that id.
- Minesweeper: MinesweeperDailyHubViewModel's completed-card tap is
  fully synchronous (no snapshot fetch), so only the completed-ids read
  needs faking. MinesweeperSavedGameStore had no protocol seam, so
  this extracts MinesweeperDailyOverlayReading (MinesweeperPersistence)
  covering exactly the two methods the VM's phase-2 overlay calls
  (fetchFailedDailyIds/fetchCompletedDailyIdsByDay) — verified by
  reading the VM's actual call sites, not by widening every consumer.
  UITestSeededCompletedDailyOverlayReading (MinesweeperAppComposition)
  is the DEBUG fake; LiveRouteFactory threads it as a separate
  dailyOverlayReading param alongside the existing concrete
  savedGameStore (which other consumers — board save/resume/replay,
  MinesweeperDailyOpenGuardView — keep using unchanged).

New stable a11y ids anchor both tests: sudoku.dailyHub.root /
minesweeper.dailyHub.root (a zero-size .background marker sibling to
the week-strip header, not an ancestor of its day-dot elements — avoids
the #937 "container id clobbers descendant ids" cascade) and
sudoku.dailyHub.card.completed / minesweeper.dailyHub.card.completed
(applied on the card's own accessibilityElement alongside its existing
combined label).

docs/navigation-flows.md's N12/N13 anchors were stale (:226/:282); fixed
to :260/:311 and cross-referenced to the new E2E tests.
docs/screen-contracts.md documents the new ids and the E2E coverage.

Both new tests were verified to fail (no completed card to tap) with
the seed temporarily forced off, then pass again once restored.

Part of #935.

Co-Authored-By: Claude <[email protected]>
…nt (#935)

CR round 1 on PR #942: MinesweeperAppComposition/LiveRouteFactory.swift:311
is the #697 comment block; the actual
`onClose: { closePath?.wrappedValue.removeLast() }` sits at :326, matching
the Sudoku N12 convention of anchoring the code line.

Co-Authored-By: Claude <[email protected]>
@wei18
wei18 force-pushed the test/e2e-negative-nav-935-b3 branch from 62d56be to a4a55a5 Compare July 23, 2026 04:21
@wei18
wei18 enabled auto-merge (squash) July 23, 2026 04:21
@wei18
wei18 merged commit 9ff859d into main Jul 23, 2026
10 checks passed
@wei18
wei18 deleted the test/e2e-negative-nav-935-b3 branch July 23, 2026 04:21
wei18 added a commit that referenced this pull request Jul 27, 2026
…951) (#952)

Pulls wei18/apple-dev-skills#41 into the submodule pointer: the
swiftui-interaction-footguns skill now documents that a container's
accessibilityIdentifier can clobber its descendants' own ids in the XCUITest
AX tree, with the leaf / sibling-marker fixes and the ScrollView
counter-example. Both sightings came out of this repo's #935 E2E batches
(#937 exhausted-block buttons, #942 daily-hub root anchors).

Closes #951

Co-authored-by: Claude <[email protected]>
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