test: fix service tests (#22111)

<img width="805" alt="image"
src="https://user-images.githubusercontent.com/17984549/229117984-1c70541b-7941-40e2-950d-a699e0fc4cc4.png">
This commit is contained in:
Max Schmitt 2023-03-31 19:58:08 +02:00 committed by GitHub
parent a95ced0fef
commit 47c669caf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -300,9 +300,7 @@ it('should throw if networkidle2 is passed as an option', async ({ page, server
it('should fail when main resources failed to load', async ({ page, browserName, isWindows, mode }) => {
let error = null;
await page.goto('http://localhost:44123/non-existing-url').catch(e => error = e);
if (mode === 'service')
expect(error.message).toContain('net::ERR_SOCKS_CONNECTION_FAILED');
else if (browserName === 'chromium')
if (browserName === 'chromium')
expect(error.message).toContain('net::ERR_CONNECTION_REFUSED');
else if (browserName === 'webkit' && isWindows)
expect(error.message).toContain(`Couldn\'t connect to server`);