Skip to content

Automate the Talking Book Languages publish list (Notion test cases 170, 488) - #8310

Merged
andrew-polk merged 1 commit into
masterfrom
test-case-170
Sep 5, 2026
Merged

Automate the Talking Book Languages publish list (Notion test cases 170, 488)#8310
andrew-polk merged 1 commit into
masterfrom
test-case-170

Conversation

@andrew-polk

@andrew-polk andrew-polk commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Problem

Two of Bloom's manual test cases had no automated coverage, and one of them could not have had any. The Talking Book Languages check box list on the Publish tab — which decides whose recorded narration goes into a published book, and whether the book counts as a Talking Book at all — was checked only by hand (Notion Test Case ID 170). And Import Recording, the Talking Book tool's way of bringing in audio recorded elsewhere, was unreachable from a test at all, because it ends in a native Windows file dialog that Playwright cannot dismiss: a test that clicked it hung the whole run (Test Case ID 488).

Fix

  • src/BloomE2E/tests/publish-talking-book-languages.spec.ts automates Test Case ID 170 in full: which languages get a row and which are ticked, both tooltips, a language becoming available the moment the book has narration in it, the Features: Talking Book check mark following whether any narration is going in, the choice surviving both publish screens and a restart, and — the step that proves the setting does anything — a staged BloomPUB carrying only the ticked languages' mp3s.
  • e2e/nextChosenFile lets a test say what the next native file chooser should return instead of opening. That is what makes Import Recording drivable, and it opens up every other UI path that ends in a file chooser.
  • src/BloomE2E/tests/import-recording.spec.ts uses it to cover Test Case ID 488 (Import Recording is refused while recording by sentence) and, as journey coverage, a successful import landing its mp3 under the id of the text it belongs to.
  • A stale-subscription bug in FeatureStatusApi turned up on the way and is fixed. It cached the collection's Subscription object at construction, so anything that later replaced that object left features/status reporting the tier Bloom started with — and that is the api the Talking Book tool asks whether Import Recording is allowed. No user hits this today: changing a subscription code in Collection Settings calls ChangeThatRequiresRestart(), so Bloom restarts and the api is rebuilt anyway. The only thing that replaces a subscription without a restart is the e2e/setBranding test hook, which is how it surfaced. So this is production code changed for a test's benefit — strictly more correct, and it removes a trap for whoever one day lets the subscription change without a restart, but worth a reviewer's eye.
  • Narration itself still cannot be automated — it needs a microphone. So helpers/talkingBook.ts has addNarration, which places an mp3 at the path a recording would have written. What keeps that honest is that Bloom's own tool decides the sentence ids the file is named after; the helper only supplies the audio.
  • helpers/publish.ts now takes which of the Publish tab's two language lists a caller means, since both are one component told apart by a test id. publish-text-languages.spec.ts (Test Case ID 169) moves to that API with no change in what it asserts.

Notes for the reviewer

Two steps of Notion card 170 described behavior Bloom does not have, and the tests follow Bloom rather than the card: every language of the text gets a row in Talking Book Languages (not only the ones with audio — the rest are listed, unticked and disabled), and the enabled tooltip ends in a period. The card has been rewritten accordingly.

Base branch is master, not Version6.5: src/BloomE2E exists only on master, which is the exception AGENTS.md allows for e2e work.

There is no YouTrack card for this work, as is normal for test-automation branches; it is tracked on the Notion "Test Case Runs" board as Test Case IDs 170 and 488.

Devin review


This change is Reviewable

@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5 (1M context)] Consulted Devin on 2026-09-04 20:52 UTC up to commit 35fff26d92aadda368cc2464f2994d04ef355851.

Two rounds: the first on 5eca2ab0 (the whole diff) and, after the flake fix, an incremental one on 35fff26d (4 files, 39 lines). Both came back with no Bugs, no Investigate flags, and no Informational items, so there is nothing to mirror here.

CI (pr-automation) is green. CodeRabbit is switched off for this repo in .coderabbit.yml (auto_review.enabled: false), so it was not expected to comment.

Comment thread src/BloomE2E/AUTOMATION-DEBT.md Outdated
…70, 488)

The Talking Book Languages check box list on the Publish tab decides whose
recorded narration goes into a published book, and whether the book counts as a
Talking Book at all. It was checked only by hand. Import Recording -- the
Talking Book tool's way of bringing in audio recorded elsewhere -- could not be
tested at all: it ends in a native Windows file dialog that Playwright cannot
dismiss, so a test that clicked it hung the run.

src/BloomE2E/tests/publish-talking-book-languages.spec.ts automates Test Case
170 in full. Seven tests carry the id and an eighth builds the book they share:
which languages get a row and which are ticked, both tooltips, a language
becoming available as soon as the book has narration in it, the Features:
Talking Book check mark following whether any narration is going in, the choice
surviving both publish screens and a restart, and a staged BloomPUB carrying
only the ticked languages' audio.

Two of that card's steps described behavior Bloom does not have, and the tests
follow Bloom: every language of the TEXT gets a row, not only the ones with
audio (the rest are listed, unticked and disabled), and the enabled tooltip ends
in a period. The card has been rewritten to match.

src/BloomE2E/tests/import-recording.spec.ts covers Test Case 488 (Import
Recording is refused while recording by sentence) and, as journey coverage, a
successful import landing its mp3 under the id of the text it belongs to.

Narration cannot be recorded in a test -- that needs a microphone -- so
helpers/talkingBook.ts has addNarration, which copies an mp3 to the file a
recording would have written. What keeps it faithful is that Bloom's own tool
decides the sentence ids the file is named after, by marking them when the
toolbox opens; the helper only supplies the audio.

helpers/publish.ts now takes which of the Publish tab's two language lists it
means, since both are the same component told apart by a test id.
publish-text-languages.spec.ts moves to that API asserting exactly what it did
before.

Bloom changes these tests needed:

- E2eTestingApi gains e2e/nextChosenFile: the path the next native file chooser
  should return instead of opening. FileIOApi.SelectFileUsingDialog takes the
  armed answer through a new DeliverChosenFile that both routes share, so
  destFolder behaves alike. It deliberately does not record the path in
  FilePathMemory, which is machine-wide settings shared with the developer's own
  Bloom.
- FeatureStatusApi read the collection's Subscription once, at construction, so
  anything that later replaced that object left it answering with the tier Bloom
  started with. No user hits this -- changing a subscription code in Settings
  forces a restart -- but it made e2e/setBranding only half work, and
  features/status is what the Talking Book tool reads to decide whether to offer
  Import Recording. It now reads through to CollectionSettings on each use.
- PublishFeaturesGroup renders data-testid="feature-talking-book" with a
  data-feature-on attribute. The check mark is always in the DOM and merely
  CSS-hidden when off, so nothing said whether the feature was on.

AUTOMATION-DEBT.md records what is still not automatable: the folder chooser,
video capture and the Image Toolbox; the microphone; a sibling api holding the
same kind of stale subscription; and a Playwright worker that dies at startup
about one run in fifteen, with a reproducibility test so a genuinely bad import
is not waved away as environmental.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@andrew-polk
andrew-polk marked this pull request as ready for review September 5, 2026 04:09
@andrew-polk
andrew-polk merged commit 5d41c83 into master Sep 5, 2026
1 check passed
@andrew-polk
andrew-polk deleted the test-case-170 branch September 5, 2026 04:15
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