feat(e2e): added e2e tests for forms
This commit is contained in:
parent
5782f063f1
commit
552d1ed61b
|
@ -0,0 +1,5 @@
|
|||
library examples.e2e_test.hello_world.template_driven_forms_spec;
|
||||
|
||||
main() {
|
||||
|
||||
}
|
|
@ -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');
|
||||
});
|
||||
});
|
|
@ -0,0 +1,5 @@
|
|||
library examples.e2e_test.hello_world.template_driven_forms_spec;
|
||||
|
||||
main() {
|
||||
|
||||
}
|
|
@ -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');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue