Namely, I aim to test multiple queries inside a single element with Cypress.
Here is an example of an element I want to interact with:
<tr id="gZMZs190" class="z-listitem z-listbox-odd z-listitem-selected" title="CAN_BE_REPLACED_BY_2L -> [] - IQOS ILUMA One Kit Pebbe Grey [G0000592] - Tunisia Product Catalog : Staged" aria-label="Row 10 of 10, CAN_BE_REPLACED_BY_2L -> [] - IQOS ILUMA One Kit Pebbe Grey [G0000592] - Tunisia Product Catalog : Staged selected" aria-selected="true" role="row" aria-rowindex="10"><td id="gZMZy290" class="z-listcell" tabindex="-1"><div id="gZMZy290-cave" class="z-listcell-content"><div id="gZMZz290" class="ye-default-reference-editor-selected-item-container z-div"><span id="gZMZ_390" class="ye-default-reference-editor-selected-item-label ye-editor-disabled z-label">CAN_BE_REPLACED_BY_2L -> [] - IQOS ILUMA One Kit Pebbe Grey [G0000592] - Tunisia Product Catalog : Staged</span></div></div></td></tr>
So far I have used this Cypress command, and it works fine:
cy.get('.z-listitem')
.contains("G0000592");
This command successfully checks the product code. Although, our team would also want to check the level at which this product is set (for replacement) which we can see in this part of the element: CAN_BE_REPLACED_BY_2L ->