Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
fix(registry): Fix support for generic-linux (#13129)
Philip Sanetrabe41c4a35d81
diff --git a/packages/playwright-core/src/utils/registry.ts b/packages/playwright-core/src/utils/registry.tsindex 33cbd34c64..7d4e42dce4 100644--- a/packages/playwright-core/src/utils/registry.ts+++ b/packages/playwright-core/src/utils/registry.ts@@ -263,7 +263,7 @@ export class Registry {const descriptors = readDescriptors(browsersJSON);const findExecutablePath = (dir: string, name: keyof typeof EXECUTABLE_PATHS) => {let tokens = undefined;- if (hostPlatform.startsWith('ubuntu'))+ if (hostPlatform.startsWith('ubuntu') || hostPlatform.startsWith('generic-linux'))tokens = EXECUTABLE_PATHS[name]['linux'];else if (hostPlatform.startsWith('mac'))tokens = EXECUTABLE_PATHS[name]['mac'];diff --git a/tests/library/global-fetch.spec.ts b/tests/library/global-fetch.spec.tsindex e86a56bc92..8c1647a42a 100644--- a/tests/library/global-fetch.spec.ts+++ b/tests/library/global-fetch.spec.ts@@ -192,7 +192,9 @@ it('should set playwright as user-agent', async ({ playwright, server, isWindowsif (isWindows)expect(userAgentMasked).toBe('Playwright/X.X.X (<ARCH>; windows X.X) node/X.X');else if (isLinux)- expect(userAgentMasked).toBe('Playwright/X.X.X (<ARCH>; ubuntu X.X) node/X.X');+ // on ubuntu: distro is 'ubuntu' and version is 'X.X'+ // on manjaro: distro is 'Manjaro' and version is 'unknown'+ expect(userAgentMasked.replace(/<ARCH>; \w+ [^)]+/, '<ARCH>; distro version')).toBe('Playwright/X.X.X (<ARCH>; distro version) node/X.X');else if (isMac)expect(userAgentMasked).toBe('Playwright/X.X.X (<ARCH>; macOS X.X) node/X.X');});