Cypress: Animations with velocityjs no longer work in v3.1.1-v3.1.2

Created on 6 Nov 2018  路  9Comments  路  Source: cypress-io/cypress

Current behavior:

In v3.1.1 animations using velocityjs fail to occur. No amount of .waiting solves the problem.

Desired behavior:

In v3.1.0 the animations ran just fine without waiting. If I upgrade Cypress to v3.1.1 all animation tests fail and there is no change in the DOM, if I downgrade to v3.1.0 they all pass and all look correct. No other changes are necessary.

regression

All 9 comments

Could you provide a reproducible example? I can't think of any relevant issues we closed that would have affected this.

Yep https://github.com/paulfalgout/cypress-velocity-bug
If you reduce the version to v3.1.0 it'll work, but no-go in v3.1.1

Oh.. just noticed another point that's super weird. If you watch the gui the test will fail, but if you minimize the window the animation will run during (which then passes) or after the test. Test also fails headless.

The part of velocity that is having trouble is something related to https://github.com/julianshapiro/velocity/blob/v1.5.2/velocity.js#L4153 and the raf.

The tick function gets called on a loop, but never with a timestamp unless the browser goes hidden in which case it fixes itself: https://github.com/julianshapiro/velocity/blob/v1.5.2/velocity.js#L4190

Ah yep it's requestAnimationFrame that's broken.

function test(ts) {
  console.log(ts);
  window.requestAnimationFrame(test);
}

window.requestAnimationFrame(test);

In v3.1.0 this'd log a bunch of timestamps, but in v3.1.1 it's all undefineds

Yup, 3.1.1 most definitely broke this. Likely caused by: https://github.com/cypress-io/cypress/pull/2467

We plan to release a 3.1.2 to fix this and some other minor stuff that didn't go out in 3.1.1

I can still reproduce this in 3.1.2. Reverting to 3.1.0 fixes it as mentioned.

screen shot 2018-11-22 at 10 35 27 pm
Yep. Definitely no change in 3.1.2 https://github.com/paulfalgout/cypress-velocity-bug

Released in 3.1.3.

Was this page helpful?
0 / 5 - 0 ratings