chore: cleanup test logging on CI (#5848)

This commit is contained in:
Andrey Lushnikov 2021-03-16 17:25:59 -07:00 committed by GitHub
parent 8df4dcb0de
commit d1a3a5d589
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,49 +110,25 @@ it('should report downloads in downloadsPath folder', async ({downloadsBrowser,
});
it('should accept downloads in persistent context', async ({persistentDownloadsContext, testInfo, server}) => {
logOnCI('----- 1.1');
const page = persistentDownloadsContext.pages()[0];
logOnCI('----- 1.2');
const [ download ] = await Promise.all([
page.waitForEvent('download').then(d => {
logOnCI('----- 1.3');
return d;
}),
page.click('a').then(d => {
logOnCI('----- 1.4');
}),
page.waitForEvent('download'),
page.click('a'),
]);
logOnCI('----- 1.5');
expect(download.url()).toBe(`${server.PREFIX}/download`);
logOnCI('----- 1.6');
expect(download.suggestedFilename()).toBe(`file.txt`);
logOnCI('----- 1.7');
const path = await download.path();
logOnCI('----- 1.8');
expect(path.startsWith(testInfo.outputPath(''))).toBeTruthy();
logOnCI('----- 1.9');
});
it('should delete downloads when persistent context closes', async ({persistentDownloadsContext}) => {
logOnCI('----- 2.1');
const page = persistentDownloadsContext.pages()[0];
logOnCI('----- 2.2');
const [ download ] = await Promise.all([
page.waitForEvent('download').then(d => {
logOnCI('----- 2.3');
return d;
}),
page.click('a').then(() => {
logOnCI('----- 2.4');
}),
page.waitForEvent('download'),
page.click('a'),
]);
logOnCI('----- 2.5');
const path = await download.path();
logOnCI('----- 2.6');
expect(fs.existsSync(path)).toBeTruthy();
logOnCI('----- 2.7');
await persistentDownloadsContext.close();
logOnCI('----- 2.8');
expect(fs.existsSync(path)).toBeFalsy();
logOnCI('----- 2.9');
});