mirror of
https://github.com/microsoft/playwright.git
synced 2024-10-06 09:27:31 +03:00
chore(chromium): allow passing --remote-debugging-port for debugging (#1857)
This commit is contained in:
parent
55b4bc99bd
commit
022bc67c07
@ -149,7 +149,7 @@ export class Chromium implements BrowserType<CRBrowser> {
|
||||
const userDataDirArg = args.find(arg => arg.startsWith('--user-data-dir'));
|
||||
if (userDataDirArg)
|
||||
throw new Error('Pass userDataDir parameter instead of specifying --user-data-dir argument');
|
||||
if (args.find(arg => arg.startsWith('--remote-debugging-')))
|
||||
if (args.find(arg => arg.startsWith('--remote-debugging-pipe')))
|
||||
throw new Error('Playwright manages remote debugging connection itself.');
|
||||
if (launchType !== 'persistent' && args.find(arg => !arg.startsWith('-')))
|
||||
throw new Error('Arguments can not specify page to be opened');
|
||||
|
@ -26,11 +26,11 @@ describe('launcher', function() {
|
||||
const error = await browserType.launchServer(options).catch(e => e);
|
||||
expect(error.message).toContain('Playwright manages remote debugging connection itself');
|
||||
});
|
||||
it('should throw with remote-debugging-port argument', async({browserType, defaultBrowserOptions}) => {
|
||||
it('should not throw with remote-debugging-port argument', async({browserType, defaultBrowserOptions}) => {
|
||||
const options = Object.assign({}, defaultBrowserOptions);
|
||||
options.args = ['--remote-debugging-port=9222'].concat(options.args || []);
|
||||
const error = await browserType.launchServer(options).catch(e => e);
|
||||
expect(error.message).toContain('Playwright manages remote debugging connection itself');
|
||||
options.args = ['--remote-debugging-port=0'].concat(options.args || []);
|
||||
const browser = await browserType.launchServer(options);
|
||||
await browser.close();
|
||||
});
|
||||
it('should open devtools when "devtools: true" option is given', async({browserType, defaultBrowserOptions}) => {
|
||||
const browser = await browserType.launch(Object.assign({devtools: true}, {...defaultBrowserOptions, headless: false}));
|
||||
|
Loading…
Reference in New Issue
Block a user