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

cy.type does not fire events for modifier keys #3316

Closed
chrisbreiding opened this issue Feb 4, 2019 · 2 comments
Closed

cy.type does not fire events for modifier keys #3316

chrisbreiding opened this issue Feb 4, 2019 · 2 comments
Assignees
Labels
pkg/driver This is due to an issue in the packages/driver directory topic: cy.type ⌨️ type: bug

Comments

@chrisbreiding
Copy link
Contributor

Currently, using a modifier key (ctrl, shift, etc) with cy.type only sets the property on subsequent type/click events. For example, cy.get('body').type('{ctrl}a') will only fire keyup/keydown/events for the a with ctrlKey: true.

It should also fire those events for the control key itself. This means cy.get('body').type('{ctrl}') essentially does nothing.

We should fire the appropriate events, so the events fired for {ctrl}a look something like:

keydown ctrl
keydown a
keyup a
keyup ctrl

See the related conversation here for more context.

@chrisbreiding chrisbreiding added type: bug pkg/driver This is due to an issue in the packages/driver directory stage: ready for work The issue is reproducible and in scope labels Feb 4, 2019
@chrisbreiding chrisbreiding self-assigned this Feb 4, 2019
@kuceb kuceb mentioned this issue Oct 22, 2019
17 tasks
kuceb added a commit that referenced this issue Oct 22, 2019
@cypress-bot cypress-bot bot added stage: work in progress and removed stage: ready for work The issue is reproducible and in scope labels Oct 23, 2019
brian-mann added a commit that referenced this issue Oct 23, 2019
* cleanup type_spec, allow unused-vars for args

* fix missing return

* rename mouse/keyboard

* apply changes on this branch with rename

* temp 07/18/19 [skip ci] type_spec minor changes

* temp 07/19/19 [skip ci]

* temp 07/22/19 [skip ci]

* temp 07/22/19 [skip ci]

* remove accidental spec, use beforeEach visit in click_spec

* add tests for cy.trigger changes

* re-run build

* extract simulated type from native events

* most type_spec passing until tab

* add typedefs

* temp 08/08/19 [skip ci]

* fix type_spec, click_spec

* fix console table event table logging

* fix spec utils

* temp 08/12/19 [skip ci]

* large changes to selection.ts, working type_spec, eslint changes

* fix elements util, cleanup debugging code

* fix linting rules

* fix type_spec in electron by using plain Event contructor

* fix invalid clicking-into-iframe spec

* address review, cleanup

* use webpack-preprocessor (required for typescript files)

* fix invalid connectors_spec

* chore(lint): fix linting, since changed rules

* fix not borrowing property getter for maxlength

* temp 09/25/19 [skip ci]

* add test for clicking checkbox, cleanup click_spec

* document mouse click and mouse move algo, adjust mouse move, add test for recursive movement

* cleanup / formatting

* scope the getCommandLogWithText to the active runnable to prevent leakage

* cleanup tests, make values static so tests pass consistently

- use attach listener alias APIs
- remove magic number constants
- fix some incoherent html / script tag stuff

* begin implementation for returning fromAutWindow

- restore original fromWindow algorithm
- begin writing fromAutWindow for calculating red hitbox coordinates
which are layered on the AUT

* move describe block with the others

* refactor actions to DRY up duplicated logic between click/dblclick/rightclick

- tighten up the mouse.js method names, name them consistently

* remove comment

* fix iframe coords and test

* temp 10/06/19 [skip ci]

* rename fromDocCoords->fromWindowCoords, fix type_spec ux test

* fix after merge from mouse-fixes branch / develop

* temp 10/08/19 [skip ci]

* Revert "temp 10/08/19 [skip ci]"

This reverts commit 92b73f6.

* remove only, fix contenteditable test

* add test for datetime-local inputs

* add webpack devdep

* fix debugging code

* fix force:true on hidden input

* up timeout for test in ci

* tighten up method, remove unnecessary arg

* add debug logic for retries to console.error() non cypress errors

* renamed fromWindow -> fromElWindow, and fromViewport -> fromElViewport

* handle calculating the fromElWindow coordinates inline

* extract out function for clarity, receive consistent arg names

* cleanup, add lots of comments

* fix display specific test

* fix type follow focus when redirect on focus

* cleanup new follow focus test

* upgrade eslint-plugin-dev to 5.0.0

* more [lint fixes]

* use typescript in driver

* cleanup minor

* remove unneeded file

* mild refactor webpack configs

* fix elements.ts

* fix isTextLike signature change

* fix isType check, fix type_spec

* actually use webpack-preprocessor

* fix isType domUtil

* fix connectors_spec

* cleanup connectors_spec

* address feedback- cleanup, add comments, refac

* answer: no, need index.js

* cleanup after driver typescript PR

* fix keyboard getActiveModifiers

* fix(driver:keyboard): fix typing negative numbers with existing text selection

* remove debugging code, cleanup

* link fixed issues in tests, actually fix one issue

* cleanup remove dead code

* remove unused helper

* add test for #2166

* pay no attention to the code and implementation changing... add tests and note for changing focus into date input

* mark fix for issue #3316

* mark fix for issue #3722

* rename elements.isType -> elements.isInputType for clarity

* restructure keyboard a bit, don't export default, rework static class properties to regular exports

- attach $Mouse + $Keyboard to Cypress

* tighten up

* coffeescript fixes, consistent regexp const naming

* capitalize interface, tighten up several modifier functions

* misc cleanup and tightening up

* rework impl to use stubs instead of numbers

* some more cleanup

* fix logic with when function is called


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 23, 2019

The code for this is done in cypress-io/cypress#4870, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 23, 2019

Released in 3.5.0.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg/driver This is due to an issue in the packages/driver directory topic: cy.type ⌨️ type: bug
Projects
None yet
Development

No branches or pull requests

2 participants