Sorry for the not-so-great title, but explaining briefly is tricky.
I'm currently automating on nightwatch and encountered a problem that has left me puzzled since I usually code in JS only for automation. Normally it's simple to verify if an element is present or not. However, this time I have an HTML element displaying search results and I need to confirm that those results only contain specific elements.
So, I need to ensure that all result-item
within the entity-results
div only display results with hint-val-fragment match
equal to -1000000.0
and hint-prop
equal to cpuLimit:
, using this example.
<div class="results" style="">
<div>
<div class="results-set-title">Results</div>
<div class="entity-results">
<div class="result-item">
<div class="result-item-label">
<div class="result-item-name">Resources</div>
<div class="result-item-source"><span>source:</span> <span>cz0</span></div>
</div>
<div class="result-item-hint">
<div class="hint-prop">cpuLimit:</div>
<div class="hint-val">
<div class="hint-val-fragment">
</div>
<div class="hint-val-fragment match">
-1000000.0
</div>
<div class="hint-val-fragment">
</div>
</div>
</div>
</div>
(Additional result items with similar structure)
</div>
</div>
</div>