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

feat: Improve clicking with modifiers. #8114

Merged
merged 12 commits into from Aug 10, 2020

Conversation

sainthkh
Copy link
Contributor

@sainthkh sainthkh commented Jul 29, 2020

User facing changelog

You can not send click with simple options like this:

cy.get('#button').click({
  ctrlKey: true,
});

Additional details

  • Why was this change necessary? Clicking with modifiers was a bit complicated.
  • What is affected by this change? N/A
  • Any implementation details to explain? It uses cy.devices.keyboard inside click.

How has the user experience changed?

Before:

cy.get('body').type('{ctrl}', { release: false })
cy.get('#some-el').click()

After:

cy.get('#button').click({
  ctrlKey: true,
});

PR Tasks

  • Have tests been added/updated?
  • Has the original issue been tagged with a release in ZenHub?
  • Has a PR for user-facing changes been opened in cypress-documentation? => Coming soon...
  • Have API changes been updated in the type definitions?
  • [N/A] Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 29, 2020

Thanks for taking the time to open a PR!

@sainthkh sainthkh marked this pull request as draft July 29, 2020 02:00
@sainthkh sainthkh marked this pull request as ready for review July 29, 2020 02:22
@sainthkh
Copy link
Contributor Author

Flaky failure.

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Any reason to leave out the {meta} modifier?
  • The type modifiers also have aliases, to account for Mac vs Windows, etc. Should we also implement: optionKey (alias for altKey), controlKey (alias for ctrlKey), meta / commandKey / cmdKey?

@sainthkh
Copy link
Contributor Author

No. I just forgot it. I'll cover them tomorrow.

@sainthkh sainthkh marked this pull request as ready for review July 31, 2020 01:07
@sainthkh
Copy link
Contributor Author

sainthkh commented Aug 3, 2020

Flaky failures.

@jennifer-shehane jennifer-shehane dismissed their stale review August 3, 2020 07:30

Dismissing my previous review as addressed

Copy link
Contributor

@chrisbreiding chrisbreiding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I think we just need docs for this and it's good to go.

@sainthkh
Copy link
Contributor Author

sainthkh commented Aug 6, 2020

Add doc at cypress-io/cypress-documentation#3062

@sainthkh sainthkh self-assigned this Aug 10, 2020
@jennifer-shehane jennifer-shehane merged commit 26f6228 into cypress-io:develop Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve clicking with modifier(s)
3 participants