Skip to content

Commit

Permalink
chore(chromium): allow passing --remote-debugging-port for debugging (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman authored Apr 19, 2020
1 parent 55b4bc9 commit 022bc67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/server/chromium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
8 changes: 4 additions & 4 deletions test/chromium/launcher.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}));
Expand Down

0 comments on commit 022bc67

Please sign in to comment.