Skip to content

Automate "Copy Page Preserves Everything" (Test Case ID 348) - #8274

Merged
hatton merged 10 commits into
masterfrom
automate-notion-test
Sep 2, 2026
Merged

Automate "Copy Page Preserves Everything" (Test Case ID 348)#8274
hatton merged 10 commits into
masterfrom
automate-notion-test

Conversation

@hatton

@hatton hatton commented Sep 1, 2026

Copy link
Copy Markdown
Member

Problem

The manual test Copy Page Preserves Everything (Notion Test Case ID 348, the one case in the 6.5 run marked Planned for automation) is run by hand every release. Nothing checks automatically that copying a page keeps its style, image, recording, video, and layout.

What this PR does

Adds src/BloomE2E/tests/copy-page.spec.ts. It copies a page through the real page menu and pastes it, first back into its own book and then into a second book in the same Bloom. For each paste it checks the user-defined style class and its rule, the image file, the Talking Book recording file, the video file, and the custom origami layout. The original page is checked first, so the test cannot pass on an empty page.

New helpers: helpers/pageThumbnails.ts (drives the page thumbnail menu) and helpers/bookHtml.ts (reads a saved book from disk and reports each page's ingredients).

Test inputs

The page comes prebuilt from the new page-copy collection in bloom-testing-inputs, because adding an image, a recording, or a video through the UI needs a native dialog or a microphone.

Not covered

Copy between two Bloom instances (the manual case's last step). The page clipboard is a field on the one EditingModel, so nothing crosses a process boundary, and the feature is known not to work in 6.5. The Notion card will be set to Partial when this merges.

Debt recorded in AUTOMATION-DEBT.md

  • Copy Page and Paste Page silently do nothing while a page is loading, though the menu shows them enabled. A quick Copy Page then Paste Page loses the paste with no message. This is a product gap worth a card.
  • The page menu items have no data-testid, so the helper matches English labels (a seen again on the existing top-bar entry).
  • Cross-instance copy cannot be tested.

Verification

pnpm -C src/BloomE2E test tests/copy-page.spec.ts with BLOOM_TESTING_INPUTS_DIR=D:/bloom-testing-inputs: passed four times in a row on current master with the override variable, and once more against the pinned inputs, about 20 s each. pnpm typecheck in src/BloomE2E passes. No Bloom.exe survives the run.

🤖 Generated with Claude Code

Devin review


This change is Reviewable

An e2e test that copies a page through the real page menu and pastes it, first
back into its own book and then into a second book in the same Bloom. For each
paste it checks the five things the manual case names: the user-defined style
class and its rule, the image file, the Talking Book recording file, the video
file, and the custom origami layout. The original page is checked first, so the
test cannot pass on an empty page.

The page under test comes prebuilt from the new page-copy collection in
bloom-testing-inputs, because adding an image, a recording, or a video through
the UI needs a native dialog or a microphone. Until that collection merges and the
pin advances, run with BLOOM_TESTING_INPUTS_DIR pointed at a checkout of it.

Two new helpers: pageThumbnails.ts drives the page thumbnail menu, and
bookHtml.ts reads a saved book from disk and reports each page's ingredients.

Copying between two Bloom instances, the manual case's last step, is not covered:
the page clipboard is a field on the one EditingModel, so nothing crosses a
process boundary. AUTOMATION-DEBT.md records that, the missing test ids on the
page menu items, and a product gap the test exposed: Copy Page and Paste Page
silently do nothing while a page is loading, though the menu shows them enabled.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds an end-to-end test for preserving page content when copying within and between books, plus helpers for page-menu interaction and saved-book inspection.

  • Adds fixture-backed checks for custom styles, media files, and origami layout.
  • Adds thumbnail-menu and book-HTML test helpers.
  • Updates pinned testing inputs and automation guidance.

Important Files Changed

Filename Overview
src/BloomE2E/helpers/pageThumbnails.ts Adds page-menu and editing-readiness helpers, but the post-copy reload wait still permits Paste Page while Bloom remains Navigating.
src/BloomE2E/tests/copy-page.spec.ts Adds broad copy-preservation coverage, though its immediate paste depends on the incomplete reload-readiness helper.
src/BloomE2E/helpers/bookHtml.ts Adds focused parsing and polling helpers for validating persisted book contents.
build/testing-inputs.pin Advances the pinned testing-input revision used by the new fixture-backed test.

Reviews (2): Last reviewed commit: "Say the copy-page card splits, not that ..." | Re-trigger Greptile

Comment thread src/BloomE2E/helpers/pageThumbnails.ts
hatton and others added 6 commits September 1, 2026 16:24
The copy-page e2e test (Test Case ID 348) reads its books from the page-copy
collection, which merged into bloom-testing-inputs as aa2e7c2. With the pin at
that commit the test runs from output/testing-inputs with no override variable.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A controller agent claims Notion test cases whose Automation property is
Planned (setting Building at once, so parallel developers do not collide),
starts one Orca worktree and one supervised Claude worker per card, reviews
each worker's e2e test, and lets the worker run preflight and open a draft PR
that links the Notion card. Cards end as "PR Pending" with the PR URL, or as
"Has automation problems" with a note for the card's author when the case is
not automatable as written. An unattended mode lets the run continue through
the Planned cards with nobody answering questions.

Beside the skill: notion_automation.py (list, show, claim, set, note, brief;
retries on HTTP 429), e2e-lock.mjs (a machine-wide lock so worktrees take
turns running Bloom e2e tests), and the worker brief template. A stub under
.claude/skills makes the skill a slash command.

add-e2e-test gains the two new Automation states, PR Pending and Has
automation problems.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…states

The previous commit rebuilt this file from an older base and dropped the
"every step is a helper call" revision. This puts that revision back and keeps
only the two additions: the PR Pending and Has automation problems states.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rt of it

A card marked Automated while some of its steps are still human-run hides those
steps: nobody reads Automation Notes when planning a manual run. This happened
with Test Case ID 349, Duplicate Page, whose audio, video, and Duplicate Many
Times steps stayed manual behind a note.

The add-e2e-test skill now says to split such a card when it goes to PR Pending:
the original becomes the [Automated portion] and keeps its id, the uncovered
steps move to a new [Manual portion] row with a new id, and the two rows point
at each other through the new Related Cases relation property. Partial is
retired. The improve-test-automation-coverage skill and the BloomE2E README
follow the same rule.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The `Partial` Automation state is retired: a test that covers only part of a
card's steps splits the card instead. This step-3 instruction still told the
worker to remember which part for a `Partial` note, which no longer exists.

It now says what to do instead. A step the worker cannot implement is a
problem, not something to record and move past. If a substantial portion is
automatable and the steps split cleanly, split the Notion card into a manual
and an automated portion. If they do not, stop and set the card's Automation
property to "Has automation problems".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment thread src/BloomE2E/helpers/pageThumbnails.ts
Comment thread .github/skills/improve-test-automation-coverage/worker-brief.md
Comment thread src/BloomE2E/tests/copy-page.spec.ts
@hatton

hatton commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

[Claude Opus 5 from Hatton's machine during devin-review]

Consulted Devin on 2026-09-02, up to commit 94ab0db0d63a690149b5946a21bd3f3201b8865c (the merge of master into this branch, plus the worker-brief fix).

It found no bugs, three Investigate flags, and no informational items.

Greptile ran earlier, on 2026-09-01, against 4132a8d.

hatton and others added 3 commits September 2, 2026 15:01
…g a page

`waitForEditablePage` in pageThumbnails.ts decided the Edit tab was ready when the
page iframe's document reached `readyState === "complete"`. The document can get
there a moment before Bloom does, and in that window Bloom's editing model is still
Navigating, where it silently ignores any command that begins by saving the page.
Copy Page is one of those, so a test could click it, get no error, and find an empty
clipboard.

It now also polls `e2e/isEditingPage`, the hook master added for exactly this, the
way the `bookMaking.ts` wait of the same name does.

Also fix step 6 of the improve-test-automation-coverage worker brief. It still told
the worker to record the uncovered steps in `Automation Notes` and stop, which is the
retired `Partial` workflow. It now says to split the card into an automated and a
manual portion first, as `add-e2e-test` requires, and to keep the note as the record.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The debt entry for cross-instance page copy still named the retired `Partial`
status. The rule now is that a card whose test covers only part of its steps is
split, so this says the cross-instance step belongs on a manual portion row.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hatton
hatton marked this pull request as ready for review September 2, 2026 21:21
@hatton
hatton merged commit 2a9ffd5 into master Sep 2, 2026
1 check passed
message: `The Edit tab never reloaded page ${pageId}.`,
},
)
.toBe("complete");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Reload wait misses editing state

When the replacement document reaches readyState === "complete" before C# processes pageDomLoaded, this helper returns and the test immediately invokes Paste Page while the model is still Navigating. OnInsertPage then calls SaveThen, whose wrong-state fallback silently drops the paste, causing waitForPageCount to time out.

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