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
Post a Comment