Cypress.io: Anyway to test for specific scroll amount?

Here is another adaptation:

// * Ability to Test scroll position of window :)
cy.window().then((win) => {
  win.scrollTo(0, 1000);
});

cy.window()
  .its("scrollY")
  .should(($scrollY) => {
    // expect($scrollY).to.have.value(0);
    expect($scrollY).to.be.closeTo(0, 0);
  });

You can get the window object with cy.window() and then build your assertion checking if the scrollY equals what you expect.

Something like this should test if the scroll is between 300 and 500 pixels from the top (the first argument of closeTo specifies the value you want and the second is the margin of error you want to accept):

cy.window().then(($window) => {
  expect($window.scrollY).to.be.closeTo(400, 100);
});