jaysunsyn / cypress-daywalker Goto Github PK
View Code? Open in Web Editor NEWWeb Components and Shadow DOM support for cypress
License: GNU General Public License v3.0
Web Components and Shadow DOM support for cypress
License: GNU General Public License v3.0
I can't seem to be able to get an element that was rendered as slotted content.
Here is an example of trying to get the label of a paper-input:
cy.get('paper-input paper-input-container label');
I can successfully get the paper-input-container, but not the label element.
Since our back-and-forth yesterday in the Cypress repo, I'm now trying get the example specs to run properly. I hadn't updated Node.js yet yesterday, I've now done that as well. So I'm now running on the latest Node.js, Cypress and your plugin. This is what's happening for me when I run the example specs twice:
Timeouts, errors and the second run resulted in an infinite loop where the first run didn't. These are the exact steps I've taken:
git clone https://github.com/JaySunSyn/cypress-daywalker.git
cd cypress-daywalker\example
npm i
npm test
Click on example_spec js in Cypress window
(wait for tests to complete)
Click the reload button in the browser
Also, I noticed in your screen gif is that all tests take just under 15 seconds to complete, while one run for me takes over 90 seconds. I'm running on a high-end business laptop, it's a three month old Dell Latitude 5591 with 16GB RAM, 2.60GHz i7, SSD, all great specs. I don't understand the massive difference.
https://docs.cypress.io/guides/references/configuration#Options
In the options, you can includeShadowDom
for cy.get()
commands. I had no idea that option existed, but it is set to false
for a default.
I have not tried using that setting, but I wanted to ask how that update affects this project. Does this project have more functionality?
Hey there,
Nice work on the plugin!
I have a question about handling the Spring Security login screen.
In my before function, I have to log in to the application but your plugin throws an exception:
This is the code I use:
before(function() {
cy.visit('http://localhost:8080');
cy.get('[name=username]').type('user');
cy.get('[name=submit]').click();
})
Cypress throws:
TypeError: Cannot read property 'store' of undefined
Do I need to disable your plugin on the login page?
Thanks in advance.
Regards
I just try to get started with daywalker.
I have a vaadin-text-field with an id. Inside of that custom element I need to type into a textfield of the shadow dom. When I try
cy.get('#nameField input').type("TEST")
it does not find the input. I guess I am getting something completely wrong and really would appreciate a little help :)
CypressError: Timed out retrying: Expected to find element: '#nameField input', but never found it.
I added daywalker like suggested in support/commands.js
Injecting script from CDN using Angular 8 (Ionic 4 webcomponents).
Appears to be an issue with angular/custom elements (angular/angular#24556).
Solution suggests ensure tsconfig set to target es2015, however I found I also needed to inject custom-elements-es5-adapter
script after injecting daywalker. i.e.
const script1 = w.document.createElement("script");
script1.src =
"https://cdn.jsdelivr.net/gh/jaysunsyn/[email protected]/cypress-daywalker.js";
const script2 = w.document.createElement("script");
script2.src =
"https://unpkg.com/@webcomponents/[email protected]/custom-elements-es5-adapter.js";
w.document.querySelector("head").appendChild(script1);
w.document.querySelector("head").appendChild(script2);
So likely not a bug in daywalker, but might be of use to others
First of all, thank you for starting this project!
Doing acceptance tests for apps with custom elements is a real pain.
I took your plugin for a spin and quickly run into this issue:
I am fully aware that this error is to be expected at this stage. I just want to know if you think it's possible to make this work?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.