Whenever I run my tests, I keep encountering the error: TypeError: e.getContext is not a function
I am utilizing examples from https://github.com/cucumber/cucumber-js, making some modifications in world.js (to resolve timeout issues)
Application versions:
- node 4.2.6
- cucumber 0.9.4
- protractor 3.0.0
- protractor-cucumber-framework 0.3.3
- zombie 4.2.1
My world.js:
// features/support/world.js
var zombie = require('zombie');
zombie.waitDuration = '30s';
function World() {
this.browser = new zombie(); // this.browser will be available in step definitions
this.visit = function (url, callback) {
this.browser.visit(url, callback);
};
}
module.exports = function() {
this.World = World;
this.setDefaultTimeout(60 * 1000);
};
My sampleSteps.js:
// features/step_definitions/my_step_definitions.js
module.exports = function () {
...
// The content of sampleSteps.js goes here.
...
};
My sample.feature:
# features/my_feature.feature
Feature: Example feature
...
// The content of sample.feature goes here.
...
My protractor-conf.js:
exports.config = {
specs: [
'features/**/*.feature'
],
capabilities: {
'browserName': 'chrome'
},
baseUrl: 'http://127.0.0.1:8000/',
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
// relevant cucumber command line options
cucumberOpts: {
require: ['features/support/world.js', 'features/sampleSteps.js'],
format: "summary"
}
};