Skip to content

Commit

Permalink
fixed helpers creation by adding Helper class to global. Fixes codece…
Browse files Browse the repository at this point in the history
  • Loading branch information
DavertMik committed Jan 21, 2016
1 parent 6ac646b commit 3956daa
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
node_js:
- '4.2'
- '5.1'
- '5.2'
- '5.4'

sudo: required
dist: trusty
Expand Down
2 changes: 1 addition & 1 deletion docs/helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Generated Helper will be added to `codecept.json` config. It should look like th
```js
'use strict';

let Helper = require('codeceptjs/helper');
let Helper = codecept_helper;

class MyHelper extends Helper {

Expand Down
3 changes: 2 additions & 1 deletion lib/codecept.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class Codecept {
// preparing globals
global.codecept_dir = dir;
global.output_dir = fsPath.join(dir, this.config.output);
global.actor = require('./actor');
global.actor = global.codecept_actor = require('./actor');
global.codecept_helper = require('./helper');

// initializing listeners
container.create(this.config);
Expand Down
2 changes: 1 addition & 1 deletion lib/command/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ module.exports.pageObject = function (genPath, opts) {

let helperTemplate = `
'use strict';
let Helper = require('codeceptjs/helper');
let Helper = codecept_helper;
class {{name}} extends Helper {
Expand Down
1 change: 0 additions & 1 deletion lib/scenario.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ module.exports.injected = function (fn) {
* Starts promise chain, so helpers could enqueue their hooks
*/
module.exports.setup = function () {
console.log('setup');
recorder.start();
event.dispatcher.emit(event.test.before);
};
Expand Down

0 comments on commit 3956daa

Please sign in to comment.