Skip to content

Commit

Permalink
fix(test): missing test coverage for browserType.connectOverCDP (#5408)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelEinbinder committed Feb 11, 2021
1 parent 60e9216 commit fa8e898
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions test/browsertype-basic.spec.ts
Expand Up @@ -35,3 +35,9 @@ it('browserType.name should work', async ({browserType, isChromium, isFirefox, i
else
throw new Error('Unknown browser');
});
it('should throw when trying to connect with not-chromium', (test, {browserName}) => {
test.skip(browserName === 'chromium');
}, async ({browserType }) => {
const error = await browserType.connectOverCDP({wsEndpoint: 'foo'}).catch(e => e);
expect(error.message).toBe('Connecting over CDP is only supported in Chromium.');
});
2 changes: 1 addition & 1 deletion test/chromium/chromium.spec.ts
Expand Up @@ -91,7 +91,7 @@ describe('chromium', (suite, { browserName }) => {
expect(serverRequest.headers.intervention).toContain('feature/5718547946799104');
});

it('should connect to an existing cdp session 2', (test, {headful}) => {
it('should connect to an existing cdp session', (test, {headful}) => {
test.skip(headful, 'Chromium currently doesn\'t support --remote-debugging-port and --remote-debugging-pipe at the same time.');
}, async ({browserType, testWorkerIndex, browserOptions, createUserDataDir }) => {
const port = 9339 + testWorkerIndex;
Expand Down

0 comments on commit fa8e898

Please sign in to comment.