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

Number input doesn't increment on .type({uparrow}) #2110

Closed
hally9k opened this issue Jul 9, 2018 · 8 comments · Fixed by #2016
Closed

Number input doesn't increment on .type({uparrow}) #2110

hally9k opened this issue Jul 9, 2018 · 8 comments · Fixed by #2016
Assignees
Milestone

Comments

@hally9k
Copy link

hally9k commented Jul 9, 2018

Current behavior:

.type({uparrow}) doesn't increment the number input.
Additionally I cannot invoke('stepUp') either.

Desired behavior:

Increments the number input's value on .type({uparrow}) and invoke('stepUp').

Steps to reproduce:

https://github.com/hally9k/cypress-test-tiny
Clone this fork, npm install and npm start

Versions

macOS 10.13.5
Cypress 3.0.2

@kuceb
Copy link
Contributor

kuceb commented Jul 9, 2018

@hally9k hi, invoke() calls jQuery functions, so that may be why stepUp is failing. Try this:
cy.get('.numInput').then(($el)=>$el.get(0).stepUp())

@hally9k
Copy link
Author

hally9k commented Jul 9, 2018

@bkucera Thanks for that, clearly skimmed that part of the docs a little too hastily. Any insight on why the .type({uparrow}) case isn't working?

@jennifer-shehane
Copy link
Member

@hally9k Are you writing the command using quotes? The {uparrow} should be in quotes like this:

.type('{uparrow}')

@hally9k
Copy link
Author

hally9k commented Jul 11, 2018

@jennifer-shehane Sorry this is a typo in the comments here, I am calling it correctly in the example, see the repro here:
https://github.com/hally9k/cypress-test-tiny/blob/bbe451faf33e49536576749a88526566a403fecd/cypress/integration/spec.js#L14

@kuceb
Copy link
Contributor

kuceb commented Jul 12, 2018

This should be fixed in an upcoming patch release, {uparrow} will be fixed to increment number (not date inputs) , and move cursor on contenteditables and textareas
Same fix for {downarrow}

@jennifer-shehane jennifer-shehane assigned kuceb and unassigned brian-mann Jul 12, 2018
@jennifer-shehane jennifer-shehane added this to the 3.0.3 milestone Jul 12, 2018
@kuceb kuceb added type: feature New feature that does not currently exist type: bug and removed type: bug type: feature New feature that does not currently exist labels Jul 16, 2018
brian-mann pushed a commit that referenced this issue Jul 23, 2018
this grew to a large PR fixing many cy.type issues.

fix #365
fix #420
fix #586 
fix #593 
fix #596 
fix #610 
fix #651
fix #940
fix #1002 
fix #1108
fix #1171
fix #1209 
fix #1234 
fix #1366
fix #1381 
fix #1684 
fix #1686
fix #1926 
fix #2056
fix #2096 
fix #2110 
fix #2173
fix #2187
@jennifer-shehane jennifer-shehane added stage: pending release and removed stage: needs review The PR code is done & tested, needs review stage: needs investigating Someone from Cypress needs to look at this stage: in progress labels Jul 23, 2018
@eireland
Copy link

eireland commented Aug 7, 2019

Has this been released? Using 3.4.1 and still can't get .type('{uparrow}') to increment number input.

@kuceb
Copy link
Contributor

kuceb commented Aug 7, 2019

@eireland yes, see the test here that verifies that https://github.com/cypress-io/cypress/blob/simulated-type-fixes/packages/driver/test/cypress/integration/commands/actions/type_spec.js#L2184

If it's not working, please post a clear reproducible example including test code

@jennifer-shehane
Copy link
Member

This issue will be closed to further comment as the exact issue here was resolved in Cypress 3.0.3 and tested.

If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.

@cypress-io cypress-io locked and limited conversation to collaborators Jan 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants