test(ui): the minimal form joins the accepted design's reference states
This commit is contained in:
1 parent
69bf4c7b81
commit
efb2d376f4
5 files changed
+2373
-1085
No files matched your search
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
|
||||
const all = JSON.parse(readFileSync(`${process.env.OUT_DIR ?? fileURLToPath(new URL("../../build/room-layout", import.meta.url))}/edges.json`, "utf8"));
|
||||
let failures = 0;
|
||||
for (const [name, e] of Object.entries(all)) {
|
||||
if (name.includes("workspace")) continue;
|
||||
if (name.includes("workspace") || name.includes("quick")) continue;
|
||||
const notes = [];
|
||||
const near = (label, a, b, tolerance = 1) => { if (a != null && b != null && Math.abs(a - b) > tolerance) notes.push(`${label}: ${a} vs ${b}`); };
|
||||
const phone = e.viewport[0] < 600;
|
||||
|
||||
@@ -30,7 +30,7 @@ const states = {
|
||||
};
|
||||
const share = [["click", "开始分享"], ["wait", 900], ["click", "分享窗口:Sketchbook"], ["wait", 1500]];
|
||||
const scenarios = [];
|
||||
const add = (name, layout, state, size, extra = {}) => scenarios.push({ name, url: `${base}${layout === "workspace" ? "" : `&layout=${layout}`}${states[state]}`, size: sizes[size], ...extra });
|
||||
const add = (name, layout, state, size, extra = {}) => scenarios.push({ name, url: `${base}${layout === "workspace" ? "" : `&layout=${layout}`}${states[state]}${extra.minimal ? "&minimal" : ""}`, size: sizes[size], ...extra });
|
||||
for (const size of [1360, 1024, 390]) for (const state of ["empty", "s1", "s2", "s4", "failed", "offline", "long"]) add(`${state}-${size}`, "living", state, size);
|
||||
for (const size of [1360, 390]) add(`own-${size}`, "living", "empty", size, { steps: share });
|
||||
add("s1-1600", "living", "s1", 1600); add("empty-1600", "living", "empty", 1600);
|
||||
@@ -66,6 +66,10 @@ add("t-overlay-escape", "living", "s1", 1360, { steps: [["click", list], ["wait"
|
||||
add("t-overlay-outside", "living", "s1", 1360, { steps: [["click", list], ["wait", 500], ["tap", 700, 300], ["wait", 400]] });
|
||||
add("t-overlay-again", "living", "s1", 1360, { steps: [["click", list], ["wait", 500], ["click", list], ["wait", 400]] });
|
||||
add("t-focus", "living", "s1", 1360, { steps: [["key", "Tab"], ["key", "Tab"], ["key", "Tab"], ["wait", 300]] });
|
||||
for (const state of ["empty", "s1", "s4"]) for (const size of [1360, "laptop"]) add(`min-${state}-${size}`, "living", state, size, { minimal: true });
|
||||
add("min-s1-1360-chat", "living", "s1", 1360, { minimal: true, steps: [["click", "聊天"], ["wait", 700]] });
|
||||
add("min-empty-1360-rooms", "living", "empty", 1360, { minimal: true, steps: [["click", "房间列表"], ["wait", 700]] });
|
||||
add("min-novoice-1360", "living", "empty", 1360, { minimal: true, steps: [["click", "退出语音"], ["wait", 700]] });
|
||||
add("voices-1360", "living", "voices", 1360);
|
||||
add("voices-s1-1360", "living", "voices1", 1360);
|
||||
add("voices-s1-fhd", "living", "voices1", "fhd");
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
cluster: cluster && { l: Math.round(cluster.l * 10) / 10, r: Math.round(cluster.r * 10) / 10, cx: Math.round((cluster.l + cluster.r) / 2 * 10) / 10 },
|
||||
tiles,
|
||||
controls: shell?.dataset.controls, head: shell?.dataset.head, rooms: shell?.dataset.rooms, pane: shell?.dataset.pane,
|
||||
lastTool: rect(document.querySelector(".c3-living-app .lr-btn .lr-cap") ?? [...document.querySelectorAll(".c3-room-tools .lr-btn svg")].filter(visible).pop()),
|
||||
lastTool: rect(document.querySelector(".c3-living-app .lr-btn .lr-cap") ?? [...document.querySelectorAll(".c3-site-bar .lr-btn svg")].filter(visible).pop()),
|
||||
couchText: Math.min(...[...document.querySelectorAll(".c3-couch .lr-pawn-name")].filter(visible).map(node => parseFloat(getComputedStyle(node).fontSize) * (node.currentCSSZoom ?? 1)), 99),
|
||||
toolSizes: [...new Set([...document.querySelectorAll(".c3-site-bar .lr-btn")].filter(visible).map(node => Math.round(node.getBoundingClientRect().height)))],
|
||||
homeMark: rect(".c3-site-home svg"), itemIcon: rect(".c3-room-link .c3-identity-mark"), itemName: rect(".c3-room-link strong"),
|
||||
|
||||
+2346
-1080
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user