skip to Main Content

I have a DOM element in ag-grid

<div class="ag-floating-bottom" ref="eBottom" role="presentation" 
  style="min-height:0px;height:0px; display:none;overflow-y:scroll;">

And when I select some filter from some column the grid is boil down to few rows only and this overflow-y attribute get changed to overflow-y:hidden from scroll

<div class="ag-floating-bottom" ref="eBottom" role="presentation" 
  style="min-height:0px;height:0px; display:none;overflow-y:hidden;">

I want to put wait on this attribute overflow-y till it get change to hidden

2

Answers


  1. You can check what the element declares using the "have.css" assertion, something like this:

    cy.get('div[ref="eBottom"]')
      .should('have.css', 'overflow-y', 'hidden')  // retry until scroll becomes hidden
    
    Login or Signup to reply.
  2. .should will retry until the condition is met and you can also pass timeout in get if it takes longer than your default timeout

    cy.get('div[ref="eBottom"]', {timeout: 90000}).should('have.css', 'overflow-y', 'hidden')

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search