lundi 7 décembre 2015

Ember Test: Acceptance Test passes in Chrome, but fails in Safari and PhantomJS

I am testing a form field where I allow my users to edit their phone number. They can click an edit button and start editing their new number. However, if they click cancel (as opposed to save), the form would discard the change and show the original phone number.

test('I cancel editing phone number', function(assert){
  visit('/onboarding/vehicle-approval');
  click(editButton);
  fillIn('.edit-phone-field input', '9991234567');
  click(cancelButton);

  andThen(function() {
    assert.equal(currentURL(), '/onboarding/vehicle-approval');
    assert.equal(find('.edit-phone-field input').val(), user[0].phoneNumber);
  });
});

My test passes in Chrome, but fails in Safari and PhantomJS. It fails at the assertion: assert.equal(find('.edit-phone-field input').val(), user[0].phoneNumber); because we expect the value to be the old phone number, but the new phone number (9991234567) is what we are actually getting.

I've tried some of the other answers, like updating phantomJS to 2.0, but none of them have worked for me so far.

Why is my test passing on Chrome, but failing on the other browsers?




Aucun commentaire:

Enregistrer un commentaire