Home > Net >  assign number of matched elements in cypress to variable
assign number of matched elements in cypress to variable

Time:10-25

as described with comment, need to change value of var inside cypress function enter image description here

enter image description here

CodePudding user response:

because of asynchronous nature of Cypress, the last statement should be written as follows:

cy.then(() => {
 cy.contains(`${total}`);
})
  • Related