| From | Sent On | Attachments |
|---|---|---|
| Nathan Neff | Dec 5, 2010 6:49 pm | |
| Luke Daley | Dec 5, 2010 10:25 pm | |
| Nathan Neff | Dec 6, 2010 9:58 am | |
| Luke Daley | Dec 6, 2010 1:05 pm | |
| Nathan Neff | Dec 6, 2010 2:49 pm | |
| Luke Daley | Dec 7, 2010 4:42 am | |
| Nathan Neff | Dec 7, 2010 7:46 am |
| Subject: | Re: [geb-user] "Best" way to search siblings' text | |
|---|---|---|
| From: | Luke Daley (ld...@ldaley.com) | |
| Date: | Dec 5, 2010 10:25:34 pm | |
| List: | org.codehaus.geb.user | |
If siblings doesn't support the text predicate then it's a bug (please raise an
issue)
You can always use filter:
assert $("h3.reallynow").siblings("p").filter(text: ~/Dangle/).size() == 1
On 06/12/2010, at 12:49 PM, Nathan Neff <nath...@gmail.com> wrote:
Hello,
I'm trying to assert that http://enrollio.org has an <h3 class="reallynow"> with a sibling <p> element that contains "Dangle".
Example: <h3 class="reallynow">Version</h3> <p>0.2 "Dangle"</p>
I tried this at first:
assert $("h3.reallynow").siblings("p", text: ~/Dangle/).size() == 1
But, I mistakenly thought that the "siblings" method would accept "text:", but I think that it takes only attribute matchers.
So, the best I could do was:
Browser.drive("http://enrollio.org") {
assert $("h3.reallynow").siblings("p").find { it.text() =~ /Dangle/ }
}
Is this the most succinct query that I can come up with?
If anyone has a better way, then please let me know.
Thanks, --Nate
--------------------------------------------------------------------- To unsubscribe from this list, please visit:
--------------------------------------------------------------------- To unsubscribe from this list, please visit:





