Hi there!
It looks like there is a synchronization problem with Angular2(4) Forms when clearing an input field with element.clear().
A detailed description of the issue can be found here.
Bug Report
v7.8.05.1.04.0.0ChromeUbuntu 16.10 LTSI have noticed this as well when interacting with WYSIWYG editors. If the editor creates a default content containing a
element clear will remove everything and affect the validity of the editor.
Any solution ?
A similar problem existed ~4 years ago.
The workaround https://github.com/angular/protractor/issues/301#issuecomment-32651201 fixed it for me also on angular 5 / protractor 5.2.0.
This is the "solution" we use:
field.clear();
field.sendKeys(' ');
field.sendKeys(protractor.Key.BACK_SPACE);
This has been fixed and we also have tests for it, see https://github.com/angular/protractor/commit/b93c8310f8aaccbebed672eeb42e156d47d16f0a
Most helpful comment
A similar problem existed ~4 years ago.
The workaround https://github.com/angular/protractor/issues/301#issuecomment-32651201 fixed it for me also on angular 5 / protractor 5.2.0.