Comments (6)
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.
Curently error that i got when try to replicate your comments. Can you please take a look?
from cypress-shadow-dom.
@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.
And regarding .type
command itself – it may appear that it'll work only with passing force: true
option
from cypress-shadow-dom.
@all-contributors add @sangmai350 for bug
from cypress-shadow-dom.
I've put up a pull request to add @sangmai350! 🎉
from cypress-shadow-dom.
Related Issues (20)
- [Bug] HOT 2
- [Bug] shadowTrigger fails with options parameter HOT 7
- [Bug] TypeError: Cannot read property 'shadowRoot' of undefined HOT 7
- [Bug] - cannot find items in light dom of host elements HOT 4
- [Bug] shadowContains does not retry if the item is not found
- [Bug] - retry-ability with dynamically added elements is not working HOT 1
- [Feature] add comprehensive testing suite
- [Feature] - add support for aliasing
- [Feature] - override $.contains to work with shadow trees
- [Bug] - shadowClick is not working for me HOT 6
- shadowFind works with cypress runner but doesn't work when run in the command line HOT 1
- [Feature] .shadowContains should accept RegEx HOT 1
- [Feature] - shadowType accept special characters HOT 4
- [Bug] Chaining .should throws an error. HOT 3
- [Feature] Add support to mimic cy.check and cy.select
- Cypress shadow dom Not working headless
- shadowEq method enhancement HOT 1
- [Feature] add typescript definition file HOT 1
- Cypress 4.x.x support? HOT 1
- [Feature] Allow the retrieval of regular DOM elements from nodes that contain a Shadow DOM
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress-shadow-dom.