YOU54F / cypress-plugins

A home for various Cypress Plugins
https://cypress-plugins.saf.dev/
MIT License
168 stars 46 forks source link

report-dir appending to custom-url #1030

Closed simondib closed 6 months ago

simondib commented 3 years ago

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?

YOU54F commented 3 years ago

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

luisaangelicag commented 3 years ago

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?

simondib commented 3 years ago

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.

luisaangelicag commented 3 years ago

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

hassanzohaib commented 3 years ago

@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?

YOU54F commented 6 months ago

You can now pass --useOnlyCustomUrl thanks to @samixchoumi, which should resolve the issue in this thread.

https://github.com/YOU54F/cypress-plugins/issues/1216 https://github.com/YOU54F/cypress-plugins/pull/1219/files#diff-1ddde4170b088b40fad63f0c780e70d1dfc6f5cd6c4429c0c9e9cc671225647dR38