Skip to content

fix(plugin): stepByStepReport unique report folder #1744

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

Merged
merged 1 commit into from
Jun 30, 2019
Merged
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
7 changes: 4 additions & 3 deletions lib/plugin/stepByStepReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const fs = require('fs');
const path = require('path');
const figures = require('figures');
const colors = require('chalk');
const { template, clearString, deleteDir } = require('../utils');
const crypto = require('crypto');
const { template, deleteDir } = require('../utils');

const supportedHelpers = [
'WebDriverIO',
Expand Down Expand Up @@ -84,13 +85,13 @@ module.exports = function (config) {
let slides = {};
let error;
let savedStep = null;
const uuid = Math.floor(new Date().getTime() / 1000);
const recordedTests = {};
const pad = '0000';
const reportDir = config.output ? path.resolve(global.codecept_dir, config.output) : defaultConfig.output;

event.dispatcher.on(event.test.before, (test) => {
dir = path.join(reportDir, `record_${clearString(test.title).substring(0, 20)}_${uuid}`);
const md5hash = crypto.createHash('md5').update(test.file + test.title).digest('hex');
dir = path.join(reportDir, `record_${md5hash}`);
mkdirp.sync(dir);
stepNum = 0;
error = null;
Expand Down