Add Playwright e2e coverage and Node 20 pin
This commit is contained in:
38
frontend/e2e/resume.spec.ts
Normal file
38
frontend/e2e/resume.spec.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { expect, test } from '@playwright/test'
|
||||
import {
|
||||
createAuthenticatedApiContext,
|
||||
createSession,
|
||||
createTroubleshootingTree,
|
||||
disposeApiContext,
|
||||
} from './helpers/api'
|
||||
|
||||
test.describe('session resume smoke tests', () => {
|
||||
test('can resume an incomplete session from the library page', async ({ page }) => {
|
||||
const api = await createAuthenticatedApiContext()
|
||||
const tree = await createTroubleshootingTree(api, {
|
||||
question: 'Is the affected service still down?',
|
||||
})
|
||||
await createSession(api, tree.id, {
|
||||
ticket_number: 'PW-RESUME',
|
||||
client_name: 'Resume Client',
|
||||
})
|
||||
|
||||
try {
|
||||
await page.goto('/trees')
|
||||
|
||||
const resumeCard = page.locator('.bg-card').filter({ hasText: tree.name }).filter({ hasText: 'Resume' }).first()
|
||||
await expect(resumeCard).toBeVisible()
|
||||
await resumeCard.getByRole('button', { name: 'Resume' }).first().click()
|
||||
|
||||
await expect(page).toHaveURL(new RegExp(`/trees/${tree.id}/navigate`))
|
||||
await expect(
|
||||
page.getByRole('heading', { name: tree.name }),
|
||||
).toBeVisible()
|
||||
await expect(
|
||||
page.getByRole('heading', { name: 'Is the affected service still down?' }),
|
||||
).toBeVisible()
|
||||
} finally {
|
||||
await disposeApiContext(api)
|
||||
}
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user