-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Labels
good first issueGood for newcomersGood for newcomerspkg/driverThis is due to an issue in the packages/driver directoryThis is due to an issue in the packages/driver directorytype: enhancementRequested enhancement of existing featureRequested enhancement of existing feature
Description
Current behavior:
cy.type
considers everything in {}
as modifier sequence. In our app we have embedded code runner. For testing we put there code from fixtures with cy.type
. And cy.type
throws CypressError: Special character sequence: '{...}' is not recognized
when code includes some braced expression.
Desired behavior:
Add option to cy.type
to not treat {}
as modifier sequence.
Versions
Cypress: 3.2.0
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomerspkg/driverThis is due to an issue in the packages/driver directoryThis is due to an issue in the packages/driver directorytype: enhancementRequested enhancement of existing featureRequested enhancement of existing feature
Activity
[-]Allow to ignore modifier sequences for type[/-][+]Allow to ignore modifier sequences for cy.type[/+]jennifer-shehane commentedon May 23, 2019
@WiseBird You can type
{{}
to type the literal{
key as shown in the docs, so this should work:Looks a little bit funky, but we had to choose some character, happened to be
{
WiseBird commentedon May 24, 2019
@jennifer-shehane Yes, I can escape them. But as I said we type source code, it can be quite big. You need to go through it and find all lines with both
{
}
and then escape. Replacing all{
with{{
wont work as if there is no}
cypress will type both characters.Wouldn't it be much easier to simply say that there is no control sequences?
jennifer-shehane commentedon May 24, 2019
We could probably add an option to type like, 'charSequences: false`. This will be pretty low priority for our team to work on though, since it is possible to achieve what is needed for this to work.
We are always welcome to pull requests.
Code for
.type()
: https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/cy/commands/actions/type.coffee#L24Tests for `.type(): https://github.com/cypress-io/cypress/blob/develop/packages/driver/test/cypress/integration/commands/actions/type_spec.coffee#L1143
[-]Allow to ignore modifier sequences for cy.type[/-][+]Allow to ignore special character sequences for cy.type[/+]WiseBird commentedon May 25, 2019
Sorry for my stupidity. While looking at tests I got how escaping really works.
43 remaining items