Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions apps/web/tests/e2e/live-stack.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ test('verifies the authorized live stack through the operator console', async ({
await writeFile(fixturePath, textPdf(`Evidence phrase: ${uniquePhrase}.`))

await page.goto('/connect')
await waitForHydration(page)
const connectButton = page.getByRole('button', { name: 'Connect' })
await expect(connectButton).toBeEnabled()
await page.getByLabel('API key').fill(liveKey)
Expand Down Expand Up @@ -57,7 +58,11 @@ test('verifies the authorized live stack through the operator console', async ({
await expect(page.locator('dt', { hasText: 'Pages' }).locator('xpath=following-sibling::dd[1]')).toContainText('1')

await page.goto('/chat')
await expect(page.getByRole('complementary', { name: 'Recent chats' })).toContainText(uniquePhrase)
await waitForHydration(page)
const recentChats = page
.getByRole('navigation', { name: 'Side navigation' })
.getByRole('group', { name: 'Recent chats' })
await expect(recentChats).toContainText(uniquePhrase)

await page.goto('/settings')
await waitForHydration(page)
Expand All @@ -76,7 +81,7 @@ test('verifies the authorized live stack through the operator console', async ({
})

async function waitForHydration(page: import('@playwright/test').Page) {
await expect(page.locator('html')).toHaveAttribute('data-hydrated', 'true')
await expect(page.locator('html')).toHaveAttribute('data-hydrated', 'true', { timeout: 15_000 })
}

function textPdf(text: string): Buffer {
Expand Down