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

Mochawesome context gets absolute paths instead of relative to Images #95

Closed
jpmschuler opened this issue Sep 9, 2021 · 1 comment
Closed

Comments

@jpmschuler
Copy link
Contributor

In order for the mocha awesome HTML report to be more helpful it would be nice if _addMochaContext https://github.com/codeceptjs/codeceptjs-resemblehelper/blob/master/index.js#L168 would supply relative paths to the images.As we (like most) probably run CI/CD the build artefacts are not viewed on the same system they are created, thus they won't be shown:
Bildschirmfoto 2021-09-10 um 01 05 55

Check the following Mochawesome report.json snippet (the report.html code is a mess, but looks similar):

   "context": "[
   \n  \"Base Image\",\n  \"/builds/project-management/myproject/tests/output/base/RCA-desktop.png\",
   \n  \"ScreenShot Image\",\n  \"/builds/project-management/myproject/tests/output/RCA-desktop.png\",
   \n  \"Diff Image\",\n  \"/builds/project-management/myproject/tests/output/diff/Diff_RCA-desktop.png\",
   \n  \"Screenshot_e693b747-f9a3-481a-8060-8ef6b6df1005.failed.png\"\n]",

The first 3 are generated by codecept-resemblehelper the last by ScreenShotOnFailure plugin. Thus it seems plausible that relative paths work.

(Don't have a fix, nor a MWE, nor a test yet, just found that as GitLab artefact view was broken)

@puneet0191
Copy link
Member

Thanks a lot, fixed with https://github.com/codeceptjs/codeceptjs-resemblehelper/releases/tag/v1.9.5

mirao added a commit to mirao/codeceptjs-resemblehelper that referenced this issue Oct 30, 2022
…aused by fix of codeceptjs#95

* Fixed UnhandledPromiseRejectionWarning (missing awaits)
* Updated TS definition using `npx -p typescript tsc index.js --declaration --allowJs --emitDeclarationOnly`
puneet0191 pushed a commit that referenced this issue Jan 2, 2023
…aused by fix of #95 (#119)

* Fixed UnhandledPromiseRejectionWarning (missing awaits)
* Updated TS definition using `npx -p typescript tsc index.js --declaration --allowJs --emitDeclarationOnly`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants