Issue 1:
System info

Playwright Version: [v1.36]

Operating System: [All, Windows 11, Ubuntu 20, macOS 13.2, etc.]

Browser: [All, Chromium, Firefox, WebKit]

Other info:

Source code

I provided exact source code that allows reproducing the issue locally.

Looks like global teardown takes about 30 sec, but test execution takes 1 sec. I took a simple test from CLI tools and added just the project to the config file.

Important to notice: if I execute by testMatch =/.*.spec.ts/, all work as required

https://github.com/AlexeyCL/Playwright-teardown

Link to the GitHub repository with the repro

[https://github.com/your_profile/playwright_issue_title]

or

Config file

// playwright.config.ts
import { PlaywrightTestConfig } from '@playwright/test';
/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
projects: [
{
name: 'test',
testMatch: '*tests/*.spec.ts',
},
],
testMatch: /.*.spec.ts/,

/* Maximum time one test can run for. */
timeout: 60 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 20000,
},
/* Run tests in files in parallel */
fullyParallel: !!process.env.CI,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 0 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 5 : 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [['list']],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
channel: process.env.DOCKER ? 'chromium' : 'chrome',
headless: !!process.env.CI,
viewport: { width: 1280, height: 720 },
ignoreHTTPSErrors: true,
baseURL: 'https://playwright.dev/',
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 30000,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'retain-on-failure',
video: 'retain-on-failure',

screenshot: 'only-on-failure',
},

/* Folder for test artifacts such as screenshots, videos, traces, etc. */
outputDir: 'test-results/',
};

export default config;

Test file (self-contained)

import { test, expect } from '@playwright/test';

test('has title', async ({ page }) => {
await page.goto('https://playwright.dev/');

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Playwright/);
});

test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');

// Click the get started link.
await page.getByRole('link', { name: 'Get started' }).click();

// Expects the URL to contain intro.
await expect(page).toHaveURL(/.*intro/);
});

Steps

[Run the test] pnpm run test

[...]

Expected

[Describe expected behavior]

Actual

[Describe actual behavior]

Issue 2:
System info

Playwright Version: v1.32.2

Operating System: Windows 10

Browser: Chromium

Other info:

Source code

I provided exact source code that allows reproducing the issue locally.

Config file

// playwright.config.ts
import {defineConfig} from "@playwright/test";

export default defineConfig({
timeout: 240000,
globalTimeout: 18000000,
projects: [
{
name: "Esro",
testDir: "./Tests/Esro",
timeout: 300001,
use:{
viewport: {width: 1870, height: 1030},
video: {
mode: "retain-on-failure",
size: {
width: 1870,
height: 1030,
},
},
}
},
{
name: "Tsro",
testDir: "./Tests/Tsro",
timeout: 180000,
},
{
name: 'Unify',
testDir: "./Tests/Unify",
},

{
name: "IntegrationsUI",
testDir: "./Tests/IntegrationsUI",
},

{
name: "Validation",
testMatch: 'Tests/Unify/Validation/test.list.ts',
timeout: 360000,
use: {
actionTimeout: 320000,
}
},
{
name: "Production",
testMatch: 'Tests/Unify/production.test.list.ts',
timeout: 360000,
use: {
actionTimeout: 320000,
}
},

],
reporter: [
["./my-reporter.ts"],
["list"],
["junit", { outputFile: "reports/test-results.xml" }],
["allure-playwright"],
["json", { outputFile: "reports/test-results.json" }],
["html", { open: "never" }],
],
use: {
baseURL: process.env.BASE_URL ? process.env.BASE_URL : process.env.LOCAL_HOST,
browserName: "chromium",
actionTimeout: 30000,
trace: "off",
screenshot: "on",
viewport: { width: 1400, height: 900 }, //UNIFY Recommended Resolution
video: {
mode: "retain-on-failure",
size: {
width: 1400,
height: 900,
},
},
contextOptions: {
ignoreHTTPSErrors: true,
},
// Browser options
launchOptions: {
channel: "chrome",
// headless: process.env.CI ? true : false,
slowMo: 200,
args: [
"--no-sandbox",
"--ignore-certificate-errors",
"--ignore-certificate-errors-skip-list",
],
},
},
});

Test file (self-contained)

//Tests\Unify\production.test.list.ts
import './Production/SellSubscriptionAndEventTicketWitoutCommitE2E.spec.ts';
import './Validation/EditCRMRecordViaSalesTab.spec.ts';
import './Validation/CreateAndEditCRMRecordValidationTest.spec.ts';
import './Validation/CheckForErrorsInMonitoringETL.spec.ts';

Steps

Add import of the spec files to the list

Try to run any test in the project

Expected

The tests will run as well.

Actual

I get the error related to the import of the spec files inside the list file

It worked as well with version 1.27.1, but it doesn't;t withe the newest version of 1.32.2.

I saw some similar bugs, but no none of them related to the syntax of the imports (maybe I've missed something?).

The output of the IDE: