Skip to content

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

Closed
@jpmschuler

Description

@jpmschuler

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions