Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

81
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda