Update expectation for firefox

This commit is contained in:
Yury Semikhatsky 2024-05-17 09:38:16 -07:00
parent 1e6b5fc3f3
commit e9bb6da0ac

View file

@ -478,7 +478,7 @@ it('should intercept css variable with background url', async ({ page, server })
expect(interceptedRequests).toBe(1); expect(interceptedRequests).toBe(1);
}); });
it('continue should not change multipart/form-data body', async ({ page, server }) => { it('continue should not change multipart/form-data body', async ({ page, server, browserName }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/19158' }); it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/19158' });
await page.goto(server.EMPTY_PAGE); await page.goto(server.EMPTY_PAGE);
server.setRoute('/upload', (request, response) => { server.setRoute('/upload', (request, response) => {
@ -515,6 +515,8 @@ it('continue should not change multipart/form-data body', async ({ page, server
'------'].join('\r\n'); '------'].join('\r\n');
expect.soft((await reqBefore.postBody).toString('utf8')).toContain(fileContent); expect.soft((await reqBefore.postBody).toString('utf8')).toContain(fileContent);
expect.soft((await reqAfter.postBody).toString('utf8')).toContain(fileContent); expect.soft((await reqAfter.postBody).toString('utf8')).toContain(fileContent);
expect.soft(reqBefore.headers['content-length']).toBe('208'); // Firefox sends a bit longer boundary.
expect.soft(reqAfter.headers['content-length']).toBe('208'); const expectedLength = browserName === 'firefox' ? '246' : '208';
expect.soft(reqBefore.headers['content-length']).toBe(expectedLength);
expect.soft(reqAfter.headers['content-length']).toBe(expectedLength);
}); });