Skip to content

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

Draft
hatton wants to merge 2 commits into
masterfrom
automate-notion-test
Draft

Automate "Copy Page Preserves Everything" (Test Case ID 348)#8274
hatton wants to merge 2 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

Adds Playwright automation for copying a content-rich page within one book and into another book.

  • Adds helpers for driving the page-thumbnail context menu and reading saved book HTML.
  • Verifies copied styles, image assets, recording and video presence, and custom layout.
  • Documents current automation limitations around page-loading state, menu selectors, and cross-process copying.

Important Files Changed

Filename Overview
src/BloomE2E/helpers/bookHtml.ts Adds focused parsing and polling helpers for inspecting saved page content and referenced assets.
src/BloomE2E/helpers/pageThumbnails.ts Adds thumbnail-menu automation, but its DOM readiness signal does not guarantee that the C# editing state can accept Copy Page.
src/BloomE2E/tests/copy-page.spec.ts Adds broad copy-preservation coverage, though audio and video identity are not compared with the original page.
src/BloomE2E/AUTOMATION-DEBT.md Documents menu-selector, page-loading, and cross-instance automation limitations.

Reviews (1): Last reviewed commit: "Automate "Copy Page Preserves Everything..." | Re-trigger Greptile

Comment on lines +127 to +141
await expect
.poll(
() =>
page.evaluate(() => {
const frame = document.querySelector(
"#page",
) as HTMLIFrameElement | null;
return frame?.contentDocument?.readyState ?? "none";
}),
{
timeout: timeoutMs,
message: `The Edit tab never finished loading 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 Editing state remains unready

When the iframe reaches readyState === "complete" before C# processes pageDomLoaded, this helper returns while EditingModel is still Navigating. The menu reports Copy Page enabled anyway, but SaveThen silently rejects it, leaving the clipboard empty and causing the test to fail during the subsequent paste.

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>
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