Changed content template to "checked". Changed call to ".checked", but
to no avail.
A side (but important) note: I'm getting the failure when attempting to use
geb through an interactive console (intellij idea / groovy console). The
motivation for this is to be able to trial stuff, w/o the overhead of
re-running a test every time I change something. My experience so-far is
that that testing is quite unstable, and results may differ from an actual
test.
So the point I'm driving at: would be good to consolidate a set of
instructions on how to correctly use geb in an interactive session. I've
found some stuff on the web that I couldn't get to work, and am currently
having limited success with the below.
Here's what I paste into the console:
import geb.Browser
//rest of my imports here
Browser.drive {
//some geb stuff I wish to test
}
On Thursday, August 17, 2017 at 5:30:52 PM UTC+10, Marcin Erdmann wrote:
>
> 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]
> <javascript:>> 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] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> 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/a9859083-7a41-4a81-862b-b9abdf875338%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.