diff --git a/lib/command/init.js b/lib/command/init.js index 310bdd27b..df1e2a4ab 100644 --- a/lib/command/init.js +++ b/lib/command/init.js @@ -55,6 +55,18 @@ module.exports = function() { } `; +const defaultActorTs = `// in this file you can append custom step methods to 'I' object + +export = function() { + return actor({ + + // Define custom steps here, use 'this' to access default methods of I. + // It is recommended to place a general 'login' function here. + + }); +} +`; + module.exports = function (initPath) { const testsPath = getTestRoot(initPath); @@ -188,7 +200,7 @@ module.exports = function (initPath) { // create steps file by default // no extra step file for typescript (as it doesn't match TS conventions) const stepFile = `./steps_file.${extension}`; - fs.writeFileSync(path.join(testsPath, stepFile), defaultActor); + fs.writeFileSync(path.join(testsPath, stepFile), extension === 'ts' ? defaultActorTs : defaultActor); config.include.I = isTypeScript === true ? './steps_file' : stepFile; print(`Steps file created at ${stepFile}`);