FluentAutomation
FluentAutomation copied to clipboard
Assert any element has the text
In order to assert on element's text I do the following:
I.Assert.Text("expected text").In(".row");
Now, I want to find multiple elements and assert that any of them has the text. I found a way to do it using .FindMultiple
:
var texts = I.FindMultiple(".row").Elements.Select(el => el.Item2().Text);
I.Assert.True(() => texts.Any(t => t.Contains("expected text")));
Am I right there is no cleaner way to do it?