("XWalkContent css:'p' {textContent CONTAINS 'Michael Buble'}").count # which counts how many 'Michael Buble' is listed.
result= 3
I want to make sure i have a line of calabash-android command that will look at the result '3' and validates it matches the total list populated on top on the search result page.
Is this doable ?
expected = query('your query for the total comes here')
displayed = query("XWalkContent css:'p' {textContent CONTAINS 'Michael Buble'}").count
fail("There are not as many elements displayed as expected: Expected were #{expected} and displayed were #{displayed}") unless (expected.to_i == displayed)