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

Cypress can’t type the string ‘hasOwnProperty’ inside any field #3423

Closed
reno1979 opened this issue Feb 11, 2019 · 6 comments

Comments

3 participants
@reno1979
Copy link

commented Feb 11, 2019

Current behavior:

When testing out forms with the Big List Of Naughty strings, cypress itself fails to type the string ‘hasOwnProperty’

Desired behavior:

Cypress Should be able to type all strings

Steps to reproduce: (app code and test code)

cy.get(‘input’).type(‘hasOwnProperty’); 
cy.get(‘textarea’).type(‘hasOwnProperty’);

Nothing happens, workaround:

cy.get(‘input’).type(‘h’).type(‘asOwnProperty’); 

Versions

Chrome v68
Cypress v3.1.0

@reno1979

This comment has been minimized.

Copy link
Author

commented Feb 11, 2019

Same with these values

toLocaleString
toString
valueOf

The JavaScript object prototype functions ....

@jennifer-shehane

This comment has been minimized.

Copy link
Member

commented Feb 12, 2019

Yes, lol, this is happening.

@clarmso

This comment has been minimized.

Copy link
Contributor

commented Apr 7, 2019

It is a fun bug lol. The bug is on isSpecialChar and isModifier called from typeChars in packages/driver/src/cypress/keyboard.coffee.

Please note the following behaviour of the Javascript dictionary behaviour:

modifiers = {alt: false, ctrl: false}
{alt: false, ctrl: false}
modifiers["alt"]
false
modifiers["hello"]
undefined
modifiers["toString"]
ƒ toString() { [native code] }

The last one is not ok.

whid

Let me see what I can do there.

@jennifer-shehane

This comment has been minimized.

Copy link
Member

commented Apr 8, 2019

@clarmso Let us know if you need any help contributing. Feel free to open a WIP (work in progress) PR that we can help with.

@cypress-bot

This comment has been minimized.

Copy link

commented Apr 8, 2019

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

flotwig added a commit that referenced this issue Apr 8, 2019

#3423 Enable Cyrpess to type strings containing reserved words (#3903)
close #3423 

I have make Cypress to be able to type some Javascript reserved words such as "hasOwnProperty" and "toString".  In addition, I've added some tests taken from the big naughty list of strings.

laurinenas added a commit to laurinenas/cypress that referenced this issue Apr 28, 2019

cypress-io#3423 Enable Cyrpess to type strings containing reserved wo…
…rds (cypress-io#3903)

close cypress-io#3423 

I have make Cypress to be able to type some Javascript reserved words such as "hasOwnProperty" and "toString".  In addition, I've added some tests taken from the big naughty list of strings.
@cypress-bot

This comment has been minimized.

Copy link

commented May 17, 2019

Released in 3.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.