This is an automated email from the ASF dual-hosted git repository.

imbajin pushed a commit to branch feat/oink-core-platform
in repository https://gitbox.apache.org/repos/asf/hugegraph-doc.git

commit 474874ceeb8b3054912073b5d7702569f593c767
Author: dark <[email protected]>
AuthorDate: Fri Sep 4 21:12:35 2026 +0800

    test(visual): capture release interaction states
    
    - cover navigation, search, sidebar, and Community states
    - pair desktop and mobile routes across light and dark themes
    - keep all eight screenshots advisory and artifact-backed
---
 tests/e2e/visual.spec.js | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/tests/e2e/visual.spec.js b/tests/e2e/visual.spec.js
index 3f340fac8..a2d4534ac 100644
--- a/tests/e2e/visual.spec.js
+++ b/tests/e2e/visual.spec.js
@@ -3,13 +3,17 @@ const fs = require("node:fs");
 const path = require("node:path");
 
 const states = [
-  ["en-docs-desktop-light", "/docs/", { width: 1440, height: 900 }, "light"],
-  ["cn-docs-desktop-dark", "/cn/docs/", { width: 1440, height: 900 }, "dark"],
-  ["en-docs-mobile-light", "/docs/", { width: 390, height: 844 }, "light"],
-  ["cn-community-mobile-dark", "/cn/community/", { width: 320, height: 720 }, 
"dark"]
+  ["en-docs-desktop-light", "/docs/", { width: 1440, height: 900 }, "light", 
"default"],
+  ["cn-docs-desktop-dark", "/cn/docs/", { width: 1440, height: 900 }, "dark", 
"default"],
+  ["en-search-desktop-light", "/docs/", { width: 1440, height: 900 }, "light", 
"search"],
+  ["cn-search-mobile-dark", "/cn/docs/", { width: 390, height: 844 }, "dark", 
"search"],
+  ["en-sidebar-desktop-light", "/docs/introduction/", { width: 1440, height: 
900 }, "light", "collapse"],
+  ["cn-sidebar-mobile-dark", "/cn/docs/", { width: 390, height: 844 }, "dark", 
"drawer"],
+  ["en-community-desktop-light", "/community/", { width: 1440, height: 900 }, 
"light", "default"],
+  ["cn-community-mobile-dark", "/cn/community/", { width: 320, height: 720 }, 
"dark", "default"]
 ];
 
-for (const [name, url, viewport, theme] of states) {
+for (const [name, url, viewport, theme, state] of states) {
   test(`capture advisory ${name}`, async ({ page }) => {
     await page.setViewportSize(viewport);
     await page.addInitScript(
@@ -18,6 +22,17 @@ for (const [name, url, viewport, theme] of states) {
     );
     await page.goto(url);
     await expect(page.locator("body")).toBeVisible();
+    if (state === "search") {
+      await page.locator("[data-td-shell-search-open]").first().click();
+      await 
page.locator(".td-shell-search__input").fill(url.startsWith("/cn/") ? "服务端" : 
"server");
+      await expect(page.locator('[role="option"]').first()).toBeVisible();
+    } else if (state === "collapse") {
+      await page.locator(".td-shell-sidebar__collapse").click();
+      await 
expect(page.locator("#td-shell-sidebar")).toHaveAttribute("aria-hidden", 
"true");
+    } else if (state === "drawer") {
+      await page.locator("[data-td-shell-drawer-open]").click();
+      await 
expect(page.locator("html")).toHaveAttribute("data-td-shell-drawer", "open");
+    }
     const directory = path.join(__dirname, "visual-results");
     fs.mkdirSync(directory, { recursive: true });
     await page.screenshot({

Reply via email to