feat: update desktop workflows and app center
This commit is contained in:
30
tests/unit/playwright-runtime.test.ts
Normal file
30
tests/unit/playwright-runtime.test.ts
Normal 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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user