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

Created on 11 Feb 2019  ·  6Comments  ·  Source: cypress-io/cypress

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

1️⃣ pkdriver bug

Most helpful comment

Yes, lol, this is happening.

All 6 comments

Same with these values

toLocaleString
toString
valueOf

The JavaScript object prototype functions ....

Yes, lol, this is happening.

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.

@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.

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.

Released in 3.3.0.

Was this page helpful?
0 / 5 - 0 ratings