mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 06:14:59 +00:00
107 lines
5.0 KiB
JSON
107 lines
5.0 KiB
JSON
{
|
|
"$schema": "../../../schemas/package-schemas/playwright.schema.json",
|
|
"package": "pastebin",
|
|
"version": "1.0.0",
|
|
"description": "Core functionality tests for navigation, search, and page interactions",
|
|
"suite": "Core Functionality",
|
|
"tests": [
|
|
{
|
|
"name": "navigate to settings page",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "settings" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='settings-page']", "timeout": 8000 }
|
|
]
|
|
},
|
|
{
|
|
"name": "navigate back and forward works",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "settings" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "goBack" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "expect", "assertion": { "matcher": "toHaveURL", "url": "http://localhost/pastebin" } },
|
|
{ "action": "goForward" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "expect", "assertion": { "matcher": "toHaveURL", "url": "http://localhost/pastebin/settings" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "header logo is visible",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "waitForSelector", "selector": "header img,header .logo,[data-testid='logo-text']", "timeout": 5000 }
|
|
]
|
|
},
|
|
{
|
|
"name": "app bar is visible",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "expect", "role": "banner", "assertion": { "matcher": "toBeVisible" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "snippet manager displays on homepage",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='namespace-selector'],[data-testid='snippet-manager-loading']", "timeout": 30000 },
|
|
{ "action": "expect", "selector": "[data-testid='snippet-manager-redux'],[data-testid='empty-state-namespace-selector']", "assertion": { "matcher": "toBeVisible" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "search input is present and functional",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='snippet-search-input']", "timeout": 8000, "skipIf": { "selector": "[data-testid='snippet-search-input']", "state": "hidden" } },
|
|
{ "action": "expect", "testId": "snippet-search-input", "assertion": { "matcher": "toBeVisible" }, "skipIf": { "selector": "[data-testid='snippet-search-input']", "state": "hidden" } },
|
|
{ "action": "fill", "testId": "snippet-search-input", "value": "test query", "skipIf": { "selector": "[data-testid='snippet-search-input']", "state": "hidden" } },
|
|
{ "action": "expect", "testId": "snippet-search-input", "assertion": { "matcher": "toHaveValue", "value": "test query" }, "skipIf": { "selector": "[data-testid='snippet-search-input']", "state": "hidden" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "new snippet button works",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForLoadState", "state": "domcontentloaded" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='snippet-create-menu-trigger'],[data-testid='empty-state-create-menu']", "timeout": 10000 },
|
|
{ "action": "expect", "selector": "[data-testid='snippet-create-menu-trigger'],[data-testid='empty-state-create-menu']", "assertion": { "matcher": "toBeVisible" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "namespace selector is present",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "waitForSelector", "selector": "[data-testid='namespace-selector'],[data-testid='snippet-manager-loading']", "timeout": 15000 },
|
|
{ "action": "expect", "selector": "[data-testid='namespace-selector'],[data-testid='empty-state-namespace-selector']", "nth": 0, "assertion": { "matcher": "toBeVisible" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "no console errors on home page",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "" },
|
|
{ "action": "hook", "name": "trackConsoleErrors" },
|
|
{ "action": "waitForLoadState", "state": "networkidle" },
|
|
{ "action": "hook", "name": "assertNoConsoleErrors" }
|
|
]
|
|
},
|
|
{
|
|
"name": "page handles 404 routes gracefully",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "nonexistent-route-404xyz" },
|
|
{ "action": "waitForSelector", "selector": "body", "timeout": 5000 },
|
|
{ "action": "expect", "selector": "body", "assertion": { "matcher": "toBeVisible" } }
|
|
]
|
|
},
|
|
{
|
|
"name": "settings page loads without errors",
|
|
"steps": [
|
|
{ "action": "navigate", "url": "settings" },
|
|
{ "action": "hook", "name": "trackConsoleErrors" },
|
|
{ "action": "waitForLoadState", "state": "networkidle" },
|
|
{ "action": "hook", "name": "assertNoConsoleErrors" }
|
|
]
|
|
}
|
|
]
|
|
}
|