惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
The GitHub Blog
The GitHub Blog
小众软件
小众软件
美团技术团队
博客园 - 司徒正美
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
大猫的无限游戏
大猫的无限游戏
罗磊的独立博客
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
D
Docker
J
Java Code Geeks
Last Week in AI
Last Week in AI
V
Visual Studio Blog
Microsoft Azure Blog
Microsoft Azure Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
V
V2EX
C
Check Point Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(qa): launch control ui flows with runnable chromium ·...
vincentkoc · 2026-06-24 · via Recent Commits to openclaw:main
11

// Qa Lab tests cover web runtime plugin behavior.

22

import { MAX_TIMER_TIMEOUT_MS } from "openclaw/plugin-sdk/number-runtime";

3-

import { beforeEach, describe, expect, it, vi } from "vitest";

3+

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

4455

const {

66

bodyLocator,

77

browserClose,

88

contextClose,

99

contextNewPage,

10+

existsSync,

1011

goto,

1112

launch,

1213

locatorFill,

@@ -17,6 +18,7 @@ const {

1718

pageUrl,

1819

pageWaitForFunction,

1920

pageWaitForSelector,

21+

spawnSync,

2022

} = vi.hoisted(() => ({

2123

bodyLocator: {

2224

waitFor: vi.fn(async () => undefined),

@@ -25,6 +27,7 @@ const {

2527

browserClose: vi.fn(async () => undefined),

2628

contextClose: vi.fn(async () => undefined),

2729

contextNewPage: vi.fn(),

30+

existsSync: vi.fn((_candidate: unknown) => false),

2831

goto: vi.fn(async () => undefined),

2932

launch: vi.fn(),

3033

locatorFill: vi.fn(async () => undefined),

@@ -35,6 +38,16 @@ const {

3538

pageUrl: vi.fn(() => "http://127.0.0.1:3000/chat"),

3639

pageWaitForFunction: vi.fn(async () => undefined),

3740

pageWaitForSelector: vi.fn(async () => undefined),

41+

spawnSync: vi.fn(() => ({ status: 0 })),

42+

}));

43+44+

vi.mock("node:child_process", () => ({

45+

spawnSync,

46+

}));

47+48+

vi.mock("node:fs", async (importOriginal) => ({

49+

...(await importOriginal<typeof import("node:fs")>()),

50+

existsSync,

3851

}));

39524053

vi.mock("playwright-core", () => ({

@@ -85,6 +98,12 @@ beforeEach(async () => {

8598

contextNewPage.mockResolvedValue(page);

8699

launch.mockResolvedValue(browser);

87100

vi.clearAllMocks();

101+

existsSync.mockReturnValue(false);

102+

spawnSync.mockReturnValue({ status: 0 });

103+

});

104+105+

afterEach(() => {

106+

vi.unstubAllEnvs();

88107

});

8910890109

function requireLaunchOptions() {

@@ -116,7 +135,13 @@ describe("qa web runtime", () => {

116135

await closeQaWebSessions();

117136118137

const launchOptions = requireLaunchOptions();

119-

expect(launchOptions?.channel).toBe("chrome");

138+

expect(spawnSync).toHaveBeenCalledWith(

139+

process.execPath,

140+

["scripts/ensure-playwright-chromium.mjs", "--skip-ffmpeg"],

141+

expect.objectContaining({ cwd: process.cwd(), stdio: "inherit" }),

142+

);

143+

expect(launchOptions?.channel).toBeUndefined();

144+

expect(launchOptions?.executablePath).toBeUndefined();

120145

expect(launchOptions?.headless).toBe(true);

121146

expect(goto).toHaveBeenCalledWith("http://127.0.0.1:3000/chat", {

122147

waitUntil: "domcontentloaded",

@@ -132,6 +157,44 @@ describe("qa web runtime", () => {

132157

expect(browserClose).toHaveBeenCalledTimes(1);

133158

});

134159160+

it("launches an explicit Chromium executable override when configured", async () => {

161+

vi.stubEnv("PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH", "/custom/chromium");

162+

existsSync.mockImplementation((candidate) => candidate === "/custom/chromium");

163+164+

await qaWebOpenPage({ url: "http://127.0.0.1:3000/chat" });

165+166+

const launchOptions = requireLaunchOptions();

167+

expect(spawnSync).toHaveBeenCalledWith("/custom/chromium", ["--version"], {

168+

stdio: "ignore",

169+

});

170+

expect(launchOptions?.channel).toBeUndefined();

171+

expect(launchOptions?.executablePath).toBe("/custom/chromium");

172+

await closeQaWebSessions();

173+

});

174+175+

it("launches detected system Chromium without requiring branded Chrome", async () => {

176+

existsSync.mockImplementation((candidate) => candidate === "/usr/bin/chromium");

177+178+

await qaWebOpenPage({ url: "http://127.0.0.1:3000/chat" });

179+180+

const launchOptions = requireLaunchOptions();

181+

expect(spawnSync).toHaveBeenCalledWith("/usr/bin/chromium", ["--version"], {

182+

stdio: "ignore",

183+

});

184+

expect(launchOptions?.channel).toBeUndefined();

185+

expect(launchOptions?.executablePath).toBe("/usr/bin/chromium");

186+

await closeQaWebSessions();

187+

});

188+189+

it("keeps an explicit browser channel request explicit", async () => {

190+

await qaWebOpenPage({ url: "http://127.0.0.1:3000/chat", channel: "chrome" });

191+192+

const launchOptions = requireLaunchOptions();

193+

expect(launchOptions?.channel).toBe("chrome");

194+

expect(launchOptions?.executablePath).toBeUndefined();

195+

await closeQaWebSessions();

196+

});

197+135198

it("can close only selected page sessions", async () => {

136199

const first = await qaWebOpenPage({ url: "http://127.0.0.1:3000/one" });

137200

const second = await qaWebOpenPage({ url: "http://127.0.0.1:3000/two" });