This Github thread highlights how to use Cypress to assert an element has a specified height.
cy.get(mainMenu).should('have.css', 'height', '55px')
How do I use Cypress to assert an element is greater than a specified height?
For example, I want to assert that a certain HTML element always has a height greater than 100px.
This Github thread highlights how to use Cypress to assert an element has a specified height.
cy.get(mainMenu).should('have.css', 'height', '55px')
How do I use Cypress to assert an element is greater than a specified height?
For example, I want to assert that a certain HTML element always has a height greater than 100px.
Share Improve this question asked Oct 27, 2019 at 2:01 ptkptk 7,66317 gold badges53 silver badges106 bronze badges1 Answer
Reset to default 11cy.get(mainMenu).invoke('height').should('gte', 55)
invoke() - to call a jquery function on an element which is the height.
gte (aka. least) - to assert the target is equal or greater than a given value