feat(e2e): added e2e tests for forms

This commit is contained in:
vsavkin 2015-06-13 15:26:33 -07:00
parent 5782f063f1
commit 552d1ed61b
4 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,5 @@
library examples.e2e_test.hello_world.template_driven_forms_spec;
main() {
}

View File

@ -0,0 +1,21 @@
import {verifyNoBrowserErrors} from 'angular2/src/test_lib/e2e_util';
describe('Template-Driven Forms', function() {
afterEach(verifyNoBrowserErrors);
var URL = 'examples/src/model_driven_forms/index.html';
it('should display errors', function() {
browser.get(URL);
var form = element.all(by.css('form')).first();
var input = element.all(by.css('#creditCard')).first();
var firstName = element.all(by.css('#firstName')).first();
input.sendKeys('invalid');
firstName.click();
expect(form.getInnerHtml()).toContain('is invalid credit card number');
});
});

View File

@ -0,0 +1,5 @@
library examples.e2e_test.hello_world.template_driven_forms_spec;
main() {
}

View File

@ -0,0 +1,21 @@
import {verifyNoBrowserErrors} from 'angular2/src/test_lib/e2e_util';
describe('Template-Driven Forms', function() {
afterEach(verifyNoBrowserErrors);
var URL = 'examples/src/template_driven_forms/index.html';
it('should display errors', function() {
browser.get(URL);
var form = element.all(by.css('form')).first();
var input = element.all(by.css('#creditCard')).first();
var firstName = element.all(by.css('#firstName')).first();
input.sendKeys('invalid');
firstName.click();
expect(form.getInnerHtml()).toContain('is invalid credit card number');
});
});