Files
madbase/control-plane-ui/tests/e2e/servers.spec.ts
Vlad Durnea cffdf8af86
Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped
wip:milestone 0 fixes
2026-03-15 12:35:42 +02:00

42 lines
1.3 KiB
TypeScript

import { test, expect } from '@playwright/test'
test.describe('Servers E2E - Comprehensive', () => {
test.beforeEach(async ({ page }) => {
await page.goto('http://localhost:5173/servers')
await page.waitForLoadState('networkidle')
})
test('displays servers page with all elements', async ({ page }) => {
// Check page title
await expect(page.locator('text=/servers/i')).toBeVisible()
// Check for data grid or table
const grid = page.locator('.MuiDataGrid-root, table')
await expect(grid.first()).toBeVisible()
// Check for add button
await expect(page.locator('button:has-text("Add")').or(page.locator('text=/add server/i'))).toBeVisible()
})
test('interacts with server list', async ({ page }) => {
// Wait for data to load
await page.waitForTimeout(1000)
// Check for server data
const serverText = await page.textContent('body')
expect(serverText?.toLowerCase()).toMatch(/server|worker|node/i)
})
test('navigates to other pages', async ({ page }) => {
// Navigate to templates
await page.click('text=Templates')
await page.waitForURL('**/templates')
await expect(page).toHaveURL(/templates/)
// Navigate to scaling
await page.click('text=Scaling')
await page.waitForURL('**/scaling')
await expect(page).toHaveURL(/scaling/)
})
})