Issue 1:
System info

Playwright Version: 1.30.0

Operating System: windows 10

Browser: firefox, chromium

Source code

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

Config file

// playwright.config.ts
import type { PlaywrightTestConfig } from '@playwright/test'

const config: PlaywrightTestConfig = {
use: {
trace: 'on'
},
}

export default config

Test file (self-contained)

import { test } from '@playwright/test'

test('page loads', async ({ page }) => {
await page.goto('https://google.com')
await page.waitForSelector('/')
})

Steps

run test

run playwright show-trace with the path to the trace file or upload it to trace.playwright.dev

Expected

trace file loads, with some sort of handling on the step with the invalid selector

Actual

blank screen with errors in the console:

Uncaught (in promise) Error: Unexpected token "/" while parsing selector "/"

Issue 2:
System info

Playwright Version: v1.34.3

Operating System: Self hosted runner on GitHub Action

Browser: Firefox, WebKit

Other info: Only repro when chromium browser is not installed on the playwright instance

Source code

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

Config file

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

export default defineConfig({
projects: [
{
name: 'setup',
testMatch: /env.setup\.js/,
},
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], },
dependencies: ['setup']
},
{
name: 'firefox',
use: {	...devices['Desktop Firefox'], },
dependencies: ['setup']
},
{
name: 'webkit',
use: {	...devices['Desktop Safari'], },
dependencies: ['setup']
},
});

GitHub Actions with matrix setup

# Github Action file
name: Scheduled

on:
workflow_dispatch:

jobs:
UI-Tests:
runs-on: [self-hosted, AWS, Linux]
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
browser: ['chromium', 'firefox', 'webkit']
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
- name: Install Dependencies
run: npm ci
- name: Setup Playwright
run: npx playwright install ${{ matrix.browser }} --with-deps
- name: Run UI Tests
run: npx playwright test --project=${{ matrix.browser }}

Test file (self-contained)

// tests/env.setup.js
import { test, expect } from '@playwright/test';
test('has title', async ({ page }) => {
await page.goto('https://playwright.dev/');
await expect(page).toHaveTitle(/Playwright/);
});

// tests/get-link.test.js
import { test, expect } from '@playwright/test';
test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');
await page.getByRole('link', { name: 'Get started' }).click();
await expect(page).toHaveURL(/.*intro/);
});

Steps

Execute the tests using GitHub Action

Expected

Since the GitHub Action only installs the browser it requires for running the test, the set up file should run on the browser mentioned in project.

Actual

The setup file gets executed on chromium browser only, even though the specified browser can be firefox or webkit. Verified it in the headed mode on local as well. The reason we decided to not install all the browsers was because webkit required dependencies to install and use to take longer for each execution.