Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Replaced the function that does not exist in the readme with a piece of code that implements the same functionality. This should give people a easier start with cucumber.js because the Readme.md has more contents that can be tried by copy and paste
  • Loading branch information
sebs committed Oct 30, 2013
1 parent 1ecdabf commit 127a7c9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,12 @@ var myStepDefinitionsWrapper = function () {
this.Then(/^I should see "(.*)" as the page title$/, function(title, callback) {
// matching groups are passed as parameters to the step definition

if (!this.isOnPageWithTitle(title))
// You can make steps fail by calling the `fail()` function on the callback:
callback.fail(new Error("Expected to be on page with title " + title));
else
var pageTitle = this.browser.text('title');
if (title === pageTitle) {
callback();
} else {
callback.fail(new Error("Expected to be on page with title " + title));
}
});
};

Expand All @@ -295,11 +296,12 @@ this.Then('I should see "$title" as the page title', function(title, callback) {
// the above string is converted to the following Regexp by Cucumber:
// /^I should see "([^"]*)" as the page title$/

if (!this.isOnPageWithTitle(title))
// You can make steps fail by calling the `fail()` function on the callback:
callback.fail(new Error("Expected to be on page with title " + title));
else
var pageTitle = this.browser.text('title');
if (title === pageTitle) {
callback();
} else {
callback.fail(new Error("Expected to be on page with title " + title));
}
});
```

Expand Down

0 comments on commit 127a7c9

Please sign in to comment.