Questions tagged [cypress-dayjs]

3 questions
1
vote
1 answer

Cypress, javascript: dayjs does not return current date correctly

I am coding cypress tests. I use cypress v10.3.0. I am getting a wrong date when I use dayjs function for the second time. var dayjs = require('dayjs') cy.log(dayjs(new Date()).format('DD/MM/YYYY HH:mm:ss')) cy.wait(5000) cy.log(dayjs(new…
Filipm64
  • 47
  • 7
0
votes
1 answer

How to assert today's date or older in Cypress

I am trying to write a function in Cypress, where it loops through all the columns for my start date (#EventStart) and makes sure that the start dates are today's current date or older. So for instance, I need this test to make sure that it is…
Cholis
  • 61
  • 1
  • 2
  • 5
-4
votes
2 answers

How to convert date into my required format using dayjs module

I am reading a date from a locator through cypress the actual date is 11/04/2023 cy.get("#eff-date").invoke('text').then(()=>{ const edate = dayjs(text.split(':')[1].format('DD-MMM-YYYY')) }) What it is returning 04-Nov-2023 But it should be…