cypress-plugins icon indicating copy to clipboard operation
cypress-plugins copied to clipboard

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

Open ConstantineSF opened this issue 4 years ago • 9 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

ConstantineSF avatar Oct 06 '20 07:10 ConstantineSF

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?

YOU54F avatar Oct 09 '20 14:10 YOU54F

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.

jpalmer-miovision avatar Dec 07 '20 19:12 jpalmer-miovision

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, '/'), {

jpalmer-miovision avatar Dec 07 '20 20:12 jpalmer-miovision

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

meghamanjunath2015 avatar Jan 07 '21 04:01 meghamanjunath2015

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 👌🏽

YOU54F avatar Feb 22 '21 00:02 YOU54F

@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"],
        },
      }
    );

YOU54F avatar Mar 23 '21 02:03 YOU54F

so in https://github.com/YOU54F/cypress-slack-reporter/issues/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

YOU54F avatar Apr 12 '21 19:04 YOU54F

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

YOU54F avatar May 05 '21 18:05 YOU54F

not working on mac.

deepak-quo avatar Sep 01 '21 08:09 deepak-quo