feat: update desktop workflows and app center

This commit is contained in:
inman
2026-05-13 19:14:56 +08:00
parent 20b5aff4ad
commit 7c8781a6e3
160 changed files with 55492 additions and 1423 deletions

View File

@@ -0,0 +1,30 @@
import { describe, expect, it } from 'vitest';
import path from 'node:path';
import {
buildPlaywrightRuntimeEnv,
resolveYinianPlaywrightBrowsersPath,
resolveYinianPlaywrightInstallLockPath,
} from '@electron/utils/playwright-runtime';
describe('Playwright runtime env', () => {
it('uses an app-scoped browser cache and disables package-time browser downloads by default', () => {
const env = buildPlaywrightRuntimeEnv({});
expect(env.PLAYWRIGHT_BROWSERS_PATH).toBe(resolveYinianPlaywrightBrowsersPath());
expect(env.PLAYWRIGHT_BROWSERS_PATH).toContain(path.join('.openclaw', 'runtime', 'ms-playwright'));
expect(env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD).toBe('1');
expect(env.YINIAN_PLAYWRIGHT_INSTALL_LOCK_PATH).toBe(resolveYinianPlaywrightInstallLockPath());
});
it('preserves explicit caller-provided Playwright env overrides', () => {
const env = buildPlaywrightRuntimeEnv({
PLAYWRIGHT_BROWSERS_PATH: '/tmp/custom-browsers',
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '0',
YINIAN_PLAYWRIGHT_INSTALL_LOCK_PATH: '/tmp/custom.lock',
});
expect(env.PLAYWRIGHT_BROWSERS_PATH).toBe('/tmp/custom-browsers');
expect(env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD).toBe('0');
expect(env.YINIAN_PLAYWRIGHT_INSTALL_LOCK_PATH).toBe('/tmp/custom.lock');
});
});