Skip to content
Advertisement

Tag: cypress

Checking length of element in beforeEach on Cypress

I’m trying to setup my beforeEach to create a new email if none exist before starting my tests, but when I try to count how many emails there are in my beforeEach, it always logs as 0, even if there are more. If I log the count in my it block, it shows the correct count. Does this look correct?

moment.js returns invalid Date for moment (String, string)

Wants to compare the timestamp. Tried lots of ways but it is throwing an Invalid Date error. The variables startDate /endDate/testDate returns a same timestamp format in ‘DD.MM.YYYY HH:MM:ss’ i.e. ‘21.12.2021 08:29:00’ Also tried using isBetween() function. But for all the conditions it is throwing result as false. please correct me. Answer From https://momentjs.com/docs/#/parsing/string-format/ momentjs docs screenshot MM in HH:MM:ss

Get text from series of elements to an array using cypress JS

I’m trying to get comma separated text from series of <th> elements in a table row. I tried to use element.each() method for 3 nested loops from Cypress and it was super slow and was throwing error (cy.click() failed because this element is detached from the DOM.) sporadically in different test levels (Sometimes passed without any issue). I assume this

Keep dynamic variables between tests in Cypress

I am trying to do a Cypress test where I want to set in an input a random number and after that check that random number is set ok in another page. I’m creating the random number with this function: And setting the variables inside the describe like: The issue I’m currently having is that the variables reset in every

get value from command log in cypress

I m trying to get value from command log in cypress . I tried to get by css selector but I could not get the value. I tried custom commands but I couldnt get it . On the webpage that I do automation test, there s a download button. when I click the button I got the exe file .

Cypress select does not have value

I´m writing a Cypress test in which I want to confirm that a certain value is not shown. I want to check that my select element does not have an option with a certain value. An example: So now I want to check that there isn´t an option with value “C” Can someone help me evaluate this? Thanks. Answer Try

Advertisement