Add sample E2E test

This commit is contained in:
David Cormier 2014-08-26 20:01:47 -04:00
parent f1d36c1f96
commit 9675909ab5
2 changed files with 45 additions and 0 deletions

26
test/e2e/scenarios.js Normal file
View file

@ -0,0 +1,26 @@
'use strict';
/* https://github.com/angular/protractor/blob/master/docs/getting-started.md */
describe('Auth', function() {
browser.get('index.html');
var ptor = protractor.getInstance();
it('auth should fail when trying to connect to an unused port', function() {
var host = ptor.findElement(protractor.By.model('host'));
var password = ptor.findElement(protractor.By.model('password'));
var port = ptor.findElement(protractor.By.model('port'));
var submit = ptor.findElement(protractor.By.tagName('button'));
// Fill out the form?
host.sendKeys('localhost');
password.sendKeys('password');
port.sendKeys(2462);
submit.click();
var error = ptor.findElement(
protractor.By.css('.alert.alert-danger > strong')
)
expect(error.getText()).toBeDefined();
});
});

19
test/protractor-conf.js Normal file
View file

@ -0,0 +1,19 @@
exports.config = {
allScriptsTimeout: 11000,
specs: [
'e2e/*.js'
],
capabilities: {
'browserName': 'firefox'
},
baseUrl: 'http://localhost:8000/',
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
}
};