mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 21:53:35 +03:00
test: fix recorder downloads test (#5454)
This commit is contained in:
parent
3c877374c7
commit
0782b25272
@ -135,6 +135,11 @@ export class CodeGenerator {
|
||||
return;
|
||||
}
|
||||
if (this._lastAction && !this._lastAction.committed) {
|
||||
const signals = this._lastAction.action.signals;
|
||||
if (signal.name === 'navigation' && signals.length && signals[signals.length - 1].name === 'download')
|
||||
return;
|
||||
if (signal.name === 'download' && signals.length && signals[signals.length - 1].name === 'navigation')
|
||||
signals.length = signals.length - 1;
|
||||
this._lastAction.action.signals.push(signal);
|
||||
this._printAction(this._lastAction, true);
|
||||
return;
|
||||
|
@ -110,9 +110,7 @@ describe('cli codegen', (suite, { mode, browserName, headful }) => {
|
||||
await page.setInputFiles('input[type="file"]', []);`);
|
||||
});
|
||||
|
||||
it('should download files', (test, {browserName, headful}) => {
|
||||
test.fixme(browserName === 'webkit' || browserName === 'firefox', 'Generated page.waitForNavigation next to page.waitForEvent(download)');
|
||||
}, async ({ page, recorder, httpServer }) => {
|
||||
it('should download files', async ({ page, recorder, httpServer }) => {
|
||||
httpServer.setHandler((req: http.IncomingMessage, res: http.ServerResponse) => {
|
||||
const pathName = url.parse(req.url!).path;
|
||||
if (pathName === '/download') {
|
||||
|
Loading…
Reference in New Issue
Block a user