test: use custom browser binary for connnect tests (#22900)
Fixes https://github.com/microsoft/playwright/issues/22898
This commit is contained in:
parent
5e0574dc44
commit
1541206482
|
|
@ -20,7 +20,7 @@ import { createPlaywright, DispatcherConnection, RootDispatcher, PlaywrightDispa
|
|||
import { Browser } from '../server/browser';
|
||||
import { serverSideCallMetadata } from '../server/instrumentation';
|
||||
import { SocksProxy } from '../common/socksProxy';
|
||||
import { assert } from '../utils';
|
||||
import { assert, isUnderTest } from '../utils';
|
||||
import type { LaunchOptions } from '../server/types';
|
||||
import { AndroidDevice } from '../server/android/android';
|
||||
import { DebugControllerDispatcher } from '../server/dispatchers/debugControllerDispatcher';
|
||||
|
|
@ -272,7 +272,7 @@ function launchOptionsHash(options: LaunchOptions) {
|
|||
return JSON.stringify(copy);
|
||||
}
|
||||
|
||||
function filterLaunchOptions(options: LaunchOptions) {
|
||||
function filterLaunchOptions(options: LaunchOptions): LaunchOptions {
|
||||
return {
|
||||
channel: options.channel,
|
||||
args: options.args,
|
||||
|
|
@ -284,6 +284,7 @@ function filterLaunchOptions(options: LaunchOptions) {
|
|||
chromiumSandbox: options.chromiumSandbox,
|
||||
firefoxUserPrefs: options.firefoxUserPrefs,
|
||||
slowMo: options.slowMo,
|
||||
executablePath: isUnderTest() ? options.executablePath : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ export class RunServer implements PlaywrightServer {
|
|||
async _start(childProcess: CommonFixtures['childProcess']) {
|
||||
this._process = childProcess({
|
||||
command: ['node', path.join(__dirname, '..', '..', 'packages', 'playwright-core', 'lib', 'cli', 'cli.js'), 'run-server'],
|
||||
env: {
|
||||
...process.env,
|
||||
PWTEST_UNDER_TEST: '1',
|
||||
},
|
||||
});
|
||||
|
||||
let wsEndpointCallback;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,8 @@ it('should reject if launched browser fails immediately', async ({ mode, browser
|
|||
expect(waitError.message).toContain('== logs ==');
|
||||
});
|
||||
|
||||
it('should reject if executable path is invalid', async ({ browserType }) => {
|
||||
it('should reject if executable path is invalid', async ({ browserType, mode }) => {
|
||||
it.skip(mode === 'service', 'on service mode we dont allow passing custom executable path');
|
||||
let waitError = null;
|
||||
await browserType.launch({ executablePath: 'random-invalid-path' }).catch(e => waitError = e);
|
||||
expect(waitError.message).toContain('Failed to launch');
|
||||
|
|
|
|||
Loading…
Reference in a new issue