I'm trying to check if one date value that I get from the element in the app is less than today's date:
const todaysDate = Cypress.moment().format('DD/MM/YYYY')
it("Check date to be less or equal than todays", () => {
cy.get('.date', { timeout: 15000 }).eq(3).invoke('text').should('be.lte', todaysDate);
})
However I'm getting the following error:
Timed out retrying after 4000ms: expected '12/14/2020' to be a number or a date
Is there a way to convert the date I get from element to a datetime object?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…