I have a div element like below,
<div>first, second, long text</div>
I want to check if this div element contains text 'first' and 'long text'.
To check for only string I use like below,
cy.get('div').should('contain', 'first');
cy.get('div').should('contain', 'long text');
The above two works. but now instead of writing two statements I want to combine into one statement.
Meaning I want to check if div element contains strings 'first' and 'long text'. So I have tried like below,
cy.get('div').should('contain', 'first, long text')
This fails because there is 'second' string between first and long text and hence fails.