Created
March 13, 2015 20:41
-
-
Save ferclaverino/1281202ca030e40843c4 to your computer and use it in GitHub Desktop.
search scenario
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Home | |
Como comprador | |
Quiero buscar teléfonos | |
Scenario: Busqueda de xoom | |
Given Estoy en "phones" | |
When Yo busco "xoom" | |
Then Veo "2" resultados |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chai = require('chai'); | |
var chaiAsPromised = require('chai-as-promised'); | |
chai.use(chaiAsPromised); | |
var expect = chai.expect; | |
module.exports = function() { | |
this.Given(/^Estoy en "([^"]*)"$/, function(arg1, callback) { | |
browser.get('http://angular.github.io/angular-phonecat/step-12/app/#/' + arg1); | |
callback(); | |
}); | |
this.Then(/^El título es "([^"]*)"$/, function(arg1, callback) { | |
expect(browser.getTitle()).to.eventually.equal(arg1).and.notify(callback); | |
}); | |
this.When(/^Yo busco "([^"]*)"$/, function(arg1, callback) { | |
element(by.model('query')).sendKeys(arg1); | |
callback(); | |
}); | |
this.Then(/^Veo "([^"]*)" resultados$/, function(arg1, callback) { | |
var rows = element.all(by.repeater('phone in phones')); | |
expect(rows.count()).to.eventually.equal(parseInt(arg1)).and.notify(callback); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment