Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
No puedo abrir un enlace en la misma pestaña usando Cypress

Estoy tratando de abrir un enlace en la misma pestaña usando cypress

me cansé de usar

 cy.get('a').eq(0).invoke('removeAttr', 'target').click()

pero no funcionó. después de revisar el archivo HTML vi que no hay

 target=_blank

att en el href

No puedo entender por qué se abre en una nueva ventana y cómo evitarlo usando ciprés.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Para un ancla target=_blank , puede eliminar el atributo de target o reemplazar el valor _blank con _self .

 // remove attribute target cy.get('a') .eq(0) .should('have.attr', 'target') // check it has target attr before removing .invoke('removeAttribute', 'target') .click() // update target value cy.get('a') .eq(0) .should('have.attr', 'targe', '_blank') // check target attr has _blank .invoke('attr', 'target', '_self') .click()
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!