29 lines
869 B
TypeScript
29 lines
869 B
TypeScript
import { expect, test } from '@playwright/test'
|
|
import {
|
|
createAuthenticatedApiContext,
|
|
createTroubleshootingTree,
|
|
disposeApiContext,
|
|
} from './helpers/api'
|
|
|
|
test.describe('flow library smoke tests', () => {
|
|
test('can search for an API-created troubleshooting flow', async ({ page }) => {
|
|
const api = await createAuthenticatedApiContext()
|
|
const tree = await createTroubleshootingTree(api)
|
|
|
|
try {
|
|
await page.goto('/trees')
|
|
|
|
await expect(
|
|
page.getByRole('heading', { name: 'Flow Library' }),
|
|
).toBeVisible()
|
|
|
|
await page.getByPlaceholder('Search flows...').fill(tree.name)
|
|
await page.getByRole('button', { name: 'Search', exact: true }).click()
|
|
|
|
await expect(page.getByTestId('tree-card').filter({ hasText: tree.name }).first()).toBeVisible()
|
|
} finally {
|
|
await disposeApiContext(api)
|
|
}
|
|
})
|
|
})
|