In e2e testing, I want to simulate user typing in a input field. My input field has a maxlength in it. I want the maxlength to be consider, but I have not succeed to find a solution to it. Here's what I've tried:
<input type="text" id="myField" maxlength="10" ng-model="myModel" />
<span>{{myModel}}</span>
1) input("myModel").enter("ABCDEFGHIJKLMNOPQRSTUVWXYZ"). Both the myField input and the myModel model are set to "ABCDEFGHIJKLMNOPQRSTUVWXYZ". Expected result: "ABCDEFGHIJ"
2) element("#myField").val("ABCDEFGHIJKLMNOPQRSTUVWXYZ"). The myField input is set to "ABCDEFGHIJ". Which is perfect! But the myModel is null.
Do you guys have a solution for this? I don't want to use ngMaxlength since I want to prevent to use to typing more than 10 caracters.
Many thanks!