mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 14:25:02 +00:00
130 lines
6.5 KiB
JSON
130 lines
6.5 KiB
JSON
{
|
|
"$schema": "../../../schemas/package-schemas/playwright.schema.json",
|
|
"package": "pastebin",
|
|
"version": "1.0.0",
|
|
"description": "Component rendering and interaction tests",
|
|
"suite": "Component Tests",
|
|
"tests": [
|
|
{
|
|
"name": "snippet manager renders without errors",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "hook", "name": "trackConsoleErrors" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='namespace-selector'],[data-testid='snippet-manager-loading']", "timeout": 10000 },
|
|
{ "action": "expect", "selector": "[data-testid='namespace-selector'],[data-testid='snippet-manager-loading']", "assertion": { "matcher": "toBeVisible" } },
|
|
{ "action": "hook", "name": "assertNoConsoleErrors" }
|
|
]
|
|
},
|
|
{
|
|
"name": "snippet toolbar buttons are present",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='namespace-selector'],[data-testid='snippet-manager-loading']", "timeout": 30000 },
|
|
{ "action": "expect", "testId": "snippet-toolbar", "assertion": { "matcher": "toBeVisible" }, "skipIf": { "selector": "[data-testid='snippet-toolbar']", "state": "hidden" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "snippet grid displays correctly",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='namespace-selector'],[data-testid='snippet-manager-loading']", "timeout": 30000 },
|
|
{ "action": "expect", "testId": "namespace-selector", "assertion": { "matcher": "toBeVisible" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "namespace selector renders",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "expect", "testId": "namespace-selector", "assertion": { "matcher": "toBeVisible" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "navigation links are present",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "expect", "testId": "navigation-toggle-btn", "assertion": { "matcher": "toBeVisible" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "settings navigation link works",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "click", "testId": "navigation-toggle-btn" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='nav-link--settings']", "timeout": 10000 },
|
|
{ "action": "click", "testId": "nav-link--settings" },
|
|
{ "action": "expect", "assertion": { "matcher": "toHaveURL", "url": "http://localhost/pastebin/settings" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "backend indicator is visible",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "expect", "testId": "backend-indicator", "assertion": { "matcher": "toBeVisible" }, "skipIf": { "selector": "[data-testid='backend-indicator']", "state": "hidden" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "app header renders",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "expect", "role": "banner", "assertion": { "matcher": "toBeVisible" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "main content area exists",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "expect", "role": "main", "assertion": { "matcher": "toBeVisible" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "empty state shows create button when no snippets",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='namespace-selector'],[data-testid='snippet-manager-loading']", "timeout": 30000 },
|
|
{ "action": "expect", "selector": "[data-testid='empty-state-create-menu'],[data-testid='snippet-grid']", "assertion": { "matcher": "toBeVisible" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "snippet dialog can be opened",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='namespace-selector'],[data-testid='snippet-manager-loading']", "timeout": 30000 },
|
|
{ "action": "click", "selector": "[data-testid='empty-state-create-menu'],[data-testid='snippet-create-menu-trigger']", "skipIf": { "selector": "[data-testid='empty-state-create-menu'],[data-testid='snippet-create-menu-trigger']", "state": "hidden" } },
|
|
{ "action": "expect", "testId": "snippet-dialog", "assertion": { "matcher": "toBeVisible" }, "skipIf": { "selector": "[data-testid='snippet-dialog']", "state": "hidden" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "snippet dialog can be closed with Escape",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='namespace-selector'],[data-testid='snippet-manager-loading']", "timeout": 30000 },
|
|
{ "action": "click", "selector": "[data-testid='empty-state-create-menu'],[data-testid='snippet-create-menu-trigger']", "skipIf": { "selector": "[data-testid='empty-state-create-menu'],[data-testid='snippet-create-menu-trigger']", "state": "hidden" } },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='snippet-dialog']", "timeout": 5000, "skipIf": { "selector": "[data-testid='snippet-dialog']", "state": "hidden" } },
|
|
{ "action": "press", "key": "Escape", "testId": "snippet-dialog", "skipIf": { "selector": "[data-testid='snippet-dialog']", "state": "hidden" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "settings page renders cards",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "settings" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "expect", "selector": "[class*='card'],[data-testid$='-card']", "nth": 0, "assertion": { "matcher": "toBeVisible" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "loading state resolves",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='namespace-selector'],[data-testid='snippet-manager-loading']", "timeout": 5000 },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='namespace-selector'],[data-testid='snippet-manager-redux']", "timeout": 30000 }
|
|
]
|
|
}
|
|
]
|
|
}
|