The findings of the Debian host (OS packages and applications found in the root filesystem) and of the container images in the cluster were mixed in one flat table. They are now two prominent categories: a card each with its own severity split and target count, acting as the primary selector, and a table that adapts to the selection. Host findings show the package source reported by the scanner (debian, gobinary, node-pkg …) instead of the target, container findings show the image. Backend: findings carry the scanner's package source, the list endpoint takes ?scope=host|container, and the targets endpoint reports each target with its category and open count. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
37 lines
1.8 KiB
TypeScript
37 lines
1.8 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 expect(page.getByRole('row', { name: /CVE-2023-45853/ })).toBeVisible()
|
|
|
|
await page.getByLabel('Minimum severity').selectOption('critical')
|
|
await expect(page.getByRole('row', { name: /CVE-2011-3374/ })).toHaveCount(0)
|
|
await page.getByLabel('Minimum severity').selectOption('low')
|
|
await expect(page.getByRole('row', { name: /CVE-2011-3374/ })).toBeVisible()
|
|
|
|
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')
|
|
})
|