Automate the Talking Book Languages publish list (Notion test cases 170, 488) - #8310
Merged
Conversation
Contributor
Author
|
[Claude Opus 5 (1M context)] Consulted Devin on 2026-09-04 20:52 UTC up to commit Two rounds: the first on CI ( |
andrew-polk
commented
Sep 4, 2026
…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
force-pushed
the
test-case-170
branch
from
September 5, 2026 04:09
628cf03 to
ab12f93
Compare
andrew-polk
marked this pull request as ready for review
September 5, 2026 04:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsautomates 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/nextChosenFilelets 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.tsuses 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.FeatureStatusApiturned up on the way and is fixed. It cached the collection'sSubscriptionobject at construction, so anything that later replaced that object leftfeatures/statusreporting 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 callsChangeThatRequiresRestart(), so Bloom restarts and the api is rebuilt anyway. The only thing that replaces a subscription without a restart is thee2e/setBrandingtest 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.helpers/talkingBook.tshasaddNarration, 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.tsnow 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, notVersion6.5:src/BloomE2Eexists only on master, which is the exceptionAGENTS.mdallows 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