diff --git a/modules/examples/e2e_test/model_driven_forms/model_driven_forms_spec.dart b/modules/examples/e2e_test/model_driven_forms/model_driven_forms_spec.dart new file mode 100644 index 0000000000..9379e996b5 --- /dev/null +++ b/modules/examples/e2e_test/model_driven_forms/model_driven_forms_spec.dart @@ -0,0 +1,5 @@ +library examples.e2e_test.hello_world.template_driven_forms_spec; + +main() { + +} diff --git a/modules/examples/e2e_test/model_driven_forms/model_driven_forms_spec.ts b/modules/examples/e2e_test/model_driven_forms/model_driven_forms_spec.ts new file mode 100644 index 0000000000..8e4a516593 --- /dev/null +++ b/modules/examples/e2e_test/model_driven_forms/model_driven_forms_spec.ts @@ -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'); + }); +}); diff --git a/modules/examples/e2e_test/template_driven_forms/template_driven_forms_spec.dart b/modules/examples/e2e_test/template_driven_forms/template_driven_forms_spec.dart new file mode 100644 index 0000000000..9379e996b5 --- /dev/null +++ b/modules/examples/e2e_test/template_driven_forms/template_driven_forms_spec.dart @@ -0,0 +1,5 @@ +library examples.e2e_test.hello_world.template_driven_forms_spec; + +main() { + +} diff --git a/modules/examples/e2e_test/template_driven_forms/template_driven_forms_spec.ts b/modules/examples/e2e_test/template_driven_forms/template_driven_forms_spec.ts new file mode 100644 index 0000000000..f671a4a613 --- /dev/null +++ b/modules/examples/e2e_test/template_driven_forms/template_driven_forms_spec.ts @@ -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'); + }); +});