Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/command/run-multiple.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function executeRun(runName, runConfig) {
if (browserConfig.outputName) {
outputDir += typeof browserConfig.outputName === 'function' ? browserConfig.outputName() : browserConfig.outputName;
} else {
const hash = crypto.createHash('md5');
const hash = crypto.createHash('sha256');
hash.update(JSON.stringify(browserConfig));
outputDir += hash.digest('hex');
}
Expand Down
4 changes: 2 additions & 2 deletions lib/plugin/stepByStepReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ module.exports = function (config) {
const reportDir = config.output ? path.resolve(global.codecept_dir, config.output) : defaultConfig.output;

event.dispatcher.on(event.test.before, (test) => {
const md5hash = crypto.createHash('md5').update(test.file + test.title).digest('hex');
dir = path.join(reportDir, `record_${md5hash}`);
const sha256hash = crypto.createHash('sha256').update(test.file + test.title).digest('hex');
dir = path.join(reportDir, `record_${sha256hash}`);
mkdirp.sync(dir);
stepNum = 0;
error = null;
Expand Down
4 changes: 2 additions & 2 deletions test/acceptance/session_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Scenario('screenshots reflect the current page of current session @Puppeteer @Pl
I.saveScreenshot('session_john_2.png');
});

const [default1Digest, default2Digest, john1Digest, john2Digest] = await I.getMD5Digests([
const [default1Digest, default2Digest, john1Digest, john2Digest] = await I.getSHA256Digests([
`${output_dir}/session_default_1.png`,
`${output_dir}/session_default_2.png`,
`${output_dir}/session_john_1.png`,
Expand Down Expand Up @@ -88,7 +88,7 @@ Scenario('should save screenshot for active session @WebDriverIO @Puppeteer @Pla

const fileName = clearString(this.title);

const [original, failed] = await I.getMD5Digests([
const [original, failed] = await I.getSHA256Digests([
`${output_dir}/original.png`,
`${output_dir}/${fileName}.failed.png`,
]);
Expand Down
4 changes: 2 additions & 2 deletions test/support/ScreenshotSessionHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class ScreenshotSessionHelper extends Helper {
this.outputPath = output_dir;
}

getMD5Digests(files = []) {
getSHA256Digests(files = []) {
const digests = [];

for (const file of files) {
const hash = crypto.createHash('md5');
const hash = crypto.createHash('sha256');
const data = fs.readFileSync(file);
hash.update(data);

Expand Down