YOU54F / cypress-plugins

A home for various Cypress Plugins

Home Page:https://cypress-plugins.saf.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Multiple html reports found & cannot determine filename, omitting html report from message

ConstantineSF opened this issue · comments

Hi!
I'm facing with issue that slack message sends empty message in chanell because of those err messages
"Multiple html reports found & cannot determine filename, omitting html report from message
Cannot find test report, so sending build fail message
I have mochareports folder related to package.json
also here is my merge\marge commands - similar to what you suggesting in previous github issue
"combine-reports": "mochawesome-merge cypress/reports/*.json > mochareports/mochawesome.json",
"generate-report": "marge mochareports/mochawesome.json -f report -o mochareports"
"create-report": "npm run combine-reports && npm run generate-report"
image
tried to move mochareports folder to cypress folder - didn't get luck with that
any advice? thanks

Hey @rockthis13

Could you create an example on https://github.com/YOU54F/cypress-slack-reporter-issue for me please as it will help with investagation. What command are you passing to cypress slack reporter in npm run generate-report?

I am having the same issue. I have a "report.html" file in my mochareports directory, it's the only html file.
I run npx cypress-slack-reporter --ci-provider none
And I get the "multiple html" reports error.

Was there any progress on what happened with this, or how to resolve it?

I'm running on Windows and wondering if the way it deals with paths is different.

Was able to solve this. It indeed was a Windows issue. Globby does not work with backslashes, so had to change:
const reportHTMLFullPath = await globby(path.resolve(reportDir), {
to:
const reportHTMLFullPath = await globby(path.resolve(reportDir).replace(/\/g, '/'), {

I am using mac. I still have the same above issue. ran the following command
npx cypress-slack-reporter --ci-provider none

"msg":"Multiple html reports found & cannot determine filename, omitting html report from message"}
{"level":40,"time":1609995129149,"pid":51741,"hostname":"meghas-MacBook-Pro.local","msg":"Cannot find test report, so sending build fail message"}

report_json_—_cypress

Hey @rockthis13 , @jpalmer-miovision , @meghamanjunath2015,

Thanks for getting in touch. I've been off the OSS stuff for a while so catching up.

If this will solve for windows, we can determine the platform and the below for windows.

const reportHTMLFullPath = await globby(path.resolve(reportDir).replace(//g, '/'), {

I run on a mac. I think I have may have caused for regressions to existing behaviour, by moving to globby over my previous function. Will do some digging this week 👌🏽

@jpalmer-miovision the globby issue for windows should be fixed now in 1.1.1-alpha if you'd like to try

Have added a check for the windows platform which will conditionally escape the backslashes, good catch my friend.

    const videos = await globby(
      isWin
        ? path.resolve(process.cwd(), videosDir).replace(/\\/g, "/")
        : path.resolve(process.cwd(), videosDir),
      {
        expandDirectories: {
          files: ["*"],
          extensions: ["mp4"],
        },
      }
    );

so in #984 it was identified that I provided the same error message if no reports were found or if 2 or more were found! so that would have confused it somewhat.

If I can ask users to try 1.1.8-alpha

This may be sorted in v1.2.0, please let me know if not!

not working on mac.