Here is the assertion in question:
cy.get('[data-cy="myElement"] > path')
.should('be.visible')
The error encountered is as follows:
After waiting for 12000ms, the following error occurred: expected '' to be 'visible'
This element is not visible due to its CSS property: position: fixed and it being covered by another element:
<svg class="coveringElement" focusable="false" aria-hidden="true" viewBox="0 0 24 24" name="large">...</svg>
Past solutions have tackled issues with .get
and .click
, but none specifically addressed the failure caused by the position: fixed
property.
Objective:
To successfully assert that the element is visibly present within the application.
Additional insights:
- The element I am validating is typically visible when using the app and is not obscured visually.
- These elements are contained within a dialog box.
- If I use 'exists' instead of 'visible', the assertion passes.
- Efforts to utilize
.invoke
to conceal the covering element yielded no results.