mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore(webdriver): don't swallow errors for session.new
(#12499)
This commit is contained in:
parent
e2e13eb4f0
commit
b3a26f0576
@ -7,7 +7,6 @@
|
|||||||
import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
|
import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
|
||||||
|
|
||||||
import {EventEmitter} from '../../common/EventEmitter.js';
|
import {EventEmitter} from '../../common/EventEmitter.js';
|
||||||
import {debugError} from '../../common/util.js';
|
|
||||||
import {
|
import {
|
||||||
bubble,
|
bubble,
|
||||||
inertIfDisposed,
|
inertIfDisposed,
|
||||||
@ -52,29 +51,9 @@ export class Session
|
|||||||
// throw new Error(status.message);
|
// throw new Error(status.message);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
let result;
|
const {result} = await connection.send('session.new', {
|
||||||
try {
|
|
||||||
result = (
|
|
||||||
await connection.send('session.new', {
|
|
||||||
capabilities,
|
capabilities,
|
||||||
})
|
});
|
||||||
).result;
|
|
||||||
} catch (err) {
|
|
||||||
// Chrome does not support session.new.
|
|
||||||
debugError(err);
|
|
||||||
result = {
|
|
||||||
sessionId: '',
|
|
||||||
capabilities: {
|
|
||||||
acceptInsecureCerts: false,
|
|
||||||
browserName: '',
|
|
||||||
browserVersion: '',
|
|
||||||
platformName: '',
|
|
||||||
setWindowRect: false,
|
|
||||||
webSocketUrl: '',
|
|
||||||
userAgent: '',
|
|
||||||
},
|
|
||||||
} satisfies Bidi.Session.NewResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
const session = new Session(connection, result);
|
const session = new Session(connection, result);
|
||||||
await session.#initialize();
|
await session.#initialize();
|
||||||
|
@ -1568,6 +1568,13 @@
|
|||||||
"expectations": ["SKIP"],
|
"expectations": ["SKIP"],
|
||||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"testIdPattern": "[fixtures.spec] Fixtures should close the browser when the node process closes",
|
||||||
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
"parameters": ["chrome", "webDriverBiDi"],
|
||||||
|
"expectations": ["FAIL"],
|
||||||
|
"comment": "The browser `disconnect` event is not emitted"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"testIdPattern": "[frame.spec] Frame specs Frame Management should click elements in a frameset",
|
"testIdPattern": "[frame.spec] Frame specs Frame Management should click elements in a frameset",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
@ -101,9 +101,10 @@ describe('Fixtures', function () {
|
|||||||
wsEndPointCallback(output.substring(0, output.indexOf('\n')));
|
wsEndPointCallback(output.substring(0, output.indexOf('\n')));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
using browser = await puppeteer.connect({
|
const connectOptions = Object.assign({}, defaultBrowserOptions, {
|
||||||
browserWSEndpoint: await wsEndPointPromise,
|
browserWSEndpoint: await wsEndPointPromise,
|
||||||
});
|
});
|
||||||
|
using browser = await puppeteer.connect(connectOptions);
|
||||||
const promises = [
|
const promises = [
|
||||||
waitEvent(browser, 'disconnected'),
|
waitEvent(browser, 'disconnected'),
|
||||||
new Promise(resolve => {
|
new Promise(resolve => {
|
||||||
|
Loading…
Reference in New Issue
Block a user