No tengo suficientes puntos para agregar un comentario a @jbpros respuesta, pero debe tener en cuenta que Scenario Outlines ahora se completan en cucumber.js como se indica here.
Por ejemplo:
Mundial:
// features/support/world.js
var zombie = require('zombie');
var World = function World(callback) {
this.browser = new zombie(); // this.browser will be available in step definitions
this.visit = function(url, callback) {
this.browser.visit(url, callback);
};
callback(); // tell Cucumber we're finished and to use 'this' as the world instance
};
exports.World = World;
Característica:
Scenario Outline: eating
Given there are <start> cucumbers
When I eat <eat> cucumbers
Then I should have <left> cucumbers
Examples:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |
| 200 | 65 | 135 |
| 200 | 5 | 194 |
Pasos Definición:
var aTest = function() {
this.World = require("../support/world.js").World;
this.start = 0;
this.eat = 0;
this.Given(/^there are (\d+) cucumbers$/, function(number, next) {
this.start = parseInt(number);
callback();
});
this.When(/^I eat (\d+) cucumbers$/, function (number, next) {
this.eat = parseInt(number);
callback();
});
this.Then(/^I should have (\d+) cucumbers$/, function (number, next) {
var left = this.start - this.eat;
if (left != number)
callback.fail(new Error("This test didn't pass, I started with: " + this.start
+ ", ate: " + this.eat
+ " and was left with: " + left
+ ". Expected: " + number));
callback();
});
};
module.exports = aTest;
¿Qué quiere decir con las pruebas automatizadas. Pregunto porque mencionas Selenium, que es para pruebas de integración, y Jasmine, que es para pruebas unitarias. –
Lo que quiero decir es que quiero que mis pruebas se ejecuten de manera automática sin tener que probar cada función en el navegador manualmente. Pensé que Jasmine es una herramienta de BDD. – chchrist