Code Monkey home page Code Monkey logo

Comments (6)

abramenal avatar abramenal commented on May 19, 2024

HI @sangmai350
Thanks for submitting the first issue!

I believe the code you wrote is not quite correct as you're using regular cypress commands for lookup.
I believe it should look somehow like:

cy.shadowGet('iframe body .input .wrp input').type(''123123);

you can also try like

cy.shadowGet('iframe body .input .wrp input')
  .then($el => cy.wrap($el).type(''123123));

Please keep in mind if you have nested shadow elements, all of their selectors must appear in query for shadowGet – otherwise it'll be unable to get to their shadow roots.

Also, it might happen that cy.type command works with only elements attached to real DOM – in that case we'll need to implement a tiny custom command to support that. I would expect that case, but first need to ensure it's really needed, so please check that code example above and let me know if that works.

UPD: Alternative I thought about just letting cypress base commands to work not only with attached DOM elements, but that either may bring extra set of documentation about that or generally inconsistency (as not all the commands might be switched).

from cypress-shadow-dom.

sangmai350 avatar sangmai350 commented on May 19, 2024

Screenshot 2019-06-21 16 55 12

Curently error that i got when try to replicate your comments. Can you please take a look?

from cypress-shadow-dom.

abramenal avatar abramenal commented on May 19, 2024

@sangmai350
Right, totally forgot the context piece:
cy.document().shadowGet
so shadowGet works within the document context only (as per docs)

from cypress-shadow-dom.

abramenal avatar abramenal commented on May 19, 2024

And regarding .type command itself – it may appear that it'll work only with passing force: true option

from cypress-shadow-dom.

abramenal avatar abramenal commented on May 19, 2024

@all-contributors add @sangmai350 for bug

from cypress-shadow-dom.

allcontributors avatar allcontributors commented on May 19, 2024

@abramenal

I've put up a pull request to add @sangmai350! 🎉

from cypress-shadow-dom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.