Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

74
Vistas
Trying to write a Cypress UI test that uses a passed string

I'm attempting to write a Cypress test that uses a string passed through by a different function. The other function simply calls the cypress function and passes a string. This seems to be possible from what I've seen in documentation but I can't figure out what I'm missing. The Cypress test is just supposed to find a button based on it's title, defined by the passed string and click said button.

  When('I click the button ""', function (string) {
    // Clicks a button that test defines by title
    cy.get('button[title=${string}]').click
  });
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I see you are using single quote instead of backtick for string interpolation. If it's not a typo you need to correct that

When('I click the button ""', function (string) {
  // Clicks a button that test defines by title
  cy.get(`button[title=${string}]`).click
});
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda