samedi 4 mars 2017

Check if one of divs contains my values in nightwatch

I have problem with testing my webapp with nightwatch.js. I need to iterate over all div elements on the page to check if there is the one who contains all child elements I added before. For example I have:

<div className = 'myclass'>
    <h2> text1 </h2>
    <h3> second_text1 </h3>
</div>
<div className = 'myclass'>
    <h2> text2 </h2>
    <h3> second_text2 </h3>
</div>

And I want to check if one of divs contains both: 'text2' and 'second_text2'. I tried to add iter function like here: Assert text value of list of webelements using nightwatch.js but I don't know how to check child elements in this div and assert only if none of divs contains my values.

Aucun commentaire:

Enregistrer un commentaire