cypress

Access element whose parent is hidden - cypress.io

拈花ヽ惹草 提交于 2019-11-29 06:17:40
The question is as given in the title, ie, to access element whose parent is hidden. The problem is that, as per the cypress.io docs : An element is considered hidden if: Its width or height is 0. Its CSS property (or ancestors) is visibility: hidden. Its CSS property (or ancestors) is display: none. Its CSS property is position: fixed and it’s offscreen or covered up. But the code that I am working with requires me to click on an element whose parent is hidden, while the element itself is visible . So each time I try to click on the element, it throws up an error reading : CypressError: Timed

Cypress with SystemJS

我的未来我决定 提交于 2019-11-28 13:57:11
I am attempting to create some basic tests to try out the new Cypress library. In my test I have cy.visit('http://mywebsite.com'); which is loading an AngularJS app that uses SystemJS. If I understand Cypress correctly, I shouldn't have to do anything else and it will make sure the page is loaded before running anything else. However this doesn't seem to be working because the page is loaded, but SystemJS is still loading the modules. How can I get Cypress to wait for all the SystemJS modules to load before running any more tests without using cy.wait(5000) ? EDIT Thanks to Dwelle this is the

Cypress: Can I prevent Cypress cy.get from failing if no elements are found?

落爺英雄遲暮 提交于 2019-11-28 04:11:24
问题 I am using Cypress cy.get to grab elements, but if there are none, my test is failing. I do not want it to fail. I want it to continue. The test is simply to list the items that are there, if any. const listItemTitle = '[data-cy-component=list-item-title]'; cy.get(listItemTitle).each(($el, index, $list) => { cy.wrap($el).then(($span) => { const spanText = $span.text(); cy.log(`index: ` + index + ' ' + spanText); }); }); I would have thought, if there are no elements there - that this code

Cypress with SystemJS

风流意气都作罢 提交于 2019-11-27 08:09:32
问题 I am attempting to create some basic tests to try out the new Cypress library. In my test I have cy.visit('http://mywebsite.com'); which is loading an AngularJS app that uses SystemJS. If I understand Cypress correctly, I shouldn't have to do anything else and it will make sure the page is loaded before running anything else. However this doesn't seem to be working because the page is loaded, but SystemJS is still loading the modules. How can I get Cypress to wait for all the SystemJS modules