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
Closed

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

reno1979 opened this issue Feb 11, 2019 · 6 comments

Comments

@reno1979
Copy link

@reno1979 reno1979 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
Copy link
Author

@reno1979 reno1979 commented Feb 11, 2019

Same with these values

toLocaleString
toString
valueOf

The JavaScript object prototype functions ....

@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Feb 12, 2019

Yes, lol, this is happening.

@clarmso
Copy link
Contributor

@clarmso clarmso 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
Copy link
Member

@jennifer-shehane jennifer-shehane 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
Copy link

@cypress-bot cypress-bot bot 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
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
…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
Copy link

@cypress-bot cypress-bot bot 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants