I need to assert that a <table> element contains both a nested <thead> and a <tbody> element.
Sure, an obvious solution would be sth. like this:
cy.get('table')
.find('thead')
cy.get('table')
.find('tbody')
but isn't there a simple way to to that all in one chain? Like this:
cy.get('table')
.should('contain.element','thead')
.should('contain.element','tbody')
Unfortunatelly there is no such contain.element.
I know, there is .should('contain.html','...') but it doesn't work for me because this would require me to specify the full html string including nested content (with tr, td). I only want to assert that both child elements thead and tbody are existing.