Home > database >  How do i use parameters in cypress custom commands
How do i use parameters in cypress custom commands

Time:08-29

how do i make this work? Im trying to get the id of the object i want to get from the command parameter photo of my code

CodePudding user response:

You have to use the template literals for this:

Cypress.Commands.add('requestReport', (numeFirma, tipRaport) => {
  //some code
  cy.get(`[id=${tipRaport}]`)
  //some code
})
  • Related