[BUG] Different behaviour in globalTear down when using PW recent versions
See original GitHub issueContext:
- Playwright Version: 1.20.1
- Operating System: Mac
- Node.js version: 14.6
- Browser: any
- Extra: [any specific details about your environment]
Code Snippet
async function globalSetup(config: FullConfig) {
console.log("Report path " + config.rootDir);
const reportPath = "./playwright-report";
console.log("Report path: " + reportPath);
var zip = new AdmZip();
zip.addLocalFolder(reportPath, "./playwrightReport");
zip.writeZip("./report.zip")
}
export default globalSetup;
Describe the bug
i have noticed that global tear down feature is working differently with the recent version >= 1.19, as with the newer version global teardown function is executed after the tests but not after the session itself, for example i need to zip the playwright-report folder after the execution, currently i can not do that since the teardown function will be executed after the test and before the report is being generated, playwright will wait for global tear down function to be executed then generate the report as shown below.
v 1.20.1

unlike the case with the previous version such as 1.17, the tear down function was being executed after the report is being generated which make more sense, except if it could be possible to make global tear down after worker, and global tear down after session
V 1.17

Issue Analytics
- State:
- Created a year ago
- Comments:8 (1 by maintainers)

Top Related StackOverflow Question
Awesome, thank you guys so much.
OnEnd event solved my issue, and thanks @vsravuri for the code snippet it helped me alot.
@amrsa1 Yes, Here is the code
playwright.config
custom reporter.js