From 76e416052c88feb87a4660f0a4e9c5aeec034ccf Mon Sep 17 00:00:00 2001 From: Gille <4317663+helix4u@users.noreply.github.com> Date: Sun, 26 Jul 2026 22:35:13 -0600 Subject: [PATCH] test(desktop): wait for committed compress directive --- ...session-compression-and-queue-stop.spec.ts | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/apps/desktop/e2e/session-compression-and-queue-stop.spec.ts b/apps/desktop/e2e/session-compression-and-queue-stop.spec.ts index 911f15c78407..f9d8218aba2b 100644 --- a/apps/desktop/e2e/session-compression-and-queue-stop.spec.ts +++ b/apps/desktop/e2e/session-compression-and-queue-stop.spec.ts @@ -4,11 +4,7 @@ import { expect, test, type Page } from '@playwright/test' -import { - type MockBackendFixture, - setupMockBackend, - waitForAppReady, -} from './fixtures' +import { type MockBackendFixture, setupMockBackend, waitForAppReady } from './fixtures' import { MOCK_REPLY, receivedUserTexts, restartMockServer } from './mock-server' async function send(page: Page, text: string, delay = 15): Promise { @@ -25,12 +21,11 @@ async function pasteAndSend(page: Page, text: string): Promise { await page.keyboard.press('Enter') } - async function waitForTranscript(page: Page, text: string, timeout = 90_000): Promise { await page.waitForFunction( expected => document.querySelector('[data-slot="aui_thread-viewport"]')?.textContent?.includes(expected) ?? false, text, - { timeout }, + { timeout } ) } @@ -70,15 +65,18 @@ test.describe('session compression', () => { const composer = page.locator('[contenteditable="true"]').first() await composer.click() await composer.type('/compress', { delay: 15 }) - await page.getByText('/compress').first().waitFor({ state: 'visible' }) + const compressionCompletion = page + .locator('[data-slot="composer-completion-drawer"][role="listbox"]') + .getByRole('button', { name: /^\/compress\b/ }) + await expect(compressionCompletion).toBeVisible() + await compressionCompletion.hover() + await expect(compressionCompletion).toHaveAttribute('data-highlighted', '') await page.keyboard.press('Enter') + await expect(composer.locator('[data-slot="aui_slash-chip"][title="/compress"]')).toBeVisible() await composer.type(' preserve the three test turns', { delay: 15 }) await page.keyboard.press('Enter') await expect - .poll( - () => page.locator('[data-slot="aui_thread-viewport"]').textContent(), - { timeout: 90_000 }, - ) + .poll(() => page.locator('[data-slot="aui_thread-viewport"]').textContent(), { timeout: 90_000 }) .toMatch(/Compressed|No changes from compression/) // Compression rotates the agent's live session id. A post-compression @@ -105,7 +103,7 @@ auxiliary: provider: custom model: mock-model`, mockServer: { - holdFirstCompletionContaining: 'You are a summarization agent creating a context checkpoint.', + holdFirstCompletionContaining: 'You are a summarization agent creating a context checkpoint.' } }) await waitForAppReady(fixture, 120_000)