Files
metabuilder/frontends/workflowui/playwright/auth.json
2026-03-09 22:30:41 +00:00

234 lines
6.2 KiB
JSON

{
"$schema": "https://metabuilder.dev/schemas/package-playwright.schema.json",
"package": "workflowui-auth",
"description": "E2E tests for authentication pages migrated to FakeMUI",
"tests": [
{
"name": "login page displays correctly",
"tags": ["@migration", "@auth", "@login"],
"steps": [
{
"action": "navigate",
"url": "/login"
},
{
"action": "waitForLoadState",
"state": "networkidle"
},
{
"description": "Verify auth layout visible",
"action": "expect",
"selector": "[data-testid='auth-layout']",
"assertion": {
"matcher": "toBeVisible"
}
},
{
"description": "Verify email input visible",
"action": "expect",
"selector": "[data-testid='email-input']",
"assertion": {
"matcher": "toBeVisible"
}
},
{
"description": "Verify password input visible",
"action": "expect",
"selector": "[data-testid='password-input']",
"assertion": {
"matcher": "toBeVisible"
}
},
{
"description": "Verify login button visible",
"action": "expect",
"selector": "[data-testid='login-button']",
"assertion": {
"matcher": "toBeVisible"
}
}
]
},
{
"name": "register page displays password strength indicator",
"tags": ["@migration", "@auth", "@register"],
"steps": [
{
"action": "navigate",
"url": "/register"
},
{
"action": "waitForLoadState",
"state": "networkidle"
},
{
"description": "Fill password field",
"action": "fill",
"selector": "[data-testid='password-input']",
"value": "Weak1"
},
{
"description": "Verify password strength indicator visible",
"action": "expect",
"selector": "[data-testid='password-strength-indicator']",
"assertion": {
"matcher": "toBeVisible"
}
},
{
"description": "Verify strength message visible",
"action": "expect",
"selector": "[data-testid='password-strength-message']",
"assertion": {
"matcher": "toBeVisible"
}
},
{
"description": "Verify hint text visible",
"action": "expect",
"selector": "[data-testid='password-strength-hint']",
"assertion": {
"matcher": "toBeVisible"
}
}
]
},
{
"name": "can fill and submit login form",
"tags": ["@migration", "@forms", "@auth"],
"steps": [
{
"action": "navigate",
"url": "/login"
},
{
"action": "fill",
"selector": "[data-testid='email-input']",
"value": "test@example.com"
},
{
"action": "fill",
"selector": "[data-testid='password-input']",
"value": "password123"
},
{
"action": "click",
"selector": "[data-testid='login-button']"
},
{
"action": "waitForLoadState",
"state": "networkidle"
}
]
},
{
"name": "register page footer link navigates to login",
"tags": ["@migration", "@navigation", "@auth"],
"steps": [
{
"action": "navigate",
"url": "/register"
},
{
"action": "waitForLoadState",
"state": "networkidle"
},
{
"description": "Click footer link to login",
"action": "click",
"selector": "[data-testid='auth-footer-link']"
},
{
"action": "waitForLoadState",
"state": "networkidle"
},
{
"description": "Verify navigated to login page",
"action": "expect",
"selector": "text=Sign in to your account",
"assertion": {
"matcher": "toBeVisible"
}
}
]
},
{
"name": "404 page displays fail whale",
"tags": ["@migration", "@error"],
"steps": [
{
"action": "navigate",
"url": "/nonexistent-page-12345"
},
{
"action": "waitForLoadState",
"state": "networkidle"
},
{
"description": "Verify 404 state visible",
"action": "expect",
"selector": "[data-testid='not-found-state']",
"assertion": {
"matcher": "toBeVisible"
}
},
{
"description": "Verify fail whale illustration",
"action": "expect",
"selector": "[data-testid='fail-whale-illustration']",
"assertion": {
"matcher": "toBeVisible"
}
},
{
"description": "Verify error code displayed",
"action": "expect",
"selector": "[data-testid='error-code']",
"assertion": {
"matcher": "toHaveText",
"expected": "404"
}
},
{
"description": "Verify primary action button",
"action": "expect",
"selector": "[data-testid='primary-action']",
"assertion": {
"matcher": "toBeVisible"
}
}
]
},
{
"name": "header actions display correctly",
"tags": ["@migration", "@header"],
"steps": [
{
"action": "navigate",
"url": "/"
},
{
"action": "waitForLoadState",
"state": "networkidle"
},
{
"description": "Verify header actions visible",
"action": "expect",
"selector": "[data-testid='header-actions']",
"assertion": {
"matcher": "toBeVisible"
}
},
{
"description": "Verify theme toggle button",
"action": "expect",
"selector": "[data-testid='toggle-theme-button']",
"assertion": {
"matcher": "toBeVisible"
}
}
]
}
]
}