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