A page contains a list of checkboxes:
<ul>
<li>
<div class="tree-node">
<span class="tree-checkbox tree-checkbox1"></span>
<span class="tree-title">foo</span>
</div>
</li>
<li>
<div class="tree-node">
<span class="tree-checkbox tree-checkbox0"></span>
<span class="tree-title">bar</span>
</div>
</li>
<ul>
Where .tree-checkbox1 renders a checked box, and .tree-checkbox0 renders an
unchecked one. In the above sample, foo is checked, and bar isn't.
I've written this module to interact with the checkbox entries:
class CheckboxItem extends Module {
static content = {
label { $(".tree-title").text() }
checkbox { $(".tree-checkbox") }
isChecked { checkbox.hasClass "tree-checkbox1" }
}
}
When I create an CheckboxItem object, I find I can access its label content, as
well as checkbox, but attempting to access isChecked yields:
groovy.lang.MissingPropertyException: Unable to resolve isChecked as content
for CheckboxItem, or as a property on its Navigator context. Is isChecked a
class you forgot to import?
Help?
--
You received this message because you are subscribed to the Google Groups "Geb
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/geb-user/a0f792ea-bedb-4786-b64f-49194eb1bbff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.