fix(test): missing test coverage for browserType.connectOverCDP (#5408)

This commit is contained in:
Joel Einbinder 2021-02-10 16:22:18 -08:00 committed by GitHub
parent 60e9216ebb
commit fa8e898c3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -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.');
});

View File

@ -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;