The findings table listed every CVE, which is thousands of rows on a real host. It now shows one row per affected package (host) or image (containers) with its severity split, how many findings it has and how many of them have a fix. Clicking a row loads and shows the CVEs of that group; collapsing keeps them cached. The rollup is a GROUP BY in SQLite behind a new groups endpoint, so the page loads a few dozen rows instead of the full finding list, and the flat list gained a package filter to expand one group. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
39 lines
1.9 KiB
TypeScript
39 lines
1.9 KiB
TypeScript
import { test, expect } from '@playwright/test'
|
|
|
|
test('admin runs a scan, filters findings and acknowledges one', async ({ page }) => {
|
|
await page.goto('/login')
|
|
await page.getByLabel('Email').fill('admin@example.com')
|
|
await page.getByLabel('Password').fill('admin-password-123')
|
|
await page.getByRole('button', { name: 'Sign in' }).click()
|
|
await page.getByRole('navigation').getByRole('link', { name: 'Vulnerabilities' }).click()
|
|
|
|
await page.getByRole('button', { name: 'Scan now' }).click()
|
|
await expect(page.getByTestId('scope-host-critical')).not.toHaveText('0', { timeout: 20_000 })
|
|
await page.getByRole('row', { name: /zlib1g/ }).click()
|
|
await expect(page.getByRole('row', { name: /CVE-2023-45853/ })).toBeVisible()
|
|
|
|
await page.getByLabel('Minimum severity').selectOption('critical')
|
|
await expect(page.getByRole('row', { name: /apt/ })).toHaveCount(0)
|
|
await page.getByLabel('Minimum severity').selectOption('low')
|
|
await expect(page.getByRole('row', { name: /apt/ })).toBeVisible()
|
|
|
|
await page.getByRole('row', { name: /zlib1g/ }).click()
|
|
const row = page.getByRole('row', { name: /CVE-2023-45853/ })
|
|
await row.getByRole('button', { name: 'Acknowledge' }).click()
|
|
await expect(row).toContainText('acknowledged')
|
|
|
|
await row.getByRole('button', { name: 'Details' }).click()
|
|
await expect(page.getByRole('dialog')).toContainText('zlib')
|
|
})
|
|
|
|
test('notification threshold can be changed in settings', async ({ page }) => {
|
|
await page.goto('/login')
|
|
await page.getByLabel('Email').fill('admin@example.com')
|
|
await page.getByLabel('Password').fill('admin-password-123')
|
|
await page.getByRole('button', { name: 'Sign in' }).click()
|
|
await page.getByRole('navigation').getByRole('link', { name: 'Settings' }).click()
|
|
await page.getByLabel('Notify from severity').selectOption('medium')
|
|
await page.getByRole('button', { name: 'Save notifications' }).click()
|
|
await expect(page.getByRole('status')).toContainText('Notification settings saved')
|
|
})
|