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

223
Visualizações
How to press/type function keys using cypress

In my cypress test, i'm currently doing automation testing on a webpage (https://kitchen.planner.ikea.com/planner/#/gb/en/planner?startFromScratch=true) and I do have a special debug function that I trigger by doing CTRL (left) + F1 and then ALT + F12. (You can try it yourself :) )

However when I use cypress by doing:

cy.get('body').trigger('keydown', { ctrlKey: true, keyCode: 112, which: 112 })
cy.get('body').trigger('keydown', { altKey: true, keyCode: 123, which: 123 })

it passes the test but when looking at the browser, it does not trigger the debug function

My question is how can I use CTRL + F1 and then ALT + F12 using Cypress?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I found out that I could use cypress-real-events and it was as easy as adding this line to the code:

cy.realPress(['Control', 'F1'])
cy.realPress(['Alt', 'F12'])
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