We can find all empty elements on the page or its parts using ":empty" CSS selector. Empty elements have no children elements and no text inside. We can also find all non-empty elements by combining ":not(:empty)" selectors. Here is an example from https://glebbahmutov.com/cypress-exam... recipe:
// find all elements using wildcard selector
cy.get('*').should('have.length', 7)
// find all empty elements and confirm their node names
cy.get(':empty').should('have.length', 2)
// cy.map comes from https://github.com/bahmutov/cypress-map
.map('nodeName')
.should('deep.equal', [...])
// find all non-empty elements
cy.get(':not(:empty)').should('have.length', 5)