Skip to content

Tag: cypress

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 us…

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…

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.cypres…

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 …

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