Reputation: 125
in last week we are trying to add e2e testing to our project, but it seems (after a big research in the web) there is no library that can work with Angular ngModel (version 2+).
what can we do ? is there anything except from protractor, which is not support Angular 2 ngModel and binding ?
html example:
I need to look for the following model "data.user.name".
thanks.
Upvotes: 1
Views: 922
Reputation: 1376
There is no problem using proactor for ngModel. Please consider looking in this repository
I already use it. You only need to take the e2e
directory and looking in the package.json
what are the dev dependency.
Edit for your edit: Accessing internal modal "data.user.name"
You should not use e2e
tests for that, that is a non sense. You need regular unit testing for each of your component. Please consider reproducing what there is in the *.spec.ts
in the src
directory. See also the test-config
in the above mentionned repository.
The official doc for unit testing is here
To conclude:
data.user.name
is on test-unit side, Angular provide a heavy doc (but well made) for that. expect(userNameField.getAttribute('value')).toContain('myusername');
Upvotes: 1