fix: mochawesome helper with unique screenshots#4959
fix: mochawesome helper with unique screenshots#4959kobenguyent merged 4 commits intocodeceptjs:3.xfrom
Conversation
|
Could you please verify if the screenshot works correctly in reports? There was a previous issue with a broken screenshot link in reports, so it would be helpful to have a check. Thank you. The fix was: |
|
@kobenguyent - correct, it's now working for unique and non-unique screenshots. |
|
@Lando1n may you think we could add some UTs for those changes in https://github.com/codeceptjs/CodeceptJS/blob/3.x/test/unit/plugin/screenshotOnFail_test.js |
For sure, will add. |
|
@kobenguyent - added some tests, but they were reliant on a small Mochawesome helper modification in order to properly mock. |
|
@kobenguyent - any idea why mochawesome isn't a dependency already? Seeing that test failure. |
I guess we shall keep this mochawesome as dev-deps right @DavertMik ? |
There was a problem hiding this comment.
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Files not reviewed (1)
- package.json: Language not supported
Comments suppressed due to low confidence (1)
test/unit/plugin/screenshotOnFail_test.js:137
- Consider adding additional test cases that cover a broader range of configuration options and edge cases for unique screenshot naming to ensure consistent behavior across different scenarios.
// TODO: write more tests for different options
Just checked that it works well with |
|
OK, I incorporated changes from this task to my CodeceptJS project and then it works well - the screeenshot name in Mochawesome report matches the real name created in the output folder. So I guess the fix will be released in 3.7.4? |



Motivation/Description of the PR
Screenshots started to fail to link when using the
uniqueScreenshotName: truevalue on the Mochawesome helper.This is due to the uuid suffix being added with a different method than before. Instead of re-implementing the same
_getUUIDfunction, it was moved into the testToFileName function with optionunique.Applicable helpers:
Applicable plugins:
Type of change
Checklist:
npm run docs)npm run lint)npm test)