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?
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'])