First post. I have a situation where I am using jQuery UI's datepicker to set model attributes. This is done with Angular UI and seems to work well, but I'm having a hard time trying to test it in the E2E scenarios.
This is the html:
<form ng-submit="submitForm(request)">
<input ng-model="request.startDate" ui-date placeholder="Start Date" />
</form>
This is the controller:
$scope.submitForm = function(request) {
var startDateStr = $filter('date')(request.startDate, dateFilterFormat);
// Do something with startDateStr.
var startYear = request.startDate.getFullYear();
var startMonth = request.startDate.getMonth(); // 0-based.
var startDayOfMonth = request.startDate.getDate();
// Do something with date fields.
}
I have tried to set the input field in my E2E test, but it doesn't seem to set the datepicker. When I try to access the model, I'm getting just the string as expected, not a date object like I would with Angular UI. My initial thoughts were to either set the datepicker via jquery, but I'm not sure how I would go about doing that in the E2E test, or set the model attribute directly, which I also don't know how to do.
Can anyone provide any insight please? Thanks.