playwright
playwright copied to clipboard
[BUG] Unexpected behavior inside last statement of global setup/teardown function
Context:
- Playwright Version: [1.25.2]
- Operating System: [Windows]
- Node.js version: [14.17.5]
- Browser: [Chromium]
Code Snippet
I am using the default example.spec.js in my test folder. Below is my global-teardown.js and playwright.config.js in root folder.
//global-teardown.js
module.exports = () => {
console.log("Log 1")
console.log("Log 2")
console.log("Log 3")
};
//playwright.config.js
const { devices } = require('@playwright/test');
const config = {
globalTeardown: require.resolve('./global-teardown'),
testDir: './tests',
timeout: 30 * 1000,
expect: {
timeout: 5000
},
reporter: 'html',
use: {
actionTimeout: 0,
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
}
],
};
module.exports = config;
Describe the bug
Only the 1st two log statements are printing on the console. The last line is always getting skipped.

I can repro that the last line gets removed.
https://user-images.githubusercontent.com/17984549/190602893-ac65dc8b-cd0f-40fd-8583-a0298fd53f8f.mov
Why was this issue closed?
Thank you for your contribution to our project. This issue has been closed due to its limited upvotes and recent activity, and insufficient feedback for us to effectively act upon. Our priority is to focus on bugs that reflect higher user engagement and have actionable feedback, to ensure our bug database stays manageable.
Should you feel this closure was in error, please create a new issue and reference this one. We're open to revisiting it given increased support or additional clarity. Your understanding and cooperation are greatly appreciated.