Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Incorrect display of Configuration Error message for the html reporter #28677

Closed
edumserrano opened this issue Dec 15, 2023 · 1 comment · Fixed by #30607
Closed

[BUG] Incorrect display of Configuration Error message for the html reporter #28677

edumserrano opened this issue Dec 15, 2023 · 1 comment · Fixed by #30607
Labels
open-to-a-pull-request The feature request looks good, we are open to reviewing a PR P3-collecting-feedback

Comments

@edumserrano
Copy link

edumserrano commented Dec 15, 2023

System info

  • Playwright Version: [v1.40.1]
  • Operating System: [Windows 10]
  • Browser: [All]
  • Other info:

Source code

Don't think it's needed for this but I'll gladly work on providing one if you think it is.

Steps

  1. Setup Playwright and add the html reporter as one of the reporters.
  2. Set Playwright's outputDir to test-results
  3. Set the list reporter outputFolder to test-results-html-report
  4. Run Playwright tests and you will see a Configuration Error message like:
Configuration Error: HTML reporter output folder clashes with the tests output folder:

html reporter folder: C:\dev\repos\github-personal\playwright-adventures\demos\code-coverage-with-istanbul-via-webpack-babel-plugin\test-results-html-report

test results folder: C:\dev\repos\github-personal\playwright-adventures\demos\code-coverage-with-istanbul-via-webpack-babel-plugin\test-results

Expected

No Configuration Error message should be displayed.

Actual

A Configuration Error message is displayed.

Notes

  • I believe that, as per the explanation that @mxschmitt gave in this comment, since the test-results-html-report directory is not a child of test-results directory then there shouldn't be any Configuration Error message.
  • I believe the problem is in this if condition:
if (outputFolder.startsWith(project.outputDir) || project.outputDir.startsWith(outputFolder)) {
...
}

Any folder that startsWith the same name as the tests output directory will be flagged, even if it's not a child folder.

@edumserrano edumserrano changed the title [BUG] [BUG] Incorrect display of Configuration Error message for the html reporter Dec 15, 2023
@mxschmitt mxschmitt added P3-collecting-feedback open-to-a-pull-request The feature request looks good, we are open to reviewing a PR labels Dec 15, 2023
@matthiasg
Copy link

As predicted here #14964 (comment) I also just stumbled over this issue.

The types are also a little confusing when one did not look through the entire source code. project.outputDir is not immediately a thing under the 'projects' so seeing what is matched against takes a little longer

georg-un pushed a commit to georg-un/playwright that referenced this issue Apr 30, 2024
When comparing outputDir and html-reporter outputFolder, we now make sure that both paths end with a forward-slash.

Fixes microsoft#28677
dgozman pushed a commit that referenced this issue May 2, 2024
When comparing `outputDir` and html-reporter `outputFolder`, we now make
sure that both paths end with a forward-slash.

Fixes #28677

---------

Co-authored-by: Georg Unterholzner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-to-a-pull-request The feature request looks good, we are open to reviewing a PR P3-collecting-feedback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants