在cucumber-js 页面中显示了一个带有 Zombie 的示例:
// features/support/world.js
var zombie = require('zombie');
var WorldConstructor = function WorldConstructor(callback) {
var browser = new zombie();
var world = {
browser: browser, // this.browser will be available in step definitions
visit: function(url, callback) { // this.visit will be available in step definitions
this.browser.visit(url, callback);
}
};
callback(world); // tell Cucumber we're finished and to use our world object instead of 'this'
};
exports.World = WorldConstructor;
可以使用 Phantomjs 代替 Zombie 吗?
有人可以给我看一个 world.js 的例子吗?
谢谢。