Issue 1:
Getting error - Error: browserType.launch: spawn UNKNOWN when I try to execute example.spec.ts

I've the latest version of playwright and chrome browser

playwright version - 1.36.1

chrome version - 115.0.5790.110

System info

Playwright Version: [v1.XX]

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.

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';

export default defineConfig({
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], },
},
});

Test file (self-contained)

it('should check the box using setChecked', async ({ page }) => {
await page.setContent(`<input id='checkbox' type='checkbox'></input>`);
await page.getByRole('checkbox').check();
await expect(page.getByRole('checkbox')).toBeChecked();
});

Steps

[Run the test]

[...]

Expected

[Describe expected behavior]

Actual

[Describe actual behavior]

Issue 2:
When the first test file finished and the next test file starts the first test of the next test file always fails:

Having this workaround in the concerning test file:

//testfile.spec.ts
import { adminTest as test } from "fixtures/base";

test('DUMMY @LEVEL1', async ({ page }) => {
//Here nothing happens
})

test("The actual test @LEVEL1", async ({
page,
}, testInfo) => {
...
});

everything works fine.

System info

Playwright Version: v1.31

Operating System: Windows10

Browser: Chromium

Other info:

Source code

fixture

//base.ts

base.use({ baseURL: process.env.URL });
const authAdmin = process.env.AUTH_ADMIN;
export const adminTest = base.extend({
page: async ({ browser }, use) => {
const context = await browser.newContext({
storageState: authAdmin,
});
const page = await context.newPage();
await page.goto("");
await use(page);
},
});

Config file

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

// JUnit reporter config for Xray
const xrayOptions = {
// Whether to add <properties> with all annotations; default is false
embedAnnotationsAsProperties: true,

// By default, annotation is reported as <property name='' value=''>.
// These annotations are reported as <property name=''>value</property>.
textContentAnnotations: ["test_description"],

// This will create a "testrun_evidence" property that contains all attachments. Each attachment is added as an inner <item> element.
// Disables [[ATTACHMENT|path]] in the <system-out>.

//Issue bzgl. Daten-Typen, siehe https://github.com/microsoft/playwright/issues/22396
embedAttachmentsAsProperty: "testrun_evidence",

// Where to put the report.
outputFile: "./test-results/xray-report.xml",
};

export default defineConfig({
testDir: "./tests",
grepInvert: /@TODO/,
timeout: 60 * 1000,
expect: {
timeout: 5000,
},
fullyParallel: false,
retries: 0,
workers: 1,
reporter: [
["html", { open: "on-failure" }],
["list", { printSteps: true }],
["junit", xrayOptions],
],

use: {
actionTimeout: 0,
trace: "retain-on-failure",
video: "retain-on-failure",
screenshot: "only-on-failure",
headless: true,
locale: "de-DE",
timezoneId: "Europe/Berlin",
},

projects: [
{ name: "setup", testMatch: /.*\.setup\.spec.ts/ },
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
dependencies: ["setup"],
},
],
});