diff --git a/TEST_STORY_CONVERSION.md b/TEST_STORY_CONVERSION.md index 517d5aaf8..2f7df3682 100644 --- a/TEST_STORY_CONVERSION.md +++ b/TEST_STORY_CONVERSION.md @@ -136,21 +136,44 @@ export const Default: Story = { ## Existing Test Files Status -### Can Be Converted (2,500+ lines) -- `e2e/smoke.spec.ts` → `packages/smoke_tests/playwright/tests.json` ✅ DONE -- `e2e/login.spec.ts` → `packages/auth/playwright/tests.json` ✅ DONE -- `e2e/crud.spec.ts` → `packages/crud/playwright/tests.json` ✅ DONE -- `e2e/navigation.spec.ts` → `packages/navigation/playwright/tests.json` ✅ DONE -- `e2e/pagination.spec.ts` → `packages/pagination/playwright/tests.json` ✅ DONE -- `e2e/package-loading.spec.ts` → `packages/package_tests/playwright/tests.json` ✅ DONE -- `e2e/package-rendering.spec.ts` → `packages/package_tests/playwright/tests.json` ✅ DONE -- `e2e/auth/*.spec.ts` → `packages/auth/playwright/tests.json` ✅ DONE -- `e2e/crud/*.spec.ts` → `packages/crud/playwright/tests.json` ✅ DONE -- `e2e/api/*.spec.ts` → `packages/api_tests/playwright/tests.json` ✅ DONE (marked skip - requires request context) +### ✅ Fully Converted (2,500+ lines → 95 JSON tests) -### Should Keep As-Is -- `e2e/dbal-daemon/*.spec.ts` - Complex daemon testing -- Tests with custom TypeScript logic that can't be represented in JSON +**Tests now properly scoped to their functional packages:** + +1. **`packages/smoke_tests/playwright/tests.json`** (4 tests) + - From: `e2e/smoke.spec.ts` + - Cross-cutting smoke tests for overall app functionality + +2. **`packages/ui_auth/playwright/tests.json`** (16 tests) + - From: `e2e/login.spec.ts`, `e2e/auth/authentication.spec.ts`, `e2e/auth/complete-flow.spec.ts` + - Authentication and login functionality tests + +3. **`packages/user_manager/playwright/tests.json`** (24 tests) + - From: `e2e/crud.spec.ts`, `e2e/crud/user-management.spec.ts`, `e2e/crud/complete-flow.spec.ts` + - User CRUD operations and management tests + +4. **`packages/ui_home/playwright/tests.json`** (14 tests: 8 original + 6 navigation) + - From: Original + `e2e/navigation.spec.ts` (merged) + - Home page and app navigation tests + +5. **`packages/data_table/playwright/tests.json`** (9 tests) + - From: `e2e/pagination.spec.ts` + - Pagination component tests + +6. **`packages/package_manager/playwright/tests.json`** (24 tests) + - From: `e2e/package-rendering.spec.ts`, `e2e/package-loading.spec.ts` + - Package lifecycle and rendering tests + +7. **`packages/dashboard/playwright/tests.json`** (2 tests) + - Dashboard widget tests + +8. **`packages/api_tests/playwright/tests.json`** (12 tests, marked skip) + - From: `e2e/api/crud-operations.spec.ts` + - API endpoint tests (requires JSON runner enhancement for request context) + +### Should Keep As TypeScript +- `e2e/dbal-daemon/*.spec.ts` - Complex daemon testing with specialized logic +- Tests requiring custom TypeScript logic that can't be represented in JSON declaratively ### Storybook Files - `storybook/src/stories/*.stories.tsx` (8 files) - Can be converted diff --git a/packages/auth/package.json b/packages/auth/package.json deleted file mode 100644 index ca6a2cd90..000000000 --- a/packages/auth/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://metabuilder.dev/schemas/package-metadata.schema.json", - "packageId": "auth", - "name": "Authentication", - "version": "1.0.0", - "description": "Authentication and login functionality for MetaBuilder", - "category": "authentication", - "minLevel": 0, - "keywords": ["auth", "login", "authentication", "security"] -} diff --git a/packages/crud/package.json b/packages/crud/package.json deleted file mode 100644 index 896c80d56..000000000 --- a/packages/crud/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://metabuilder.dev/schemas/package-metadata.schema.json", - "packageId": "crud", - "name": "CRUD Tests", - "version": "1.0.0", - "description": "CRUD operations E2E tests for entity management", - "category": "testing", - "minLevel": 0, - "keywords": ["crud", "tests", "entities", "operations"] -} diff --git a/packages/crud/playwright/tests.json b/packages/crud/playwright/tests.json deleted file mode 100644 index 19f8c4236..000000000 --- a/packages/crud/playwright/tests.json +++ /dev/null @@ -1,635 +0,0 @@ -{ - "$schema": "https://metabuilder.dev/schemas/package-playwright.schema.json", - "package": "crud", - "version": "1.0.0", - "description": "CRUD operations E2E tests - converted from e2e/crud.spec.ts, e2e/crud/user-management.spec.ts, and e2e/crud/complete-flow.spec.ts", - "tests": [ - { - "name": "should have landing page with navigation options", - "tags": ["@crud", "@interface"], - "steps": [ - { - "description": "Navigate to home page", - "action": "navigate", - "url": "/" - }, - { - "description": "Wait for page to load", - "action": "waitForLoadState", - "state": "domcontentloaded" - }, - { - "description": "Verify sign in button is visible", - "action": "expect", - "role": "button", - "text": "sign in", - "assertion": { - "matcher": "toBeVisible" - } - } - ] - }, - { - "name": "should navigate to login when clicking sign in", - "tags": ["@crud", "@navigation"], - "steps": [ - { - "action": "navigate", - "url": "/" - }, - { - "description": "Click sign in button", - "action": "click", - "role": "button", - "text": "sign in" - }, - { - "description": "Verify username field appears", - "action": "expect", - "label": "username", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should have descriptive content on landing page", - "tags": ["@crud", "@content"], - "steps": [ - { - "action": "navigate", - "url": "/" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Check body has content", - "action": "expect", - "selector": "body", - "assertion": { - "matcher": "toBeVisible" - } - } - ] - }, - { - "name": "should have username and password fields in login", - "tags": ["@crud", "@login"], - "steps": [ - { - "action": "navigate", - "url": "/" - }, - { - "action": "click", - "role": "button", - "text": "sign in" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Check for username field", - "action": "expect", - "label": "username", - "assertion": { - "matcher": "toBeVisible" - } - }, - { - "description": "Check for password field", - "action": "expect", - "label": "password", - "assertion": { - "matcher": "toBeVisible" - } - } - ] - }, - { - "name": "should have submit button on login form", - "tags": ["@crud", "@login"], - "steps": [ - { - "action": "navigate", - "url": "/" - }, - { - "action": "click", - "role": "button", - "text": "sign in" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Check for login button", - "action": "expect", - "role": "button", - "text": "login", - "assertion": { - "matcher": "toBeVisible" - } - } - ] - }, - { - "name": "should display entity list", - "tags": ["@crud", "@list", "@flow"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Check if list view is visible", - "action": "expect", - "role": "heading", - "text": "list", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - }, - { - "description": "Check if table or list container exists", - "action": "expect", - "selector": "table, [role=\"table\"], .entity-list", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should have create button in entity list", - "tags": ["@crud", "@list"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Check for create/new button", - "action": "expect", - "role": "button", - "text": "create", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should navigate to create form", - "tags": ["@crud", "@create"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Click create button", - "action": "click", - "role": "button", - "text": "create" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Should see create form", - "action": "expect", - "role": "heading", - "text": "create", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should show form fields in create form", - "tags": ["@crud", "@create"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/create" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Should have at least one input field", - "action": "expect", - "selector": "input, textarea, select", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should have submit button in create form", - "tags": ["@crud", "@create"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/create" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Should have submit/save/create button", - "action": "expect", - "role": "button", - "text": "submit", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should show validation errors for empty required fields", - "tags": ["@crud", "@create", "@validation"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/create" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Try to submit without filling required fields", - "action": "click", - "role": "button", - "text": "submit" - }, - { - "description": "Should show validation error", - "action": "expect", - "text": "required", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should display entity details", - "tags": ["@crud", "@read"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/test-user-123" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Should show detail view", - "action": "expect", - "role": "heading", - "text": "detail", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should have edit button in detail view", - "tags": ["@crud", "@update"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/test-user-123" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Should have edit button", - "action": "expect", - "role": "button", - "text": "edit", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should have delete button in detail view", - "tags": ["@crud", "@delete"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/test-user-123" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Should have delete button", - "action": "expect", - "role": "button", - "text": "delete", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should show 404 for non-existent entity", - "tags": ["@crud", "@error-handling"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/non-existent-id-999" - }, - { - "action": "waitForLoadState", - "state": "domcontentloaded" - }, - { - "description": "Should show 404 or not found message", - "action": "expect", - "text": "not found", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should navigate to edit form", - "tags": ["@crud", "@update"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/test-user-123" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Click edit button", - "action": "click", - "role": "button", - "text": "edit" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Should see edit form", - "action": "expect", - "role": "heading", - "text": "edit", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should show pre-filled form fields in edit form", - "tags": ["@crud", "@update"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/test-user-123/edit" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Form fields should have values", - "action": "expect", - "selector": "input[type=\"text\"], input[type=\"email\"]", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should have update button in edit form", - "tags": ["@crud", "@update"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/test-user-123/edit" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Should have update/save button", - "action": "expect", - "role": "button", - "text": "update", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should show confirmation before delete", - "tags": ["@crud", "@delete"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/test-user-123" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Click delete button", - "action": "click", - "role": "button", - "text": "delete" - }, - { - "description": "Should show confirmation dialog", - "action": "expect", - "role": "button", - "text": "confirm", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should have cancel option in delete confirmation", - "tags": ["@crud", "@delete"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/test-user-123" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Click delete button", - "action": "click", - "role": "button", - "text": "delete" - }, - { - "description": "Should have cancel button", - "action": "expect", - "role": "button", - "text": "cancel", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should show pagination controls when list is large", - "tags": ["@crud", "@pagination"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Look for pagination controls", - "action": "expect", - "selector": "[role=\"navigation\"], .pagination, nav", - "assertion": { - "matcher": "toBeVisible" - } - } - ] - }, - { - "name": "should have filter/search input", - "tags": ["@crud", "@filter"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Look for search or filter input", - "action": "expect", - "selector": "input[type=\"search\"], input[placeholder*=\"search\" i]", - "assertion": { - "matcher": "toBeVisible" - } - } - ] - }, - { - "name": "should restrict access based on user level", - "tags": ["@crud", "@permissions"], - "steps": [ - { - "action": "navigate", - "url": "/default/admin/system_config" - }, - { - "action": "waitForLoadState", - "state": "domcontentloaded" - }, - { - "description": "Should see access denied or redirect to login", - "action": "expect", - "text": "access denied", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should show breadcrumb trail on detail pages", - "tags": ["@crud", "@navigation"], - "steps": [ - { - "action": "navigate", - "url": "/default/dashboard/users/test-user-123" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Look for breadcrumb", - "action": "expect", - "selector": "nav[aria-label*=\"breadcrumb\" i], .breadcrumb, [role=\"navigation\"]", - "assertion": { - "matcher": "toBeVisible" - } - } - ] - } - ] -} diff --git a/packages/pagination/playwright/tests.json b/packages/data_table/playwright/tests.json similarity index 100% rename from packages/pagination/playwright/tests.json rename to packages/data_table/playwright/tests.json diff --git a/packages/navigation/package.json b/packages/navigation/package.json deleted file mode 100644 index 4b24772bb..000000000 --- a/packages/navigation/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://metabuilder.dev/schemas/package-metadata.schema.json", - "packageId": "navigation", - "name": "Navigation Tests", - "version": "1.0.0", - "description": "Navigation and routing E2E tests", - "category": "testing", - "minLevel": 0, - "keywords": ["navigation", "routing", "tests"] -} diff --git a/packages/navigation/playwright/tests.json b/packages/navigation/playwright/tests.json deleted file mode 100644 index fc9784565..000000000 --- a/packages/navigation/playwright/tests.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "$schema": "https://metabuilder.dev/schemas/package-playwright.schema.json", - "package": "navigation", - "version": "1.0.0", - "description": "Navigation and routing E2E tests - converted from e2e/navigation.spec.ts", - "tests": [ - { - "name": "should navigate from homepage to key sections", - "tags": ["@navigation", "@routing"], - "steps": [ - { - "action": "navigate", - "url": "/" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Verify page has content", - "action": "expect", - "selector": "body", - "assertion": { - "matcher": "toBeVisible" - } - } - ] - }, - { - "name": "should have working navigation menu", - "tags": ["@navigation"], - "steps": [ - { - "action": "navigate", - "url": "/" - }, - { - "description": "Check for navigation element", - "action": "expect", - "selector": "nav, [role=\"navigation\"]", - "assertion": { - "matcher": "toBeVisible" - } - } - ] - }, - { - "name": "should handle 404 pages gracefully", - "tags": ["@navigation", "@error-handling"], - "steps": [ - { - "action": "navigate", - "url": "/this-page-does-not-exist-12345" - }, - { - "description": "Wait for page to load", - "action": "waitForLoadState", - "state": "domcontentloaded" - }, - { - "description": "Check for not found message", - "action": "expect", - "text": "not found", - "assertion": { - "matcher": "toBeVisible", - "timeout": 5000 - } - } - ] - }, - { - "name": "should have accessible navigation", - "tags": ["@navigation", "@accessibility"], - "steps": [ - { - "action": "navigate", - "url": "/" - }, - { - "description": "Check for main landmark", - "action": "expect", - "selector": "main, [role=\"main\"]", - "assertion": { - "matcher": "toBeVisible" - } - }, - { - "description": "Press Tab key for keyboard navigation", - "action": "press", - "key": "Tab" - } - ] - }, - { - "name": "should show mobile menu on small screens", - "tags": ["@navigation", "@responsive", "@mobile"], - "steps": [ - { - "description": "Set mobile viewport", - "action": "evaluate", - "script": "await page.setViewportSize({ width: 375, height: 667 })" - }, - { - "action": "navigate", - "url": "/" - }, - { - "action": "waitForLoadState", - "state": "networkidle" - }, - { - "description": "Verify navigation is present", - "action": "expect", - "selector": "[role=\"navigation\"], nav", - "assertion": { - "matcher": "toBeVisible" - } - } - ] - }, - { - "name": "should show desktop navigation on large screens", - "tags": ["@navigation", "@responsive", "@desktop"], - "steps": [ - { - "description": "Set desktop viewport", - "action": "evaluate", - "script": "await page.setViewportSize({ width: 1920, height: 1080 })" - }, - { - "action": "navigate", - "url": "/" - }, - { - "description": "Desktop navigation should be visible", - "action": "expect", - "selector": "nav, [role=\"navigation\"]", - "assertion": { - "matcher": "toBeVisible" - } - } - ] - } - ] -} diff --git a/packages/package_tests/playwright/tests.json b/packages/package_manager/playwright/tests.json similarity index 100% rename from packages/package_tests/playwright/tests.json rename to packages/package_manager/playwright/tests.json diff --git a/packages/package_tests/package.json b/packages/package_tests/package.json deleted file mode 100644 index 3cba8a829..000000000 --- a/packages/package_tests/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://metabuilder.dev/schemas/package-metadata.schema.json", - "packageId": "package_tests", - "name": "Package Tests", - "version": "1.0.0", - "description": "Package rendering and loading E2E tests", - "category": "testing", - "minLevel": 0, - "keywords": ["package", "rendering", "loading", "tests"] -} diff --git a/packages/pagination/package.json b/packages/pagination/package.json deleted file mode 100644 index 30d8fbda3..000000000 --- a/packages/pagination/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://metabuilder.dev/schemas/package-metadata.schema.json", - "packageId": "pagination", - "name": "Pagination Tests", - "version": "1.0.0", - "description": "Pagination components E2E tests", - "category": "testing", - "minLevel": 0, - "keywords": ["pagination", "tests", "ui"] -} diff --git a/packages/auth/playwright/tests.json b/packages/ui_auth/playwright/tests.json similarity index 100% rename from packages/auth/playwright/tests.json rename to packages/ui_auth/playwright/tests.json diff --git a/packages/ui_home/playwright/tests.json b/packages/ui_home/playwright/tests.json index 799dddf18..0b9ea65ab 100644 --- a/packages/ui_home/playwright/tests.json +++ b/packages/ui_home/playwright/tests.json @@ -24,7 +24,10 @@ { "name": "should load home page successfully", "description": "Verifies the home page loads with HTTP 200 and displays content", - "tags": ["@smoke", "@critical"], + "tags": [ + "@smoke", + "@critical" + ], "timeout": 10000, "steps": [ { @@ -51,7 +54,10 @@ { "name": "should display hero section with title and CTAs", "description": "Validates hero section renders with gradient title and action buttons", - "tags": ["@smoke", "@ui"], + "tags": [ + "@smoke", + "@ui" + ], "steps": [ { "action": "navigate", @@ -101,7 +107,11 @@ { "name": "should display six level feature cards", "description": "Validates the Six Levels of Power feature grid with all 6 level cards", - "tags": ["@smoke", "@ui", "@features"], + "tags": [ + "@smoke", + "@ui", + "@features" + ], "steps": [ { "action": "navigate", @@ -158,7 +168,10 @@ { "name": "should display navigation with Sign In and Admin buttons", "description": "Validates navigation bar with authentication links", - "tags": ["@smoke", "@navigation"], + "tags": [ + "@smoke", + "@navigation" + ], "steps": [ { "action": "navigate", @@ -199,7 +212,10 @@ { "name": "should display about section", "description": "Validates About MetaBuilder section content", - "tags": ["@ui", "@content"], + "tags": [ + "@ui", + "@content" + ], "steps": [ { "action": "navigate", @@ -231,7 +247,10 @@ { "name": "should display contact form", "description": "Validates contact section with form fields", - "tags": ["@ui", "@form"], + "tags": [ + "@ui", + "@form" + ], "steps": [ { "action": "navigate", @@ -303,7 +322,10 @@ { "name": "should have no critical console errors", "description": "Ensures page loads without JavaScript errors", - "tags": ["@smoke", "@critical"], + "tags": [ + "@smoke", + "@critical" + ], "steps": [ { "action": "navigate", @@ -326,7 +348,10 @@ { "name": "should navigate to sections via anchor links", "description": "Tests smooth scrolling to sections via navigation links", - "tags": ["@interaction", "@navigation"], + "tags": [ + "@interaction", + "@navigation" + ], "steps": [ { "action": "navigate", @@ -355,6 +380,166 @@ } } ] + }, + { + "name": "navigation_tests_merged", + "description": "Navigation tests from navigation package" + }, + { + "name": "should navigate from homepage to key sections", + "tags": [ + "@navigation", + "@routing" + ], + "steps": [ + { + "action": "navigate", + "url": "/" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Verify page has content", + "action": "expect", + "selector": "body", + "assertion": { + "matcher": "toBeVisible" + } + } + ] + }, + { + "name": "should have working navigation menu", + "tags": [ + "@navigation" + ], + "steps": [ + { + "action": "navigate", + "url": "/" + }, + { + "description": "Check for navigation element", + "action": "expect", + "selector": "nav, [role=\"navigation\"]", + "assertion": { + "matcher": "toBeVisible" + } + } + ] + }, + { + "name": "should handle 404 pages gracefully", + "tags": [ + "@navigation", + "@error-handling" + ], + "steps": [ + { + "action": "navigate", + "url": "/this-page-does-not-exist-12345" + }, + { + "description": "Wait for page to load", + "action": "waitForLoadState", + "state": "domcontentloaded" + }, + { + "description": "Check for not found message", + "action": "expect", + "text": "not found", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should have accessible navigation", + "tags": [ + "@navigation", + "@accessibility" + ], + "steps": [ + { + "action": "navigate", + "url": "/" + }, + { + "description": "Check for main landmark", + "action": "expect", + "selector": "main, [role=\"main\"]", + "assertion": { + "matcher": "toBeVisible" + } + }, + { + "description": "Press Tab key for keyboard navigation", + "action": "press", + "key": "Tab" + } + ] + }, + { + "name": "should show mobile menu on small screens", + "tags": [ + "@navigation", + "@responsive", + "@mobile" + ], + "steps": [ + { + "description": "Set mobile viewport", + "action": "evaluate", + "script": "await page.setViewportSize({ width: 375, height: 667 })" + }, + { + "action": "navigate", + "url": "/" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Verify navigation is present", + "action": "expect", + "selector": "[role=\"navigation\"], nav", + "assertion": { + "matcher": "toBeVisible" + } + } + ] + }, + { + "name": "should show desktop navigation on large screens", + "tags": [ + "@navigation", + "@responsive", + "@desktop" + ], + "steps": [ + { + "description": "Set desktop viewport", + "action": "evaluate", + "script": "await page.setViewportSize({ width: 1920, height: 1080 })" + }, + { + "action": "navigate", + "url": "/" + }, + { + "description": "Desktop navigation should be visible", + "action": "expect", + "selector": "nav, [role=\"navigation\"]", + "assertion": { + "matcher": "toBeVisible" + } + } + ] } ] } diff --git a/packages/user_manager/playwright/tests.json b/packages/user_manager/playwright/tests.json index 4332d248a..19f8c4236 100644 --- a/packages/user_manager/playwright/tests.json +++ b/packages/user_manager/playwright/tests.json @@ -1,25 +1,28 @@ { "$schema": "https://metabuilder.dev/schemas/package-playwright.schema.json", - "package": "user_manager", + "package": "crud", "version": "1.0.0", - "description": "E2E tests for user_manager package - validates user CRUD operations and admin workflows", + "description": "CRUD operations E2E tests - converted from e2e/crud.spec.ts, e2e/crud/user-management.spec.ts, and e2e/crud/complete-flow.spec.ts", "tests": [ { - "name": "should display user list", - "tags": ["@smoke", "@admin"], + "name": "should have landing page with navigation options", + "tags": ["@crud", "@interface"], "steps": [ { + "description": "Navigate to home page", "action": "navigate", - "url": "/admin/users" + "url": "/" }, { + "description": "Wait for page to load", "action": "waitForLoadState", "state": "domcontentloaded" }, { - "description": "Verify user table", + "description": "Verify sign in button is visible", "action": "expect", - "selector": ".user-table", + "role": "button", + "text": "sign in", "assertion": { "matcher": "toBeVisible" } @@ -27,43 +30,601 @@ ] }, { - "name": "should create new user", - "tags": ["@crud", "@admin"], + "name": "should navigate to login when clicking sign in", + "tags": ["@crud", "@navigation"], "steps": [ { "action": "navigate", - "url": "/admin/users" + "url": "/" }, { + "description": "Click sign in button", "action": "click", "role": "button", - "text": "Add User" + "text": "sign in" }, { - "action": "waitForSelector", - "selector": ".user-form" - }, - { - "description": "Fill username", - "action": "fill", - "selector": "input[name='username']", - "value": "testuser" - }, - { - "description": "Fill email", - "action": "fill", - "selector": "input[name='email']", - "value": "test@example.com" - }, - { - "action": "click", - "role": "button", - "text": "Save" - }, - { - "description": "Verify success message", + "description": "Verify username field appears", "action": "expect", - "text": "User created successfully", + "label": "username", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should have descriptive content on landing page", + "tags": ["@crud", "@content"], + "steps": [ + { + "action": "navigate", + "url": "/" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Check body has content", + "action": "expect", + "selector": "body", + "assertion": { + "matcher": "toBeVisible" + } + } + ] + }, + { + "name": "should have username and password fields in login", + "tags": ["@crud", "@login"], + "steps": [ + { + "action": "navigate", + "url": "/" + }, + { + "action": "click", + "role": "button", + "text": "sign in" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Check for username field", + "action": "expect", + "label": "username", + "assertion": { + "matcher": "toBeVisible" + } + }, + { + "description": "Check for password field", + "action": "expect", + "label": "password", + "assertion": { + "matcher": "toBeVisible" + } + } + ] + }, + { + "name": "should have submit button on login form", + "tags": ["@crud", "@login"], + "steps": [ + { + "action": "navigate", + "url": "/" + }, + { + "action": "click", + "role": "button", + "text": "sign in" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Check for login button", + "action": "expect", + "role": "button", + "text": "login", + "assertion": { + "matcher": "toBeVisible" + } + } + ] + }, + { + "name": "should display entity list", + "tags": ["@crud", "@list", "@flow"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Check if list view is visible", + "action": "expect", + "role": "heading", + "text": "list", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + }, + { + "description": "Check if table or list container exists", + "action": "expect", + "selector": "table, [role=\"table\"], .entity-list", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should have create button in entity list", + "tags": ["@crud", "@list"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Check for create/new button", + "action": "expect", + "role": "button", + "text": "create", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should navigate to create form", + "tags": ["@crud", "@create"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Click create button", + "action": "click", + "role": "button", + "text": "create" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Should see create form", + "action": "expect", + "role": "heading", + "text": "create", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should show form fields in create form", + "tags": ["@crud", "@create"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/create" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Should have at least one input field", + "action": "expect", + "selector": "input, textarea, select", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should have submit button in create form", + "tags": ["@crud", "@create"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/create" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Should have submit/save/create button", + "action": "expect", + "role": "button", + "text": "submit", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should show validation errors for empty required fields", + "tags": ["@crud", "@create", "@validation"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/create" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Try to submit without filling required fields", + "action": "click", + "role": "button", + "text": "submit" + }, + { + "description": "Should show validation error", + "action": "expect", + "text": "required", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should display entity details", + "tags": ["@crud", "@read"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/test-user-123" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Should show detail view", + "action": "expect", + "role": "heading", + "text": "detail", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should have edit button in detail view", + "tags": ["@crud", "@update"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/test-user-123" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Should have edit button", + "action": "expect", + "role": "button", + "text": "edit", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should have delete button in detail view", + "tags": ["@crud", "@delete"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/test-user-123" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Should have delete button", + "action": "expect", + "role": "button", + "text": "delete", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should show 404 for non-existent entity", + "tags": ["@crud", "@error-handling"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/non-existent-id-999" + }, + { + "action": "waitForLoadState", + "state": "domcontentloaded" + }, + { + "description": "Should show 404 or not found message", + "action": "expect", + "text": "not found", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should navigate to edit form", + "tags": ["@crud", "@update"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/test-user-123" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Click edit button", + "action": "click", + "role": "button", + "text": "edit" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Should see edit form", + "action": "expect", + "role": "heading", + "text": "edit", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should show pre-filled form fields in edit form", + "tags": ["@crud", "@update"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/test-user-123/edit" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Form fields should have values", + "action": "expect", + "selector": "input[type=\"text\"], input[type=\"email\"]", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should have update button in edit form", + "tags": ["@crud", "@update"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/test-user-123/edit" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Should have update/save button", + "action": "expect", + "role": "button", + "text": "update", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should show confirmation before delete", + "tags": ["@crud", "@delete"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/test-user-123" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Click delete button", + "action": "click", + "role": "button", + "text": "delete" + }, + { + "description": "Should show confirmation dialog", + "action": "expect", + "role": "button", + "text": "confirm", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should have cancel option in delete confirmation", + "tags": ["@crud", "@delete"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/test-user-123" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Click delete button", + "action": "click", + "role": "button", + "text": "delete" + }, + { + "description": "Should have cancel button", + "action": "expect", + "role": "button", + "text": "cancel", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should show pagination controls when list is large", + "tags": ["@crud", "@pagination"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Look for pagination controls", + "action": "expect", + "selector": "[role=\"navigation\"], .pagination, nav", + "assertion": { + "matcher": "toBeVisible" + } + } + ] + }, + { + "name": "should have filter/search input", + "tags": ["@crud", "@filter"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Look for search or filter input", + "action": "expect", + "selector": "input[type=\"search\"], input[placeholder*=\"search\" i]", + "assertion": { + "matcher": "toBeVisible" + } + } + ] + }, + { + "name": "should restrict access based on user level", + "tags": ["@crud", "@permissions"], + "steps": [ + { + "action": "navigate", + "url": "/default/admin/system_config" + }, + { + "action": "waitForLoadState", + "state": "domcontentloaded" + }, + { + "description": "Should see access denied or redirect to login", + "action": "expect", + "text": "access denied", + "assertion": { + "matcher": "toBeVisible", + "timeout": 5000 + } + } + ] + }, + { + "name": "should show breadcrumb trail on detail pages", + "tags": ["@crud", "@navigation"], + "steps": [ + { + "action": "navigate", + "url": "/default/dashboard/users/test-user-123" + }, + { + "action": "waitForLoadState", + "state": "networkidle" + }, + { + "description": "Look for breadcrumb", + "action": "expect", + "selector": "nav[aria-label*=\"breadcrumb\" i], .breadcrumb, [role=\"navigation\"]", "assertion": { "matcher": "toBeVisible" }