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

report-dir appending to custom-url

Open simondib opened this issue 3 years ago • 5 comments

Currently if I pass--report-dir it appends the path/filename to the --custom-url option. The problem I have is the report- dir folders are deployed to the root, so the folder structure doesn't exist on the environment and therefore the resulting link is broken.

If I don't pass report-dir then the reports aren't found.

Is there a workaround for this?

simondib avatar May 27 '21 14:05 simondib

Hey dude could you possibly provide some more context about your situation

here is some info on the custom url property, it’s meant to be a url and not a full path to the file location.

https://github.com/YOU54F/cypress-slack-reporter/issues/497#issuecomment-630514390

man these comments are old best tagging me for a quicker reply :) @simondib

YOU54F avatar Jul 22 '21 18:07 YOU54F

hey @YOU54F just jumped in here from the other open issue. i'm using the file location since i'm running the scripts locally too

npx cypress-slack-reporter --report-dir=cypress/reports/mochareports --ci-provider=custom --custom-url=cypress/reports/mochareports/report.html

image

is there a workaround as mentioned by @simondib to handle this?

luisaangelicag avatar Jul 22 '21 23:07 luisaangelicag

Sorry @YOU54F it's been a few months and I can't quite remember why this was an issue for me. Happy to close this or if @luisaangelicag considers it an issue still keep it open.

simondib avatar Jul 25 '21 06:07 simondib

feel free to close this one, i think mine's a separate issue :)

luisaangelicag avatar Jul 29 '21 06:07 luisaangelicag

@YOU54F this function: const buildHTMLReportURL = async ({ reportDir, artefactUrl, }) => { const reportHTMLFilename = await getHTMLReportFilename(reportDir); return buildUrl(artefactUrl, reportDir, reportHTMLFilename); }; add reportDir name with --custom-url. It makes my report link broken because I am using PublishHTML report plugin and it keeps reports somewhere else not in Artefacts. So any way to fix it?

hassanzohaib avatar Sep 17 '21 14:09 hassanzohaib