ruby - Verify there is at least one table row on the page containing an arbitrary number of strings -


easier explained pseudocode in opinion:

page.all('tr').each |tr|     if tr.has_text?(string1) , tr.has_text?(string2) # , on...         # pass test!     end end # else fail test 

does there exist effective way perform test using capybara , ruby/cucumber?

the following should you're trying do

strings = [string1, string2, ...] found = page.all('tr').any? |tr|   strings.all? { |s| tr.has_text?(s, wait: 0) } end expect(found).to true 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -