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

222
Views
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 answers
Answer question

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 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!