Skip to content

BL-16822 Inline images: the end-to-end suite, and two test affordances Bloom needed - #8324

Draft
hatton wants to merge 1 commit into
BL-16822-inline-6-spreadsheetfrom
BL-16822-inline-7-e2e
Draft

BL-16822 Inline images: the end-to-end suite, and two test affordances Bloom needed#8324
hatton wants to merge 1 commit into
BL-16822-inline-6-spreadsheetfrom
BL-16822-inline-7-e2e

Conversation

@hatton

@hatton hatton commented Sep 7, 2026

Copy link
Copy Markdown
Member

39 Playwright tests across 16 spec files, driving a real Bloom. They are the last
commit in this stack because they are the check on everything before it, and because
they are what a person reading the feature should be able to read as its
specification: each file's header says what the test is about, what mechanism made it
worth writing, and what was measured.

Beyond the feature's own behaviour (add, select, dock, resize, undo, delete, the copy
in every language, a save and a reload), the suite puts the feature in the path of
what people do to books: change the page size, choose a different layout, cut the
block in half in Change Layout mode, overflow the text, duplicate the page, add a
language to the collection, paste text containing a picture, press ctrl+z, zoom to
30% and 300%, select-all-delete, and let go of the mouse outside the page. Six
defects found that way are fixed in the commits before this one.

Two things Bloom does differently under --e2e, both so a test cannot leave something
on the developer's screen or in their settings:

  • A spreadsheet export records the path it wrote, served at
    e2e/lastExportedSpreadsheet, instead of handing the .xlsx to whatever opens
    spreadsheets on the machine. Nothing in a test could close that window.
  • It no longer writes the machine-wide export folder setting, which is shared with
    the developer's own Bloom. The book's own UserPrefs still get it; they live in the
    temp collection and die with it.

BloomButton now carries its l10n key as a data-testid. That key is the only stable
name such a button has -- its text is localized and most callers give it neither an id
nor a class -- and localizableMenuItem already does the same. A caller passing its own
data-testid still wins.

AUTOMATION-DEBT.md records the three things the suite cannot drive: the Export
dialog's two buttons and the book menu's More submenu carry no test id, and releasing
the mouse outside the WebView2 window cannot be reached by Playwright at all.

Notion test case 815 tracks what is covered.

Card: https://issues.bloomlibrary.org/youtrack/issue/BL-16822


🤖 Generated with Claude Code

https://claude.ai/code/session_014DCBGajN5YyAYPBenEf1yy

Devin review


This change is Reviewable

Comment thread src/BloomE2E/helpers/inlineImages.ts
Comment thread src/BloomBrowserUI/react_components/bloomButton.tsx
@hatton

hatton commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

[Claude Opus 5 (1M context) from Hatton's machine during devin-review]

Consulted Devin on 2026-09-07 12:46 MDT up to commit 74d2b39c80.

It raised 2 things. Each has its own review thread with the reasoning and the outcome; in short:

  • Multilingual image checks accept partial updates — real: both helpers would have passed on one language changing rather than all of them. Fixed.
  • Empty l10nKey produces empty data-testid on many buttons — real: five callers pass no key, so they all answered to the same empty test id. Fixed.

2 informational observations were also reported and read but not mirrored as threads (low signal).

The fixes were amended into this branch after the review, so the commit above is not the current head; a fresh review is running against the new one. The only GitHub check on this PR is pr-automation (the review trigger), which passed; the front-end unit suite (915 tests), the C# spreadsheet tests (415) and the end-to-end suite (85) were all run locally and are green.

@hatton
hatton force-pushed the BL-16822-inline-6-spreadsheet branch from ac0ac2f to 646e989 Compare September 7, 2026 21:09
@hatton
hatton force-pushed the BL-16822-inline-7-e2e branch from 240b17d to 14cb0e6 Compare September 7, 2026 21:10
Comment thread src/BloomE2E/helpers/spreadsheet.ts
Comment thread src/BloomE2E/tests/inline-images-keyboard-delete.spec.ts
@hatton

hatton commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

[Claude Opus 5 (1M context) from Hatton's machine during devin-review]

Consulted Devin again on 2026-09-07 14:00 MDT, on commit 240b17d2a8 (the head after the first round of fixes).

It raised 2 new things. Each has its own review thread with the reasoning and the outcome; in short:

  • Title-changing imports always time out — real: an import that renames the book folder left the helper polling a path that no longer existed. Fixed by following the book by its id.
  • Fixed sleeps weaken synchronization — right, and against the repo's rule; all three sleeps are now waits on the state under test, and the two specs re-run green and faster.

It also re-reported the findings the reviewed commit already fixes; those are the first round's threads, which carry their outcomes.

These fixes were amended into this branch after the review, so the commit above is not the current head. The only GitHub check on this PR is pr-automation (the review trigger). Run locally and green after these fixes: the front-end unit suite (920 tests), the end-to-end suite (85 passed, 1 skipped), and the C# spreadsheet and translation-group tests (417 and 50).

@hatton
hatton force-pushed the BL-16822-inline-6-spreadsheet branch from 646e989 to f61e11e Compare September 7, 2026 21:55
@hatton
hatton force-pushed the BL-16822-inline-7-e2e branch from 14cb0e6 to e78dec7 Compare September 7, 2026 21:55
Comment thread src/BloomExe/Spreadsheet/SpreadsheetApi.cs
@hatton

hatton commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

[Claude Opus 5 (1M context) from Hatton's machine during devin-review]

Consulted Devin a third time on 2026-09-07 15:55 MDT, on commit 14cb0e69ae (the head after the second round of fixes).

It raised 1 new thing. Each has its own review thread with the reasoning and the outcome; in short:

  • C# additions fail whitespace checks — same as the localization one on PR 8321, and the same answer: nothing enforces that rule, and csharpier (which the pre-commit hook runs) formats with spaces.

It also re-reported the findings the reviewed commit already fixes; those are the earlier rounds' threads, which carry their outcomes.

These fixes were amended into this branch after the review, so the commit above is not the current head. The only GitHub check on this PR is pr-automation (the review trigger). Run locally and green after these fixes: the front-end unit suite (927 tests), the C# spreadsheet and translation-group tests (470), and the end-to-end suite.

@hatton
hatton force-pushed the BL-16822-inline-6-spreadsheet branch from f61e11e to 11a810b Compare September 7, 2026 22:25
@hatton
hatton force-pushed the BL-16822-inline-7-e2e branch from e78dec7 to 46fa92c Compare September 7, 2026 22:25
Comment thread src/BloomE2E/tests/inline-images.spec.ts
Comment thread src/BloomE2E/tests/inline-images-undo-keyboard.spec.ts
@hatton

hatton commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

[Claude Opus 5 (1M context) from Hatton's machine during devin-review]

Consulted Devin a fourth time on 2026-09-07 16:20 MDT, on commit e78dec7b2c (the head after the third round of fixes).

It raised 2 new things. Each has its own review thread with the reasoning and the outcome; in short:

  • Probe diagnostics remain enabled — correct: all twenty [probe] log lines are out of the nine specs, and with them the last fixed sleep (500 ms inside a page.evaluate), now an expect.poll on the text the undo takes back.
  • Timeout overrides need approvaltest.setTimeout(300000) raises the ceiling on a test's total length; it makes nothing wait. Four existing specs in this suite set the same value against the 180-second default, for the same reason.

It also re-reported the findings the reviewed commit already fixes; those are the earlier rounds' threads, which carry their outcomes.

These fixes were amended into this branch after the review, so the commit above is not the current head. The only GitHub check on this PR is pr-automation (the review trigger). Run locally and green after these fixes: the inline-image unit tests (47), the C# spreadsheet tests (422), and the nine end-to-end specs the cleanup touched.

@hatton
hatton force-pushed the BL-16822-inline-6-spreadsheet branch from 11a810b to 2b5c56f Compare September 7, 2026 22:56
@hatton
hatton force-pushed the BL-16822-inline-7-e2e branch from 46fa92c to af2d4a6 Compare September 7, 2026 22:56
…s Bloom needed

39 Playwright tests across 16 spec files, driving a real Bloom. They are the last
commit in this stack because they are the check on everything before it, and because
they are what a person reading the feature should be able to read as its
specification: each file's header says what the test is about, what mechanism made it
worth writing, and what was measured.

Beyond the feature's own behaviour (add, select, dock, resize, undo, delete, the copy
in every language, a save and a reload), the suite puts the feature in the path of
what people do to books: change the page size, choose a different layout, cut the
block in half in Change Layout mode, overflow the text, duplicate the page, add a
language to the collection, paste text containing a picture, press ctrl+z, zoom to
30% and 300%, select-all-delete, and let go of the mouse outside the page. Six
defects found that way are fixed in the commits before this one.

Two things Bloom does differently under --e2e, both so a test cannot leave something
on the developer's screen or in their settings:

- A spreadsheet export records the path it wrote, served at
  e2e/lastExportedSpreadsheet, instead of handing the .xlsx to whatever opens
  spreadsheets on the machine. Nothing in a test could close that window.
- It no longer writes the machine-wide export folder setting, which is shared with
  the developer's own Bloom. The book's own UserPrefs still get it; they live in the
  temp collection and die with it.

BloomButton now carries its l10n key as a data-testid. That key is the only stable
name such a button has -- its text is localized and most callers give it neither an id
nor a class -- and localizableMenuItem already does the same. A caller passing its own
data-testid still wins.

AUTOMATION-DEBT.md records the three things the suite cannot drive: the Export
dialog's two buttons and the book menu's More submenu carry no test id, and releasing
the mouse outside the WebView2 window cannot be reached by Playwright at all.

Notion test case 815 tracks what is covered.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014DCBGajN5YyAYPBenEf1yy
@hatton
hatton force-pushed the BL-16822-inline-6-spreadsheet branch from 2b5c56f to 4c1b738 Compare September 7, 2026 23:30
@hatton
hatton force-pushed the BL-16822-inline-7-e2e branch from af2d4a6 to 60c908d Compare September 7, 2026 23:30
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