Skip to content

Instantly share code, notes, and snippets.

@neilrees
Forked from kbingman/google.feature
Last active September 10, 2015 12:09
Show Gist options
  • Save neilrees/b4a2e1acd6194e7fe8b5 to your computer and use it in GitHub Desktop.
Save neilrees/b4a2e1acd6194e7fe8b5 to your computer and use it in GitHub Desktop.
Feature: Google Demo
Scenario: Google home page
When I open http://google.com
The the title should be Google
module.exports.install = function (library) {
library
.when("I open $URL", function(url) {
this.browser.url(url)
})
.then("the title should be $TITLE", function(title){
this.browser.assert.title(title)
})
};
var Yadda = require('yadda');
var library = Yadda.localisation.English.library();
var featureParser = new Yadda.parsers.FeatureFileParser();
require('./steps').install(library);
var yadda = new Yadda.Yadda(library);
new Yadda.FeatureFileSearch('./features').each(function(file) {
featureParser.parse(file).scenarios.forEach(function (scenario) {
module.exports[scenario.title] = function (browser) {
yadda.yadda(scenario.steps, { browser: browser });
browser.end();
};
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment