You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fileId is calculated based only on the file path relative to its project's testDir. But projects can have different testDirs. This gives the same fileId to all files in all projects with the same path relative to their project "root".
It seems to me like using fileName instead of relativeFile as the argument to calculateSha1() would fix it. But I'm not sure what the significance is of the comment on line 247.
It's also possible to get the opposite problem if I add a third project in the above config like this:
Running tests for projects a and c causes the tests for project a and c to be listed under different file headers even though they're from the same file. I think this is less problematic.
Environment
System:
OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
Container: Yes
npmPackages:
@playwright/test: ^1.48.2 => 1.48.2
(Some info omitted because I don't think it's relevant.)
The text was updated successfully, but these errors were encountered:
Version
1.48.2
Steps to reproduce
playwright.config.ts
:Two identical files
tests/a/test.spec.ts
andtests/b/test.spec.ts
:Run the tests...
Expected behavior
Two passing tests under two separate file headers.
Actual behavior
Running those tests results in an HTML report that looks like this:
Both tests are listed under the same file header, even though they're from different files in different projects.
Additional context
I believe the problem is caused here:
playwright/packages/playwright/src/reporters/html.ts
Lines 246 to 249 in 33f9c82
The
fileId
is calculated based only on the file path relative to its project'stestDir
. But projects can have differenttestDir
s. This gives the samefileId
to all files in all projects with the same path relative to their project "root".It seems to me like using
fileName
instead ofrelativeFile
as the argument tocalculateSha1()
would fix it. But I'm not sure what the significance is of the comment on line 247.It's also possible to get the opposite problem if I add a third project in the above config like this:
Running tests for projects a and c causes the tests for project
a
andc
to be listed under different file headers even though they're from the same file. I think this is less problematic.Environment
The text was updated successfully, but these errors were encountered: