Issue 1:
System info

Playwright Version: [v1.32.2]

Operating System: [Windows10]

Browser: [Chromium]

Other info: Teamcity

Config file

import type { PlaywrightTestConfig } from '@playwright/test';
import { devices } from '@playwright/test';

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

/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
testDir: './tests',
/* Maximum time one test can run for. */
timeout: 1200 * 1000,
/* Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. */
globalTimeout: 60 * 60 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 60000
},
/* 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. */
globalSetup: require.resolve('./global-setup'),
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: process.env.BaseUrl || 'http://localhost:54195/',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'retain-on-failure',
// Tell all tests to load signed-in state from 'storageState.json'.
storageState: 'storageState.json',
// Record a video for every test
video: 'off',
testIdAttribute: 'data-field'
},

/* 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: {
// channel: 'msedge',
// },
// },
// {
// name: 'Google Chrome',
// use: {
// channel: 'chrome',
// },
// },
],

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

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

export default config;

Steps

Run a test using Teamcity

test starts to run normally

[Describe expected behavior]

Actual

When running a single test using Teamcity I get a message that playwright is just installed and needs to download browsers. For some reason it looks for Chromium inside the Windows folder? I couldn't find anything about this in the playwright documentation. When I run the test without Teamcity it runs perfectly fine. I've tried setting PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers, but it still looks for Chromium in the windows directory.

[12:46:07 ](http://localhost:8111/buildConfiguration/Inx2283Playwright_Ci/412?buildTab=log&focusLine=13916&logView=linear&linesState=13916)Step 3/108: Install Playwright (Command Line)
[12:46:07 ](http://localhost:8111/buildConfiguration/Inx2283Playwright_Ci/412?buildTab=log&focusLine=13919&logView=linear&linesState=13919) Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script16450937878911554956.cmd
[12:46:07 ](http://localhost:8111/buildConfiguration/Inx2283Playwright_Ci/412?buildTab=log&focusLine=13920&logView=linear&linesState=13920) in directory: C:\TeamCity\buildAgent\work\4c9a3925e6c1abd3\playwright
[12:46:15 ](http://localhost:8111/buildConfiguration/Inx2283Playwright_Ci/412?buildTab=log&focusLine=13921&logView=linear&linesState=13921)
[12:46:15 ](http://localhost:8111/buildConfiguration/Inx2283Playwright_Ci/412?buildTab=log&focusLine=13922&logView=linear&linesState=13922) added 5 packages, and audited 6 packages in 5s
[12:46:15 ](http://localhost:8111/buildConfiguration/Inx2283Playwright_Ci/412?buildTab=log&focusLine=13923&logView=linear&linesState=13923)
[12:46:15 ](http://localhost:8111/buildConfiguration/Inx2283Playwright_Ci/412?buildTab=log&focusLine=13924&logView=linear&linesState=13924) found 0 vulnerabilities
[12:46:15 ](http://localhost:8111/buildConfiguration/Inx2283Playwright_Ci/412?buildTab=log&focusLine=13925&logView=linear&linesState=13925) Process exited with code 0

12:46:15 Step 4/108: Run playwright single test (Command Line)

12:46:15 Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script6789073163919943269.cmd

12:46:15 in directory: C:\TeamCity\buildAgent\work\4c9a3925e6c1abd3\playwright

12:46:17

12:46:17

12:46:17 [1A [2KError: browserType.launch: Executable doesn't exist at C:\windows\system32\config\systemprofile\pw-browsers\pw-browsers\chromium-1055\chrome-win\chrome.exe

12:46:17 â•”â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•—

12:46:17 â•‘ Looks like Playwright Test or Playwright was just installed or updated. â•‘

12:46:17 â•‘ Please run the following command to download new browsers: â•‘

12:46:17 â•‘ â•‘

12:46:17 â•‘ npx playwright install â•‘

12:46:17 â•‘ â•‘

12:46:17 â•‘ <3 Playwright Team â•‘

12:46:17 â•šâ•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�

12:46:17

12:46:17 at ..\global-setup.ts:6

12:46:17

12:46:17

12:46:17 [1A [2K

12:46:17 To open last HTML report run:

12:46:17

12:46:17 npx playwright show-report

12:46:17

12:46:17 Process exited with code 1

12:46:17 Process exited with code 1 (Step: Run playwright single test (Command Line))

12:46:17 Step Run playwright single test (Command Line) failed

Issue 2:
System info

Playwright Version: [v1.31.2]

Operating System: [All]

Browser: [Chromium ( maybe all )]

Other info:

Source code

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

Config file

// playwright.config.ts

trace: "retain-on-failure",

Test file (self-contained)

test.describe("Sample test", () => {
test('How to kill trace', async ({page}) => {
await page.goto('https://playwright.dev/');

await page.locator("[class*=github-btn] a]").click()
})
})

Steps

[Run the test]

test fails

open trace

Expected

trace opened, with errors from the console

Actual

blank screen in place of a trace, only after opening browser's console one could see a broken locator

index.f6c909e6.js:40 Error: Unexpected token "]" while parsing selector "[class*=github-btn] a]"
at h (index.f6c909e6.js:41:3984)
at A (index.f6c909e6.js:41:5695)
at M (index.f6c909e6.js:41:4966)
at S (index.f6c909e6.js:41:4664)
at T (index.f6c909e6.js:41:4572)
at HS (index.f6c909e6.js:41:5837)
at index.f6c909e6.js:41:6507
at Array.map (<anonymous>)
at W0 (index.f6c909e6.js:41:6383)
at B0 (index.f6c909e6.js:41:10836)
Cc @ index.f6c909e6.js:40
index.f6c909e6.js:41 Uncaught (in promise) Error: Unexpected token "]" while parsing selector "[class*=github-btn] a]"
at h (index.f6c909e6.js:41:3984)
at A (index.f6c909e6.js:41:5695)
at M (index.f6c909e6.js:41:4966)
at S (index.f6c909e6.js:41:4664)
at T (index.f6c909e6.js:41:4572)
at HS (index.f6c909e6.js:41:5837)
at index.f6c909e6.js:41:6507
at Array.map (<anonymous>)
at W0 (index.f6c909e6.js:41:6383)
at B0 (index.f6c909e6.js:41:10836)