3

I am trying to test keyboard short cuts. I tried using 'type' and 'trigger' assertions but they both are child assertions and I will have to pass a DOM element using a parent assertion such as cy.get(). I don't really need to select any DOM element as the test is for HOT-KEY login(I just need to press combination of keys). Can anyone please help me with this issue. Thanks.

  • 1
    You can try using `cy.document()` or `cy.window()` or `cy.get('body')` as the parent - in the app, something is responding to the hotkey event, not sure what that would be. –  Sep 11 '20 at 04:27
  • 1
    See the docs at [Keyboard shortcuts](https://docs.cypress.io/api/commands/type.html#Global-Shortcuts), `cy.get('body').type(...)`. –  Sep 11 '20 at 07:58

0 Answers0