Skip to content

[Bug]: 1.46.0 (TypeScript) - custom fixtures extend no longer chainable? #32056

@halljus

Description

@halljus

Version

1.46.0

Steps to reproduce

  1. Clone my repo at https://github.com/halljus/playwright-bug-repro (deleted now that issue is closed)
  2. Run npm install
  3. Run npm run typecheck
  4. Observe TypeScript errors that parameters passed to a test.extend that is a child of an extend without a generic type parameter are typed as any.

Expected behavior

I expect parameters passed to a child extend<MyFixtures> with a test.extend parent to be fully typed as they were prior to v1.46.0.

image

Actual behavior

As of v1.46.0, any extend<MyFixtures> with a generic type parameter that follow a parent test.extend without a generic type parameter will receive untyped arguments (they'll be of type any).

image

Additional context

I can "fix" this by moving the extend without the generic type parameter AFTER the extend<MyFixtures>, but a) it worked before, and b) I'm not sure if that's equivalent behavior.

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 13th Gen Intel(R) Core(TM) i5-1345U
    Memory: 39.83 GB / 63.64 GB
  Binaries:
    Node: 20.13.1 - ~\AppData\Local\nvs\default\node.EXE
    npm: 10.8.2 - ~\AppData\Local\nvs\default\npm.CMD
  IDEs:
    VSCode: 1.92.0 - C:\Users\user\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 5.1.16 - C:\WINDOWS\system32\bash.EXE
  npmPackages:
    @playwright/test: 1.46.0 => 1.46.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions