angularjs - Angular UI datepicker popup with type-in returns one date earlier than typed in protractor -


this bit complicated, i've verified both angular scenario tester , protractor, , in user interface.

  1. set twitter bootstrap 3.x (i'm using latest had 3.0.3 before) - bower boostrap install
  2. set angular ui built-in templates (i'm using angular-ui-bootstrap-bower library bower)
  3. set datepicker-popup field in angular-ui this:

    <label for='due_date'>due date</label> <input id='due_date'        class='form-control'        type='text'        datepicker-options="dateoptions"        datepicker-popup='yyyy-mm-dd'        ng-model="task.duedate"> 
  4. add button , controller method inspect variable.

testing:

  1. click on date field, , type in date: 2013-01-05
  2. hit escape or click on field close popup dialog (i.e. don't click done)
  3. submit form

you'll find date 1 day behind.

interestingly, if click on actual date in date picker, correct. including 'today'. if remove ui datepicker, works fine persisting typed-in data. date format yyyy-mm-dd when type in.

this maddening, i've thought bug in angular scenario, once figured out protractor fails, , reproduce canceling dialog, , typing , submitting, beginning think has localization , timezones.

anyone else run this?

here protractor test fails:

  it('should return 1 task', function () {     thepage.cleartasksbutton.click();     thepage.newtaskbutton.click();     thepage.taskdescription.clear();     thepage.taskdescription.sendkeys('a new task');      thepage.taskpriority.clear();     thepage.taskpriority.sendkeys('1');      thepage.duedate.clear();     // pick today , dismiss angular datepicker     thepage.todaybutton.click();      thepage.createtaskbutton.click();      var task = element.all(by.repeater('task in tasks').row(0).column('duedate'));      task.then(function(elems) {       // should result in 1 row       expect(elems.length).toequal(1);  // works       expect(elems[0].gettext()).toequal('2014-03-19'); // 2014-03-18     });     ... 

thanks

ken


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -