cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.73k stars 3.16k forks source link

After pressing hotkeys, have to click into specs list to regain focus for hotkeys #21795

Closed sync-by-unito[bot] closed 1 year ago

sync-by-unito[bot] commented 2 years ago

Something I noticed with the test running hotkeys. If I press R or S, I have to left click the Specs area to regain focus for my hotkeys to work. Otherwise they seem to have no effect. So far it is happening on Chrome/Electron on Linux Mint 20.2

https://cypressio.slack.com/archives/C039JEKF9M0/p1649096347394789

┆Issue is synchronized with this Jira Task by Unito ┆author: Bill Glesias ┆epic: UI/UX Improvements ┆friendlyId: UNIFY-1477 ┆priority: Low ┆sprint: Backlog ┆taskType: Task

sync-by-unito[bot] commented 2 years ago

➤ Jennifer Shehane commented:

From Mark Noonan

This will happen any time the test has moved keyboard focus into the AUT to type or click, @Zach Williams ( https://cypressio.slack.com/team/U02BXNAU6P5 ) and I were talking about this earlier too. But maybe there’s another cause, I wonder if you have the same issue if you comment out the interaction in a test and just visit something?

sync-by-unito[bot] commented 2 years ago

➤ Zach Williams commented:

This also occurs in 9.x

sync-by-unito[bot] commented 2 years ago

➤ Mark Noonan commented:

Right, it is intended behavior that these events would not work from the context of the app under test, any keyboard events that take place in that context should be captured as input to the app under test, not Cypress.

It does make the idea of keyboard shortcuts in the spec runner page less effective. One improvement might be to move keyboard focus to the reporter panel after tests complete. Then hotkeys would work a bit more naturally at least, when tests aren’t running. Definitely there’s plenty to discuss around our hotkeys/shortcuts though.

github-actions[bot] commented 1 year ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

cypress-app-bot commented 1 year ago

This issue has been closed due to inactivity.