I have problem comparing with dates in cypress.
I have these dates
which are ordered in ascending order and the witness must demonstrate this.
With cypress I launch this test which compares that the dates are sorted in ascending order:
var time = 0
var time_prev = 0
cy.get('#hometable > tbody > tr > td:nth-child(6)').each(($e, index, $list) => {
if (index == 0){time_prev=0}
time = Math.round(new Date($e.text()).getTime() / 1000)
assert.isBelow(time_prev, time, 'previous date is below actual')
time_prev = time
})
The test fails with the following error:
But as you can see from the first image, the second date is smaller than the third date.
I also notice that this test fails when I run multiple tests together.