20. “
Unit Tests Tell You That
You Built The System Right.
Acceptance / Integration
Tests Tell You That You’ve
Built The Right System
Gojko Adzic,
Specification by Example
24. Scenario('Searching For An Item', function() {
Given('an auction item that is available for sale', function() {
var itemTitle = 'item';
beforeEach(function() {
Fictum.addResource('Item', {title: itemTitle});
});
When('I search for that auction item', function() {
beforeEach(function() {
Simulo.fillIn('#mainSearchWidget input[type="text"]', itemTitle);
Simulo.clickOn('#mainSearchWidget .submit-search');
});
Then('I should see the auction item within the search results', function(page) {
page.within('.search-results', function(page) {
expect(page).toHaveContent(itemTitle);
});
});
});
});
});
});
25. Scenario('Searching For An Item', function() {
Given('an auction item that is available for sale', function() {
var itemTitle = 'item';
beforeEach(function() {
Fictum.addResource('Item', {title: itemTitle});
});
When('I search for that auction item', function() {
beforeEach(function() {
Simulo.fillIn('#mainSearchWidget input[type="text"]', itemTitle);
Simulo.clickOn('#mainSearchWidget .submit-search');
});
Then('I should see the auction item within the search results', function(page) {
page.within('.search-results', function(page) {
expect(page).toHaveContent(itemTitle);
});
});
});
});
});
});
26. Scenario('Searching For An Item', function() {
Given('an auction item that is available for sale', function() {
var itemTitle = 'item';
beforeEach(function() {
Fictum.addResource('Item', {title: itemTitle});
});
When('I search for that auction item', function() {
beforeEach(function() {
Simulo.fillIn('#mainSearchWidget input[type="text"]', itemTitle);
Simulo.clickOn('#mainSearchWidget .submit-search');
});
Then('I should see the auction item within the search results', function(page) {
page.within('.search-results', function(page) {
expect(page).toHaveContent(itemTitle);
});
});
});
});
});
});
27. Scenario('Searching For An Item', function() {
Given('an auction item that is available for sale', function() {
var itemTitle = 'item';
beforeEach(function() {
Fictum.addResource('Item', {title: itemTitle});
});
When('I search for that auction item', function() {
beforeEach(function() {
Simulo.fillIn('#mainSearchWidget input[type="text"]', itemTitle);
Simulo.clickOn('#mainSearchWidget .submit-search');
});
Then('I should see the auction item within the search results', function(page) {
page.within('.search-results', function(page) {
expect(page).toHaveContent(itemTitle);
});
});
});
});
});
});
28. Scenario('Searching For An Item', function() {
Given('an auction item that is available for sale', function() {
var itemTitle = 'item';
beforeEach(function() {
Fictum.addResource('Item', {title: itemTitle});
});
When('I search for that auction item', function() {
beforeEach(function() {
Simulo.fillIn('#mainSearchWidget input[type="text"]', itemTitle);
Simulo.clickOn('#mainSearchWidget .submit-search');
});
Then('I should see the auction item within the search results', function(page) {
page.within('.search-results', function(page) {
expect(page).toHaveContent(itemTitle);
});
});
});
});
});
});
29. Scenario('Searching For An Item', function() {
Given('an auction item that is available for sale', function() {
var itemTitle = 'item';
beforeEach(function() {
Fictum.addResource('Item', {title: itemTitle});
});
When('I search for that auction item', function() {
beforeEach(function() {
Simulo.fillIn('#mainSearchWidget input[type="text"]', itemTitle);
Simulo.clickOn('#mainSearchWidget .submit-search');
});
Then('I should see the auction item within the search results', function(page) {
page.within('.search-results', function(page) {
expect(page).toHaveContent(itemTitle);
});
});
});
});
});
});
30. Scenario('Searching For An Item', function() {
Given('an auction item that is available for sale', function() {
var itemTitle = 'item';
beforeEach(function() {
Fictum.addResource('Item', {title: itemTitle});
});
When('I search for that auction item', function() {
beforeEach(function() {
Simulo.fillIn('#mainSearchWidget input[type="text"]', itemTitle);
Simulo.clickOn('#mainSearchWidget .submit-search');
});
Then('I should see the auction item within the search results', function(page) {
page.within('.search-results', function(page) {
expect(page).toHaveContent(itemTitle);
});
});
});
});
});
});
31. Scenario('Searching For An Item', function() {
Given('an auction item that is available for sale', function() {
var itemTitle = 'item';
beforeEach(function() {
Fictum.addResource('Item', {title: itemTitle});
});
When('I search for that auction item', function() {
beforeEach(function() {
Simulo.fillIn('#mainSearchWidget input[type="text"]', itemTitle);
Simulo.clickOn('#mainSearchWidget .submit-search');
});
Then('I should see the auction item within the search results', function(page) {
page.within('.search-results', function(page) {
expect(page).toHaveContent(itemTitle);
});
});
});
});
});
});
45. describe('Scenario: Adding a todo', function() {
Given('I have loaded the todo application', function() {
afterEach(function() {
Todos.mainPane.remove();
});
When('I add a new todo item', function() {
var description;
beforeEach(function() {
description = 'Do Something';
Simulo.fillIn('#new-todo', description).pressEnter();
});
Then('I should see the item in the list of available items', function(page) {
page.within('#incomplete-todos', function(page) {
expect(page).toHaveContent(description);
});
});
});
});
});
46. describe('Scenario: Adding a todo', function() {
Given('I have loaded the todo application', function() {
afterEach(function() {
Todos.mainPane.remove();
});
When('I add a new todo item', function() {
var description;
beforeEach(function() {
description = 'Do Something';
Simulo.fillIn('#new-todo', description).pressEnter();
});
Then('I should see the item in the list of available items', function(page) {
page.within('#incomplete-todos', function(page) {
expect(page).toHaveContent(description);
});
});
});
});
});
47. describe('Scenario: Adding a todo', function() {
Given('I have loaded the todo application', function() {
afterEach(function() {
Todos.mainPane.remove();
});
When('I add a new todo item', function() {
var description;
beforeEach(function() {
description = 'Do Something';
Simulo.fillIn('#new-todo', description).pressEnter();
});
Then('I should see the item in the list of available items', function(page) {
page.within('#incomplete-todos', function(page) {
expect(page).toHaveContent(description);
});
});
});
});
});
48. describe('Scenario: Adding a todo', function() {
Given('I have loaded the todo application', function() {
afterEach(function() {
Todos.mainPane.remove();
});
When('I add a new todo item', function() {
var description;
beforeEach(function() {
description = 'Do Something';
Simulo.fillIn('#new-todo', description).pressEnter();
});
Then('I should see the item in the list of available items', function(page) {
page.within('#incomplete-todos', function(page) {
expect(page).toHaveContent(description);
});
});
});
});
});
49. describe('Scenario: Adding a todo', function() {
Given('I have loaded the todo application', function() {
afterEach(function() {
Todos.mainPane.remove();
});
When('I add a new todo item', function() {
var description;
beforeEach(function() {
description = 'Do Something';
Simulo.fillIn('#new-todo', description).pressEnter();
});
Then('I should see the item in the list of available items', function(page) {
page.within('#incomplete-todos', function(page) {
expect(page).toHaveContent(description);
});
});
});
});
});
50. describe('Scenario: Adding a todo', function() {
Given('I have loaded the todo application', function() {
afterEach(function() {
Todos.mainPane.remove();
});
When('I add a new todo item', function() {
var description;
beforeEach(function() {
description = 'Do Something';
Simulo.fillIn('#new-todo', description).pressEnter();
});
Then('I should see the item in the list of available items', function(page) {
page.within('#incomplete-todos', function(page) {
expect(page).toHaveContent(description);
});
});
});
});
});
51. describe('Scenario: Adding a todo', function() {
Given('I have loaded the todo application', function() {
afterEach(function() {
Todos.mainPane.remove();
});
When('I add a new todo item', function() {
var description;
beforeEach(function() {
description = 'Do Something';
Simulo.fillIn('#new-todo', description).pressEnter();
});
Then('I should see the item in the list of available items', function(page) {
page.within('#incomplete-todos', function(page) {
expect(page).toHaveContent(description);
});
});
});
});
});
52. describe('Scenario: Adding a todo', function() {
Given('I have loaded the todo application', function() {
afterEach(function() {
Todos.mainPane.remove();
});
When('I add a new todo item', function() {
var description;
beforeEach(function() {
description = 'Do Something';
Simulo.fillIn('#new-todo', description).pressEnter();
});
Then('I should see the item in the list of available items', function(page) {
page.within('#incomplete-todos', function(page) {
expect(page).toHaveContent(description);
});
});
});
});
});
53. describe('Scenario: Adding a todo', function() {
Given('I have loaded the todo application', function() {
afterEach(function() {
Todos.mainPane.remove();
});
When('I add a new todo item', function() {
var description;
beforeEach(function() {
description = 'Do Something';
Simulo.fillIn('#new-todo', description).pressEnter();
});
Then('I should see the item in the list of available items', function(page) {
page.within('#incomplete-todos', function(page) {
expect(page).toHaveContent(description);
});
});
});
});
});