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

Max Call Stack when trying to type in an input field type='text' #2339

Closed
achatt89 opened this issue Aug 14, 2018 · 8 comments
Closed

Max Call Stack when trying to type in an input field type='text' #2339

achatt89 opened this issue Aug 14, 2018 · 8 comments
Labels
type: duplicate This issue or pull request already exists

Comments

@achatt89
Copy link

achatt89 commented Aug 14, 2018

Current behavior:

I am working with web components, where I have managed to get to the desired input element using a DOM based helper function.
With the found desired DOM element, I am using cy.wrap(elementName) and then trying to type something in using cy.wrap(elementName).type('some info') which is resulting in rangeError: Maximum call stack size exceeded.

Not sure why.
Here's the screenshot of the same:

image

Console Log of the helper function output (which returns the desired element):
image

The reason I am using helper function to traverse through the DOM is because Cypress seems to have a limitation in traversing through the shadow-dom,

Code for the same:

        cy.document().then((document) => {
            todoAppElement = shadowDOMFind(document, ['input']);
            console.log(todoAppElement);
            cy.wrap(todoAppElement).type('Some Information');
        })

I am able to use cy.get('custom-component-name') and get the results as long as there's no shadow-dom involved.

Desired behavior:

It should be able to type on the textfield.

Steps to reproduce:

No Steps to Reproduce as Such

Versions

  • Cypress Package Version: 3.0.3
  • Cypress Binary Version: 3.0.3
  • Node: v8.9.4
  • OS: Windows 7
  • Browser: Chrome
@chrisbreiding
Copy link
Contributor

This is a known issue with shadow dom. We plan to bake in proper support for shadow dom eventually, but it hasn't been prioritized as of yet. Make sure to 👍 that issue, since we take that into account when planning what to work on next.

@chrisbreiding chrisbreiding added the type: duplicate This issue or pull request already exists label Aug 14, 2018
@achatt89
Copy link
Author

Would you know by when will it be possible to support it?
Maybe if possible, I can work on it and submit the code for review?

@chrisbreiding
Copy link
Contributor

I don't know when it will be prioritized. We're currently hiring so that we'll have more developers to tackle things like this.

It would be great if you'd like to work on it and submit a pull request.

@achatt89
Copy link
Author

@chrisbreiding That sounds good.. I will work on it and send the request. Is there any documentation to start off? Any guidelines for contribution?

@chrisbreiding
Copy link
Contributor

I'd start with our contributing doc.

@adamclerk
Copy link

I'm curious what package would contain this functionality?

@chrisbreiding
Copy link
Contributor

It's in the driver package. type.coffee is a good place to start. It's where cy.type() is implemented.

@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label Feb 20, 2019
@jennifer-shehane jennifer-shehane removed the stage: ready for work The issue is reproducible and in scope label Feb 20, 2019
@jennifer-shehane
Copy link
Member

jennifer-shehane commented Jun 9, 2020

We've added experimental shadow DOM support through the experimentalShadowDomSupport configuration option.

To use it, update to Cypress 4.8.0 and pass the following to your configuration file or however you pass in configuration.

{
  "experimentalShadowDomSupport": true
}

See the Experiments for more information including how to use the new .shadow() command and includeShadowDom option.

This is still experimental, so we'd like your help working through any bugs or unexpected behavior before releasing into the main product. If you encounter any issues using the new experimental shadow DOM feature, please open a new issue, filling in the issue template and providing a reproducible example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants