Files
Infrastruktur-Monitoring-Sy…/frontend/e2e/app-backup.spec.ts
Dennis Nemec b0831c008d Backup page: pick an application instead of assembling a strategy by hand
The page now starts with the applications found on the cluster and on the
host, each showing what it offers. Choosing one opens a short flow:
select data and database, pick how often, pick a target, save. That
creates one strategy per selected part, so Gitea's volume and its
PostgreSQL dump become two ordinary strategies with their own history.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-03 20:52:57 +02:00

40 lines
2.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { test, expect } from '@playwright/test'
test('an admin backs up Gitea data and database in one flow', 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 expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible()
await page.goto('/backups')
// a target is needed first
await page.getByRole('button', { name: 'New target' }).click()
const name = `NAS ${Date.now()}`
await page.getByLabel('Name', { exact: true }).fill(name)
await page.getByLabel('Host', { exact: true }).fill('nas.local')
await page.getByLabel('Share').fill('backups')
await page.getByLabel('Username', { exact: true }).fill('backup')
await page.getByLabel('Password', { exact: true }).fill('smb-secret')
await page.getByRole('button', { name: 'Save target' }).click()
await expect(page.getByRole('row', { name: new RegExp(name) })).toBeVisible()
// the discovered applications are shown with what they offer
const gitea = page.getByTestId('application-k8s:gitea/gitea')
await expect(gitea).toContainText('Gitea')
await expect(gitea).toContainText('Data + DB')
await expect(page.getByTestId('application-host:monitoring.service')).toContainText('Monitoring')
// Gitea → select → schedule → target → save
await gitea.getByRole('button', { name: 'Back up' }).click()
await expect(page.getByRole('dialog')).toContainText('gitea-shared-storage')
await page.getByLabel('Target', { exact: true }).selectOption({ label: name })
await page.getByRole('button', { name: 'Create backup plan' }).click()
await expect(page.getByText(/2 backup strategies created/)).toBeVisible()
await expect(page.getByRole('row', { name: /Gitea – Gitea volume/ })).toBeVisible()
await expect(page.getByRole('row', { name: /Gitea – PostgreSQL dump/ })).toContainText(
'0 0 3 * * *',
)
})