Files
metabuilder/frontends/pastebin/tests/e2e/cross-platform.json
2026-03-09 22:30:41 +00:00

130 lines
5.5 KiB
JSON

{
"$schema": "../../../schemas/package-schemas/playwright.schema.json",
"package": "pastebin",
"version": "1.0.0",
"description": "Cross-platform consistency tests across viewports and interaction modes",
"suite": "Cross-Platform Consistency",
"tests": [
{
"name": "desktop navigation loads home",
"steps": [
{ "action": "navigate", "url": "" },
{ "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" } }
]
},
{
"name": "mobile navigation loads home",
"steps": [
{ "action": "setViewport", "width": 390, "height": 844 },
{ "action": "navigate", "url": "" },
{ "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" } }
]
},
{
"name": "settings page loads on desktop",
"steps": [
{ "action": "navigate", "url": "settings" },
{ "action": "waitForLoadState", "state": "domcontentloaded" },
{ "action": "waitForSelector", "selector": "[data-testid='settings-page']", "timeout": 10000 },
{ "action": "expect", "testId": "settings-page", "assertion": { "matcher": "toBeVisible" } }
]
},
{
"name": "settings page loads on mobile",
"steps": [
{ "action": "setViewport", "width": 390, "height": 844 },
{ "action": "navigate", "url": "settings" },
{ "action": "waitForLoadState", "state": "domcontentloaded" },
{ "action": "expect", "selector": "main,body", "assertion": { "matcher": "toBeVisible" } }
]
},
{
"name": "back/forward navigation works",
"steps": [
{ "action": "navigate", "url": "" },
{ "action": "waitForLoadState", "state": "domcontentloaded" },
{ "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": "form inputs visible on desktop",
"steps": [
{ "action": "navigate", "url": "settings" },
{ "action": "waitForLoadState", "state": "domcontentloaded" },
{ "action": "expect", "selector": "input,select,[role='textbox']", "nth": 0, "assertion": { "matcher": "toBeVisible" } }
]
},
{
"name": "form inputs visible on mobile",
"steps": [
{ "action": "setViewport", "width": 390, "height": 844 },
{ "action": "navigate", "url": "settings" },
{ "action": "waitForLoadState", "state": "domcontentloaded" },
{ "action": "expect", "selector": "input,select,[role='textbox']", "nth": 0, "assertion": { "matcher": "toBeVisible" } }
]
},
{
"name": "keyboard navigation works",
"steps": [
{ "action": "navigate", "url": "" },
{ "action": "waitForLoadState", "state": "domcontentloaded" },
{ "action": "keyboard", "keys": ["Tab"] },
{ "action": "keyboard", "keys": ["Tab"] },
{ "action": "keyboard", "keys": ["Enter"] }
]
},
{
"name": "buttons are clickable on desktop",
"steps": [
{ "action": "navigate", "url": "" },
{ "action": "waitForLoadState", "state": "domcontentloaded" },
{ "action": "expect", "selector": "button,[role='button']", "nth": 0, "assertion": { "matcher": "toBeVisible" } }
]
},
{
"name": "buttons are touchable on mobile",
"steps": [
{ "action": "setViewport", "width": 390, "height": 844 },
{ "action": "navigate", "url": "" },
{ "action": "waitForLoadState", "state": "domcontentloaded" },
{ "action": "expect", "selector": "button,[role='button']", "nth": 0, "assertion": { "matcher": "toBeVisible" } }
]
},
{
"name": "no horizontal scroll on mobile",
"steps": [
{ "action": "setViewport", "width": 390, "height": 844 },
{ "action": "navigate", "url": "" },
{ "action": "waitForLoadState", "state": "networkidle" },
{ "action": "evalExpect", "name": "hasHorizontalScroll", "args": { "selector": "body" }, "assertion": { "matcher": "toBeFalsy" } }
]
},
{
"name": "no horizontal scroll on desktop",
"steps": [
{ "action": "navigate", "url": "" },
{ "action": "waitForLoadState", "state": "networkidle" },
{ "action": "evalExpect", "name": "hasHorizontalScroll", "args": { "selector": "body" }, "assertion": { "matcher": "toBeFalsy" } }
]
},
{
"name": "network requests succeed on load",
"steps": [
{ "action": "hook", "name": "watchNetworkErrors" },
{ "action": "navigate", "url": "" },
{ "action": "waitForLoadState", "state": "networkidle" },
{ "action": "hook", "name": "assertNoNetworkErrors" }
]
}
]
}