Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to cy.type() for "typing into document" #150

Closed
chrisbreiding opened this issue May 20, 2016 · 1 comment
Closed

Add support to cy.type() for "typing into document" #150

chrisbreiding opened this issue May 20, 2016 · 1 comment
Assignees
Labels
type: enhancement Requested enhancement of existing feature
Milestone

Comments

@chrisbreiding
Copy link
Contributor

Allowing the document to be the subject when using cy.type() will allow typing that doesn't need a text field (namely, keyboard shortcut capturing) to be tested. So a user can write the following test, for example:

// for this example, assume there's a listener on `document` that
// opens a modal when 'abcd' is typed
cy
  .document().type('abcd')
  .get('.modal').should('have.text', 'A modal!');
@chrisbreiding chrisbreiding added the type: enhancement Requested enhancement of existing feature label May 20, 2016
@chrisbreiding chrisbreiding self-assigned this May 20, 2016
@chrisbreiding chrisbreiding added this to the 0.17.1 milestone Aug 31, 2016
@brian-mann
Copy link
Member

Fixed in 0.17.1.

You can achieve this by typing into the body.

cy.get("body").type("{ctrl}s")

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Dec 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

2 participants