Skip to content

Instantly share code, notes, and snippets.

@gmoeck
Created April 11, 2011 23:34
Show Gist options
  • Save gmoeck/914609 to your computer and use it in GitHub Desktop.
Save gmoeck/914609 to your computer and use it in GitHub Desktop.
Scenario('Searching For An Item', function() {
Given('an item that is available', function() {
var itemTitle = 'item';
beforeEach(function() {
Application.server.addResource('Item', {title: itemTitle});
});
When('I am on the homepage of the application', function() {
beforeEach(function() {
Application.statechart.gotoState('started');
});
And('I search for that item', function() {
beforeEach(function() {
WebPage.fillIn('#mainSearchWidget .search-field-view input[type="text"]', itemTitle);
WebPage.clickOn('#mainSearchWidget .submit-search');
});
Then('I should see the auction item within the search results', function() {
WebPage.within('.search-results', function(page) {
expect(page).toHaveContent(itemTitle);
});
});
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment