mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: rework test expectations (#11824)
This commit is contained in:
parent
8a6557c94b
commit
8d7d9f1f05
@ -98,6 +98,15 @@ export class TestServer {
|
||||
// Disable this as sometimes the socket will timeout
|
||||
// We rely on the fact that we will close the server at the end
|
||||
this.#server.keepAliveTimeout = 0;
|
||||
this.#server.on('clientError', err => {
|
||||
if (
|
||||
'code' in err &&
|
||||
err.code === 'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN'
|
||||
) {
|
||||
return;
|
||||
}
|
||||
console.error('test-server client error', err);
|
||||
});
|
||||
this.#wsServer = new WebSocketServer({server: this.#server});
|
||||
this.#wsServer.on('connection', this.#onWebSocketConnection);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -590,28 +590,6 @@ describe('Launcher specs', function () {
|
||||
});
|
||||
expect(error.message).toContain('either pipe or debugging port');
|
||||
});
|
||||
it('should launch Chrome properly with --no-startup-window and waitForInitialPage=false', async () => {
|
||||
const {defaultBrowserOptions} = await getTestState({
|
||||
skipLaunch: true,
|
||||
});
|
||||
const options = {
|
||||
waitForInitialPage: false,
|
||||
// This is needed to prevent Puppeteer from adding an initial blank page.
|
||||
// See also https://github.com/puppeteer/puppeteer/blob/ad6b736039436fcc5c0a262e5b575aa041427be3/src/node/Launcher.ts#L200
|
||||
ignoreDefaultArgs: true,
|
||||
...defaultBrowserOptions,
|
||||
args: ['--no-startup-window'],
|
||||
};
|
||||
const {browser, close} = await launch(options, {
|
||||
createContext: false,
|
||||
});
|
||||
try {
|
||||
const pages = await browser.pages();
|
||||
expect(pages).toHaveLength(0);
|
||||
} finally {
|
||||
await close();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('Puppeteer.launch', function () {
|
||||
|
Loading…
Reference in New Issue
Block a user