test: webkit linux fails to load application/octet-stream resource (#8424)

This commit is contained in:
Yury Semikhatsky 2021-08-24 17:34:29 -07:00 committed by GitHub
parent b188468fa4
commit a6740c852a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -35,6 +35,19 @@ it('should work', async ({page, server}) => {
expect(await page.evaluate(() => document.body.textContent)).toBe('Yo, page!');
});
it('should work with buffer as body', async ({page, server, browserName, isLinux}) => {
it.fail(browserName === 'webkit' && isLinux, 'Loading of application/octet-stream resource fails');
await page.route('**/*', route => {
route.fulfill({
status: 200,
body: Buffer.from('Yo, page!')
});
});
const response = await page.goto(server.EMPTY_PAGE);
expect(response.status()).toBe(200);
expect(await page.evaluate(() => document.body.textContent)).toBe('Yo, page!');
});
it('should work with status code 422', async ({page, server}) => {
await page.route('**/*', route => {
route.fulfill({

View File

@ -80,7 +80,6 @@ it('should override with defaults when intercepted response not provided', async
it('should fulfill with any response', async ({page, server, browserName, browserMajorVersion, isLinux}) => {
it.skip(browserName === 'chromium' && browserMajorVersion <= 91, 'Fails in Electron that uses old Chromium');
it.fail(browserName === 'webkit' && isLinux, 'Network.responseReceived comes twice');
server.setRoute('/sample', (req, res) => {
res.setHeader('foo', 'bar');
@ -95,6 +94,7 @@ it('should fulfill with any response', async ({page, server, browserName, browse
await route.fulfill({
_response: sampleResponse,
status: 201,
contentType: 'text/plain'
});
});
const response = await page.goto(server.EMPTY_PAGE);