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 * * *', ) })