Skip to content
Advertisement

Tag: cypress

Two new urls but second one missing path variable in Cypress

Maybe a bit difficult to explain but I have the following issue. I have created a link and Cypress wants to click it, but it seems to click it twice. The second time the path variable is missing (the ID of an incident) and now it stores ‘undefined’ as incident ID, while the ID is ‘458868’ Does anyone why it

Cypress Best Practice – Store and compare two values

I want to store a value, then perform an action and assert that the value has not changed. I do have a code that works but I would like to have input if there is a more elegant solution. The basic idea is: Get the number or results displayed (‘counts’), store it in a .then() function Change the use Get

Using async await in Cypress

I’m very new in Cypress and I’m trying to take a value from an element to use after in the test, but I can’t manage to get the value. Someone said that I need to use async await, but it is not working or maybe I’m doing something wrong. Thanks in advance! Answer You can use aliases and save the

How to overcome hover issue in Cypress?

I faced Cypress hover problem regarding access to a sub menu appearing after hovering on main menu item. The error is This element is not visible because it has CSS property: position: fixed and it’s being covered by another element:. I tried to use workarounds recommended by Cypress https://docs.cypress.io/api/commands/hover#Workarounds but did not succeed. Cypress documentation says “Using .trigger() will only

Cypress cant seem to find any elements inside the iframe

I am trying to access elements within my iframe following the tips listed in this article here, but for some reason cypress cannot seem to find anything in the iframe. Here is my test code And this is my iframe <iframe data-cy=”iframe” title=”iframe” style={{ height: ‘100%’, width: ‘100%’ }} src={url} /> Finally this is what I have in my cypress.json

Cypress: if element exist then do something

I am having a problem with if element exist then do something. As an example: the problem here is that cypress aborts the test if the button doesn’t exist but that’s exactly when cypress shouldn’t abort, it should do nothing and continue. I need a solution for Answer One way you do it is to get the parent of the

cypress-file-upload attachFile is not a function

I want to test my file uploading function using Cypress-file-upload but I hurt myself against .attachFile is not a function I tried two solutions and I still can’t make it works : What am I doing wrong ? Answer You have to import the package: support/index.js

Advertisement