fix(registry): Fix support for generic-linux (#13129)
Fixes https://github.com/microsoft/playwright/issues/13128
This commit is contained in:
parent
9420a53939
commit
be41c4a35d
|
|
@ -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'];
|
||||
|
|
|
|||
|
|
@ -192,7 +192,9 @@ it('should set playwright as user-agent', async ({ playwright, server, isWindows
|
|||
if (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');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue