-
-
Notifications
You must be signed in to change notification settings - Fork 736
fix: mochawesome helper with unique screenshots #4959
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
base: 3.x
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Motivation/Description of the PR
Screenshots started to fail to link when using the
uniqueScreenshotName: true
value 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
_getUUID
function, 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
)