Issue 1:
System info

Playwright Version: [v1.35.1]

Operating System: [MacOS Ventura 13.4 (22F66)]

Browser: [All]

Other info:

Source code

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

Link to the GitHub repository with the repro

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

or

Config file

// @ts-check
const {defineConfig, devices} = require('@playwright/test');

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* 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 ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},
ignoreHTTPSErrors: true,
"ssl": {
"allowInsecure": true
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: {...devices['Desktop Chrome']},
},

{
name: 'firefox',
use: {...devices['Desktop Firefox']},
},

{
name: 'webkit',
use: {...devices['Desktop Safari']},
},

/* Test against mobile viewports. */
{
name: 'Mobile Chrome',
use: {...devices['Pixel 5']},
},

{
name: 'Mobile Safari',
use: {...devices['iPhone 12']},
},

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
{
name: 'Google Chrome',
use: {...devices['Desktop Chrome'], channel: 'chrome'},
},
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});

Test file (self-contained)

// @ts-check
const { test, expect } = require('@playwright/test');

test('Click Danzan Ryu', async ({ page }) => {
await page.goto('https://localhost:3000');
// await page.getByRole('link', { name: 'Danzan Ryu' }).click();
});

Steps

Start a web server locally on port 3000

[Run the test]

Expected

[Describe expected behavior]

The localhost:3000 link should open a test web page currently being served

Actual

[Describe actual behavior]

I get this error message:

page.goto: net::ERR_SSL_PROTOCOL_ERROR at https://localhost:3000/

=========================== logs ===========================

navigating to "https://localhost:3000/", waiting until "load"

Issue 2:
After moving the global setup and teardown function into different projects(see config below), the project setup and teardown do not trigger. I also tested it on another different project and still the same.

System info

Playwright Version: [v1.36]

Operating System: [macOS 13.2]

Browser: [All, Chromium, Firefox, WebKit]

Other info:

Source code

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

NOTE: A global.setup.ts and global.teardown.ts files are already created at the root directory.

Global teardown and setup works fine.

Link to the GitHub repository with the repro

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

or

Config file

// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* Maximum time one test can run for. */
timeout: 30 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 5000
},
/* Run tests in files in parallel */
fullyParallel: true,
/* 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 ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://localhost:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: 'setup',
testMatch:/global.setup\.ts/,
teardown: 'teardown',
},
{
name: 'teardown',
testMatch: /global.teardown\.ts/,
},
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
dependencies: ['setup']
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
dependencies: ['setup']

},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
dependencies: ['setup']
},
]
});

Test file (self-contained)

setup
async function globalSetup() {
console.log('setup');
}

export default globalSetup;

teardown
async function globalTeardown() {
console.log('Tear down')
}

export default globalTeardown;

Expected

The setup should run before each project with [setup] as dependencies

And teardown run after project test

Actual

Test starts immediately with setup and finishes without teardown