Skip to content

[Bug]: Angular/Web component tests fail with .ts or .js as file extension #29544

Open
@sand4rt

Description

@sand4rt

Version

1.41.1

Steps to reproduce

  1. clone the repo chore: bump playwright to 1.41.1 sand4rt/playwright-ct-web#36
  2. run pnpm i
  3. run pnpm test

Expected behavior

the test should pass

Actual behavior

the tests fail

logs: https://github.com/sand4rt/playwright-ct-web/actions/runs/7943833528/job/21688654668?pr=36#step:8:68

Additional context

I'm unable to upgrade the Angular and web/lit component testing libraries from version v1.41.0 to v1.41.1 because the transform process was improved recently. The issue lies in the components not being transformed into refs. This occurs because Angular/Lit components are used as .ts files, while the transformation process in playwright-ct-core only handles non-JavaScript imports, as indicated here: https://github.com/microsoft/playwright/blob/main/packages/playwright-ct-core/src/tsxTransform.ts#L78

Is it an option to verify if the import is used within the mount() instead of verifying the file extension?

Related to #27783

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions