chore: clean up repo structure
- Add node_modules/, test-results/, e2e-report/, .omp/ to .gitignore - Remove throwaway debug scripts (debug-pw*.js, debug-login-dom.js) - Remove empty mock-server/ directory - Untrack harness artifact (.omp/plans/) - Add missing project files to git (e2e tests, Dockerfiles, tooling configs)
This commit is contained in:
34
e2e/overview.spec.ts
Normal file
34
e2e/overview.spec.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { login } from './utils/auth';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await login(page);
|
||||
await page.goto('/cgi-bin/luci/admin/services/zt-gateway');
|
||||
await page.waitForSelector('#zt-gateway-root', { timeout: 15_000 });
|
||||
});
|
||||
|
||||
test('displays gateway table with correct rows', async ({ page }) => {
|
||||
const root = page.locator('#zt-gateway-root');
|
||||
await expect(root).toBeVisible();
|
||||
|
||||
const rows = page.locator('.zt-gateways tbody tr.zt-gateway-row');
|
||||
await expect(rows).toHaveCount(3);
|
||||
|
||||
await expect(page.locator('.zt-gateway-row[data-region="amsterdam"]')).toContainText('Amsterdam');
|
||||
await expect(page.locator('.zt-gateway-row[data-region="tirunelveli"]')).toContainText('Tirunelveli');
|
||||
|
||||
const activeRow = page.locator('.zt-gateway-row', { hasText: 'active' });
|
||||
await expect(activeRow).toHaveCount(1);
|
||||
});
|
||||
|
||||
test('active gateway radio is disabled', async ({ page }) => {
|
||||
const activeRow = page.locator('.zt-gateway-row', { hasText: 'active' });
|
||||
const radio = activeRow.locator('input[type=radio]');
|
||||
await expect(radio).toBeDisabled();
|
||||
});
|
||||
|
||||
test('non-active gateway radios are enabled', async ({ page }) => {
|
||||
const tirunelveliRow = page.locator('.zt-gateway-row[data-region="tirunelveli"]');
|
||||
const radio = tirunelveliRow.locator('input[type=radio]');
|
||||
await expect(radio).toBeEnabled();
|
||||
});
|
||||
Reference in New Issue
Block a user