I suspect it's because an "is" can be used as a method prefix for boolean
getters in Groovy (same way as "get" can be used as prefix for any getter)
so the content is actually visible under "checked" and not "isChecked". Try
changing the content name or accessing it using "checked" instead of
"isChecked".

On Wed, Aug 16, 2017 at 1:36 PM, Samuel Rossinovic <
[email protected]> wrote:

> 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
> <https://groups.google.com/d/msgid/geb-user/a0f792ea-bedb-4786-b64f-49194eb1bbff%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CA%2B52dQRv7KMv%2BPoiQu_738-U-cOmjYxfiJFPuDT4Pww3MOzmVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to