Files
tapehoard/frontend/tests/e2e.test.ts
T
adamlamers 6298aea64a
Continuous Integration / backend-tests (push) Successful in 9m53s
Continuous Integration / frontend-check (push) Successful in 9m36s
Continuous Integration / e2e-tests (push) Failing after 13m51s
e2e test setup
2026-04-29 01:26:48 -04:00

33 lines
1.2 KiB
TypeScript

import { test, expect } from '@playwright/test';
test.describe('TapeHoard Golden Path', () => {
test('homepage loads and shows basic navigation', async ({ page }) => {
await page.goto('/');
// Validate the page title or basic UI elements exist
// This assumes there's some header or title indicating TapeHoard
await expect(page).toHaveTitle(/TapeHoard|Svelte/i);
// Check if navigation links are visible
// We expect links to Backup Manager, Media Inventory, Archive Index etc based on E2E.md
const nav = page.locator('nav');
if (await nav.count() > 0) {
await expect(page.locator('text=Inventory').first()).toBeVisible();
await expect(page.locator('text=Archive').first()).toBeVisible();
}
});
test('media inventory shows mock provider when in test mode', async ({ page }) => {
await page.goto('/inventory');
// Wait for the page to be fully loaded and hydrated
await page.waitForLoadState('networkidle');
// Click the Register media button to open the dialog
await page.getByRole('button', { name: /Register media/i }).click();
// Check for the Mock provider text inside the dialog
await expect(page.getByText('Mock LTO Tape (Test)')).toBeVisible({ timeout: 10000 });
});
});