Issue 1:
System info

Playwright Version: v1.31

Operating System: All

Browser: All

Source code

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

Config file

Test file (self-contained)

import { test as base } from '@playwright/test';

export const test = base.extend<{ foo: never }>({
foo: [
async ({}, use) => {
// Some stuff here

await use(); // TS error: Expected 1 arguments, but got 0.

// Other stuff here
},
{ auto: true }
],
});

Expected

Allowing use to be called without arguments, as demonstrated in the docs under Automatic Fixtures.

Actual

Expected 1 arguments, but got 0.

Issue 2:
System info

Playwright Version: [v1.31.2]

Source code

I am having trouble with TS errors when trying to use parameterized projects following the the official documentation

Config file

import type { defineConfig } from '@playwright/test';
import { TestOptions } from './my-test';

export default defineConfig({
projects: [
{
name: 'alice',
use: { person: 'Alice' },
}
]
});

Test file (self-contained)

// my-test.ts
import { test as base } from '@playwright/test';

export type TestOptions = {
person: string;
};

export const test = base.extend<TestOptions>({
// Define an option and provide a default value.
// We can later override it in the config.
person: ['John', { option: true }],
});

// example.spec.ts
import { test } from './my-test';

test('test 1', async ({ person }) => {
console.log(person)
});

Steps

Open playwright.config.ts and notice the TypeScript error on defineConfig :

TS1361: 'defineConfig' cannot be used as a value because it was imported using 'import type'.

Run the test and notice the following error:

ReferenceError: defineConfig is not defined

Looking at other examples of Playwright documentation, it seems like that using the keyword type in the imports in playwright.config.ts is not necessary, so I remove that.

Now there is another TS error in playwright.config.ts on person: 'Alice':

No overload matches this call.
Overload 1 of 3, '(config: PlaywrightTestConfig<{}, {}>): PlaywrightTestConfig<{}, {}>', gave the following error.
Type '{ person: string; }' is not assignable to type 'UseOptions<PlaywrightTestOptions & CustomProperties<{}>, PlaywrightWorkerOptions & CustomProperties<{}>>'.
Object literal may only specify known properties, and 'person' does not exist in type 'UseOptions<PlaywrightTestOptions & CustomProperties<{}>, PlaywrightWorkerOptions & CustomProperties<{}>>'.
Overload 2 of 3, '(config: PlaywrightTestConfig<unknown, {}>): PlaywrightTestConfig<unknown, {}>', gave the following error.
Type '{ person: string; }' is not assignable to type 'UseOptions<PlaywrightTestOptions & CustomProperties<unknown>, PlaywrightWorkerOptions & CustomProperties<{}>>'.
Object literal may only specify known properties, and 'person' does not exist in type 'UseOptions<PlaywrightTestOptions & CustomProperties<unknown>, PlaywrightWorkerOptions & CustomProperties<{}>>'.
Overload 3 of 3, '(config: PlaywrightTestConfig<unknown, unknown>): PlaywrightTestConfig<unknown, unknown>', gave the following error.
Type '{ person: string; }' is not assignable to type 'UseOptions<PlaywrightTestOptions & CustomProperties<unknown>, PlaywrightWorkerOptions & CustomProperties<unknown>>'.

Try running the test again and notice that the parameterization is working, despite error in step 4.