Skip to content

Commit ba4b2ed

Browse files
authored
approval-answered-layout: read the answer inside its finished turn's work line, and run it in CI (#2764)
* approval-answered-layout: read the answer inside its finished turn's work line, and run it in CI * Name stay-signed-in-browser.test.tsx in the WebKit list, as the new rule asks of every browser test * Name the two browser tests that landed meanwhile, and list each browser job's files one per line pull request out of the merge queue for it: desktop-window-sign-in.test.tsx and approval-left-carry-on-browser.test.tsx now run in the WebKit job, both engines (50 pass). Every pull request that added a browser test changed the same one line of each list, so on a busy night each conflicted with all the others. The lists are now bash arrays, one file per line and sorted, so two additions touch different lines and merge. The same files run as before; a rule keeps the lists one per line and in order.
1 parent 83b7fd5 commit ba4b2ed

3 files changed

Lines changed: 268 additions & 21 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 111 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,12 +452,53 @@ jobs:
452452
# test script's pretest does).
453453
- run: bun run generate:app-config
454454
- run: |
455+
# One file per line, sorted: pull requests that each add a file then merge cleanly.
456+
files=(
457+
app/tests/a2ui-frame.test.tsx
458+
app/tests/account-version-layout.test.tsx
459+
app/tests/admin-people-remove-layout.test.tsx
460+
app/tests/admin-providers-connection.test.tsx
461+
app/tests/ai-connection-dialog.test.tsx
462+
app/tests/audit-computer-limit-layout.test.tsx
463+
app/tests/bot-orb-one-color.test.tsx
464+
app/tests/bot-screen-record-layout.test.tsx
465+
app/tests/checkbox-contrast.test.tsx
466+
app/tests/compact-avatar-layout.test.tsx
467+
app/tests/composer-dictation-notice-layout.test.tsx
468+
app/tests/composer-keeps-draft-browser.test.tsx
469+
app/tests/connect-your-ai.test.tsx
470+
app/tests/consent-handoff.test.tsx
471+
app/tests/conversation-intro-halo.test.tsx
472+
app/tests/conversation-refusal-layout.test.tsx
473+
app/tests/desktop-window-theme.test.tsx
474+
app/tests/generated-image-browser.test.tsx
475+
app/tests/large-picture-tile.test.tsx
476+
app/tests/maths-rendering.test.tsx
477+
app/tests/model-picker-phone-layout.test.tsx
478+
app/tests/needs-you-board-layout.test.tsx
479+
app/tests/onboarding-orb-room.test.tsx
480+
app/tests/onboarding-window-buttons.test.tsx
481+
app/tests/opendots-rail-badge.test.tsx
482+
app/tests/organization-menu-names.test.tsx
483+
app/tests/skins-window-buttons.test.tsx
484+
app/tests/task-report-chip.test.tsx
485+
app/tests/team-grants-screens-layout.test.tsx
486+
app/tests/team-models-screens-layout.test.tsx
487+
app/tests/teams-screens-layout.test.tsx
488+
app/tests/theme-follows-system.test.tsx
489+
app/tests/tool-line-reduced-motion.test.tsx
490+
app/tests/transcript-rail-clearance.test.tsx
491+
app/tests/transcript-room.test.tsx
492+
app/tests/update-banner-layout.test.tsx
493+
extension/tests/idle-worker.browser.test.ts
494+
extension/tests/recording-mark.browser.test.ts
495+
)
455496
docker run --rm --ipc=host \
456497
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE" \
457498
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
458499
--env OPENBOT_APP_BROWSER=1 \
459500
"$PLAYWRIGHT_IMAGE" \
460-
bun test --parallel app/tests/tool-line-reduced-motion.test.tsx app/tests/onboarding-window-buttons.test.tsx app/tests/onboarding-orb-room.test.tsx app/tests/transcript-rail-clearance.test.tsx app/tests/a2ui-frame.test.tsx app/tests/update-banner-layout.test.tsx app/tests/composer-dictation-notice-layout.test.tsx app/tests/conversation-intro-halo.test.tsx app/tests/transcript-room.test.tsx app/tests/skins-window-buttons.test.tsx app/tests/opendots-rail-badge.test.tsx app/tests/account-version-layout.test.tsx app/tests/organization-menu-names.test.tsx app/tests/bot-orb-one-color.test.tsx app/tests/compact-avatar-layout.test.tsx app/tests/theme-follows-system.test.tsx app/tests/desktop-window-theme.test.tsx app/tests/bot-screen-record-layout.test.tsx app/tests/teams-screens-layout.test.tsx app/tests/team-grants-screens-layout.test.tsx app/tests/team-models-screens-layout.test.tsx app/tests/conversation-refusal-layout.test.tsx app/tests/model-picker-phone-layout.test.tsx app/tests/needs-you-board-layout.test.tsx app/tests/checkbox-contrast.test.tsx app/tests/maths-rendering.test.tsx app/tests/task-report-chip.test.tsx app/tests/consent-handoff.test.tsx app/tests/large-picture-tile.test.tsx app/tests/audit-computer-limit-layout.test.tsx app/tests/ai-connection-dialog.test.tsx app/tests/connect-your-ai.test.tsx app/tests/admin-providers-connection.test.tsx app/tests/admin-people-remove-layout.test.tsx app/tests/composer-keeps-draft-browser.test.tsx app/tests/generated-image-browser.test.tsx extension/tests/idle-worker.browser.test.ts extension/tests/recording-mark.browser.test.ts
501+
bun test --parallel "${files[@]}"
461502
# On a failure, cancels the run at once (.github/actions/stop-on-failure).
462503
- if: failure()
463504
uses: $/.github/actions/stop-on-failure
@@ -576,12 +617,80 @@ jobs:
576617
- run: bun install --frozen-lockfile
577618
- run: bun run generate:app-config
578619
- run: |
620+
# One file per line, sorted: pull requests that each add a file then merge cleanly.
621+
files=(
622+
app/tests/add-custom-mcp-card-layout.test.tsx
623+
app/tests/admin-notion-one-press-layout.test.tsx
624+
app/tests/app-frame-skeleton-still.test.tsx
625+
app/tests/approval-answered-layout.test.tsx
626+
app/tests/approval-left-carry-on-browser.test.tsx
627+
app/tests/artifact-sign-in-refusal-browser.test.tsx
628+
app/tests/bot-long-instructions-layout.test.tsx
629+
app/tests/bot-screen-sharp.test.tsx
630+
app/tests/bots-panel-start-conversation.test.tsx
631+
app/tests/browse-apps-pages.test.tsx
632+
app/tests/chunk-recovery.test.tsx
633+
app/tests/composer-dictation-language.test.tsx
634+
app/tests/composer-keeps-draft-browser.test.tsx
635+
app/tests/composer-touch-return.test.tsx
636+
app/tests/computer-panel-phone-layout.test.tsx
637+
app/tests/computer-starting-browser.test.tsx
638+
app/tests/conversation-kept-browser.test.tsx
639+
app/tests/conversation-reopen-end.test.tsx
640+
app/tests/conversation-reply-toolbar-layout.test.tsx
641+
app/tests/conversation-switch.test.tsx
642+
app/tests/delete-account-layout.test.tsx
643+
app/tests/desktop-window-sign-in.test.tsx
644+
app/tests/finished-run-no-stopped-notice-browser.test.tsx
645+
app/tests/first-message-thinking.test.tsx
646+
app/tests/group-conversation-gutter.test.tsx
647+
app/tests/hand-back-row-layout.test.tsx
648+
app/tests/home-holds-still.test.tsx
649+
app/tests/home-no-answer.test.tsx
650+
app/tests/member-rows-long-names.test.tsx
651+
app/tests/move-to-cloud-settings.test.tsx
652+
app/tests/moved-apps-reconnect.test.tsx
653+
app/tests/moved-elsewhere.test.tsx
654+
app/tests/new-conversation-picked-model.test.tsx
655+
app/tests/one-press-connect-layout.test.tsx
656+
app/tests/organization-held-actions.test.tsx
657+
app/tests/organization-held-recovery.test.tsx
658+
app/tests/organization-held-reload.test.tsx
659+
app/tests/organization-members-remove.test.tsx
660+
app/tests/organization-moving.test.tsx
661+
app/tests/organization-removed.test.tsx
662+
app/tests/organization-unavailable-admin-pages.test.tsx
663+
app/tests/organization-unavailable-chat.test.tsx
664+
app/tests/organization-unavailable-pages.test.tsx
665+
app/tests/people-lists.test.tsx
666+
app/tests/rejoin-fresh-token-browser.test.tsx
667+
app/tests/renderer-crash.test.ts
668+
app/tests/roster-working.test.tsx
669+
app/tests/section-strip-routines.test.tsx
670+
app/tests/service-terms.test.tsx
671+
app/tests/settings-tool-cards-admin-layout.test.tsx
672+
app/tests/settings-tool-cards-core.test.tsx
673+
app/tests/settings-tool-cards-personal.test.tsx
674+
app/tests/sidebar-zoom-drag.test.tsx
675+
app/tests/sign-in-reconnect-layout.test.tsx
676+
app/tests/sign-in-returns-there.test.tsx
677+
app/tests/sign-in-with-apple-layout.test.tsx
678+
app/tests/stay-signed-in-browser.test.tsx
679+
app/tests/step-rows-layout.test.tsx
680+
app/tests/stopped-command-layout.test.tsx
681+
app/tests/stopped-turn-dismiss-browser.test.tsx
682+
app/tests/table-export-browser.test.tsx
683+
app/tests/team-connections-directory-layout.test.tsx
684+
app/tests/too-many-follow-ups.test.tsx
685+
app/tests/web-push-browser.test.tsx
686+
app/tests/what-if-handle-browser.test.tsx
687+
)
579688
docker run --rm --ipc=host \
580689
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE" \
581690
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
582691
--env OPENBOT_APP_BROWSER=1 --env OPENBOT_APP_ENGINES=chromium,webkit \
583692
"$PLAYWRIGHT_IMAGE" \
584-
bun test --parallel="$TEST_WORKERS" --timeout="$TEST_TIMEOUT_MS" app/tests/chunk-recovery.test.tsx app/tests/composer-dictation-language.test.tsx app/tests/sidebar-zoom-drag.test.tsx app/tests/service-terms.test.tsx app/tests/move-to-cloud-settings.test.tsx app/tests/moved-elsewhere.test.tsx app/tests/home-no-answer.test.tsx app/tests/section-strip-routines.test.tsx app/tests/organization-members-remove.test.tsx app/tests/settings-tool-cards-admin-layout.test.tsx app/tests/settings-tool-cards-personal.test.tsx app/tests/add-custom-mcp-card-layout.test.tsx app/tests/settings-tool-cards-core.test.tsx app/tests/one-press-connect-layout.test.tsx app/tests/sign-in-reconnect-layout.test.tsx app/tests/admin-notion-one-press-layout.test.tsx app/tests/team-connections-directory-layout.test.tsx app/tests/conversation-switch.test.tsx app/tests/conversation-kept-browser.test.tsx app/tests/member-rows-long-names.test.tsx app/tests/people-lists.test.tsx app/tests/organization-moving.test.tsx app/tests/organization-removed.test.tsx app/tests/organization-held-reload.test.tsx app/tests/organization-unavailable-pages.test.tsx app/tests/organization-held-actions.test.tsx app/tests/organization-unavailable-admin-pages.test.tsx app/tests/organization-held-recovery.test.tsx app/tests/bot-screen-sharp.test.tsx app/tests/bots-panel-start-conversation.test.tsx app/tests/table-export-browser.test.tsx app/tests/organization-unavailable-chat.test.tsx app/tests/too-many-follow-ups.test.tsx app/tests/moved-apps-reconnect.test.tsx app/tests/composer-keeps-draft-browser.test.tsx app/tests/conversation-reply-toolbar-layout.test.tsx app/tests/roster-working.test.tsx app/tests/delete-account-layout.test.tsx app/tests/composer-touch-return.test.tsx app/tests/bot-long-instructions-layout.test.tsx app/tests/web-push-browser.test.tsx app/tests/computer-panel-phone-layout.test.tsx app/tests/computer-starting-browser.test.tsx app/tests/browse-apps-pages.test.tsx app/tests/hand-back-row-layout.test.tsx app/tests/first-message-thinking.test.tsx app/tests/group-conversation-gutter.test.tsx app/tests/new-conversation-picked-model.test.tsx app/tests/renderer-crash.test.ts app/tests/home-holds-still.test.tsx app/tests/app-frame-skeleton-still.test.tsx app/tests/step-rows-layout.test.tsx app/tests/sign-in-returns-there.test.tsx app/tests/sign-in-with-apple-layout.test.tsx app/tests/stopped-command-layout.test.tsx app/tests/conversation-reopen-end.test.tsx app/tests/artifact-sign-in-refusal-browser.test.tsx app/tests/stopped-turn-dismiss-browser.test.tsx app/tests/rejoin-fresh-token-browser.test.tsx app/tests/finished-run-no-stopped-notice-browser.test.tsx app/tests/what-if-handle-browser.test.tsx
693+
bun test --parallel="$TEST_WORKERS" --timeout="$TEST_TIMEOUT_MS" "${files[@]}"
585694
# Connect your AI's sign-in code, copied with one press and read back from WebKit's clipboard.
586695
# Only that test: the rest of the file runs in Chromium in the job above.
587696
- run: |

‎app/tests/approval-answered-layout.test.tsx‎

Lines changed: 61 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,35 @@ async function shoot(page: Page, name: string) {
376376
await page.screenshot({ path: join(shots, `${name}.png`), fullPage: true });
377377
}
378378

379-
/** The folded line an answer left, found by the words it starts with. */
379+
/**
380+
* The folded line an answer left, found by the words its own summary starts with: not a line that
381+
* only holds it, as a finished turn's work line does (`workLine`).
382+
*/
380383
const answerLine = (page: Page, said: string) =>
381-
page.locator("details.tool-line", {
382-
has: page.locator("summary", { hasText: `${said}:` }),
383-
});
384+
page
385+
.locator("details.tool-line > summary", { hasText: `${said}:` })
386+
.locator("..");
387+
388+
/**
389+
* The one line a finished turn's work folds into, "Worked through 1 step", holding the answer to
390+
* the approval asked in that turn (`foldTurnWork`, chat-transcript.tsx: a conversation folds a
391+
* finished turn's completed tool work; what still waits on the person, or was refused, stays out).
392+
*/
393+
const workLine = (page: Page) =>
394+
page
395+
.locator("details.tool-line > summary", {
396+
// After the app's mark (Google's "G" here), so not anchored to the start.
397+
hasText: /Worked through \d+ steps?/,
398+
})
399+
.locator("..");
400+
401+
/** Opens the finished turn's work line, so the answer folded into it is in view. */
402+
async function openWork(page: Page) {
403+
const line = workLine(page);
404+
await line.waitFor({ timeout: 15_000 });
405+
if (!(await line.evaluate((element) => (element as HTMLDetailsElement).open)))
406+
await line.locator("> summary").click();
407+
}
384408

385409
async function answer(page: Page, choice: "Allow once" | "Deny") {
386410
const card = page.getByRole("region", { name: "Waiting for your approval" });
@@ -394,7 +418,7 @@ async function scrollsSideways(page: Page) {
394418

395419
/** One line: the answer and what it was about, never wrapped. */
396420
async function oneLine(page: Page, said: string) {
397-
const box = await answerLine(page, said).locator("summary").boundingBox();
421+
const box = await answerLine(page, said).locator("> summary").boundingBox();
398422
return (box?.height ?? 99) <= 28;
399423
}
400424

@@ -435,11 +459,12 @@ describe.skipIf(!asked)("an answered approval in a conversation", () => {
435459
expect(await oneLine(page, "Allowed once")).toBe(true);
436460
expect(
437461
await answerLine(page, "Allowed once")
438-
.locator("summary")
462+
.locator("> summary")
439463
.textContent(),
440464
).toContain("Create event on Google Calendar");
441465

442-
// The server carried it on, and the Bot asked again. Reloaded: the answer is still there.
466+
// The server carried it on, and the Bot asked again. Reloaded: the answer is still there,
467+
// folded with the rest of that finished turn's work, as one line inside its line.
443468
carriedOn(server);
444469
server.messages = [
445470
ASKED_INVITE,
@@ -450,6 +475,7 @@ describe.skipIf(!asked)("an answered approval in a conversation", () => {
450475
server.requests = [...server.requests, clickRequest()];
451476
await page.close();
452477
page = await open(engine, theme, window, server);
478+
await openWork(page);
453479
await answerLine(page, "Allowed once").waitFor({
454480
timeout: 15_000,
455481
});
@@ -468,27 +494,43 @@ describe.skipIf(!asked)("an answered approval in a conversation", () => {
468494
await styled(page);
469495
await shoot(page, `answered-4-denied-live-${name}`);
470496

471-
// Reloaded once more, as a past conversation is opened: both answers, folded.
497+
// Reloaded once more, as a past conversation is opened. The denial stays a line of its
498+
// own, as anything refused does; the allowance is in its turn's work line, closed, and
499+
// that line opens to it, one line, as it was answered.
472500
carriedOn(server);
473501
server.messages = [...server.messages, ...DENIED];
474502
await page.close();
475503
page = await open(engine, theme, window, server);
476504
await answerLine(page, "Denied").waitFor({ timeout: 15_000 });
477505
await page.getByText("because you declined").waitFor();
506+
await workLine(page).waitFor({ timeout: 15_000 });
478507
await styled(page);
479508
await shoot(page, `answered-5-reloaded-${name}`);
480-
for (const said of ["Allowed once", "Denied"]) {
481-
const line = answerLine(page, said);
482-
expect(await line.isVisible()).toBe(true);
483-
expect(
484-
await line.evaluate(
485-
(element) => (element as HTMLDetailsElement).open,
486-
),
487-
).toBe(false);
488-
expect(await oneLine(page, said)).toBe(true);
489-
}
509+
const closed = (line: ReturnType<typeof answerLine>) =>
510+
line.evaluate((element) => (element as HTMLDetailsElement).open);
511+
const denied = answerLine(page, "Denied");
512+
expect(await denied.isVisible()).toBe(true);
513+
expect(await closed(denied)).toBe(false);
514+
expect(await oneLine(page, "Denied")).toBe(true);
515+
const work = workLine(page);
516+
expect(await work.isVisible()).toBe(true);
517+
expect(await closed(work)).toBe(false);
490518
expect(
491-
await answerLine(page, "Denied").locator("summary").textContent(),
519+
((await work.locator("> summary").boundingBox())?.height ?? 99) <=
520+
28,
521+
).toBe(true);
522+
await openWork(page);
523+
const allowed = answerLine(page, "Allowed once");
524+
await allowed.waitFor({ timeout: 15_000 });
525+
expect(await closed(allowed)).toBe(false);
526+
expect(await oneLine(page, "Allowed once")).toBe(true);
527+
expect(await allowed.locator("> summary").textContent()).toContain(
528+
"Create event on Google Calendar",
529+
);
530+
expect(
531+
await answerLine(page, "Denied")
532+
.locator("> summary")
533+
.textContent(),
492534
).toContain("Click on shop.example");
493535
expect(
494536
await page

0 commit comments

Comments
 (0)