Revert "fix(test runner): collect artifacts when calling `browser.close()` (#14797)" This reverts commitc7a28ac7e9. Looks like it broke a bunch of tracing tests: * Good: https://github.com/microsoft/playwright/runs/6838098316?check_suite_focus=true * First Bad: https://github.com/microsoft/playwright/runs/6838104691?check_suite_focus=true * Still bad on HEAD (88664c39c9): https://github.com/microsoft/playwright/runs/6868333846?check_suite_focus=true
This commit is contained in:
parent
26e22c9a89
commit
3974d1b359
|
|
@ -104,8 +104,6 @@ export class Browser extends ChannelOwner<channels.BrowserChannel> implements ap
|
||||||
|
|
||||||
async close(): Promise<void> {
|
async close(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
for (const context of this.contexts())
|
|
||||||
await this._browserType?._onWillCloseContext?.(context);
|
|
||||||
if (this._shouldCloseConnectionOnClose)
|
if (this._shouldCloseConnectionOnClose)
|
||||||
this._connection.close(kBrowserClosedError);
|
this._connection.close(kBrowserClosedError);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -241,27 +241,6 @@ test('should not override trace file in afterAll', async ({ runInlineTest, serve
|
||||||
expect(fs.existsSync(testInfo.outputPath('test-results', 'a-test-1', 'trace-1.zip'))).toBeTruthy();
|
expect(fs.existsSync(testInfo.outputPath('test-results', 'a-test-1', 'trace-1.zip'))).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should record trace on manual browser closure', async ({ runInlineTest }, testInfo) => {
|
|
||||||
const result = await runInlineTest({
|
|
||||||
'a.spec.ts': `
|
|
||||||
const { test } = pwt;
|
|
||||||
|
|
||||||
test.use({ trace: 'on' });
|
|
||||||
|
|
||||||
test.afterAll(async ({ browser }) => {
|
|
||||||
await browser.close();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('test 1', async ({ page }) => {
|
|
||||||
await page.goto('about:blank');
|
|
||||||
});
|
|
||||||
`,
|
|
||||||
}, { workers: 1 });
|
|
||||||
|
|
||||||
expect(result.exitCode).toBe(0);
|
|
||||||
expect(result.passed).toBe(1);
|
|
||||||
expect(fs.existsSync(testInfo.outputPath('test-results', 'a-test-1', 'trace.zip'))).toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
async function parseTrace(file: string): Promise<Map<string, Buffer>> {
|
async function parseTrace(file: string): Promise<Map<string, Buffer>> {
|
||||||
const zipFS = new ZipFileSystem(file);
|
const zipFS = new ZipFileSystem(file);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue