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

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -