[Webtest] Troubles with Grails plugin

mascis mascis <juho.piirto@gmail.com>
Thu, 3 Nov 2011 06:15:58 -0700 (PDT)


Hi,

You were too quick with your reply :)


Jonathan Rosenberg-2 wrote:
>=20
> Well, this work for me:
>=20
> config {
>   option(name: ThrowExceptionOnScriptError', value:'false')
> }
>=20
> So, I'm all out of ideas for you.
>=20
> --
> Jonathan Rosenberg
> Founder & Executive Director
> Tabby's Place, a Cat Sanctuary
> http://www.tabbysplace.org/
>=20
>=20
> On Thu, Nov 3, 2011 at 9:03 AM, mascis <juho.piirto@gmail.com> wrote:
>>
>> Hi,
>>
>> Thank you for your answer. I tried it this way:
>>
>> class UtilitiesWT extends WebTest {
>>
>> =C2=A0 =C2=A0void config()
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 an=
t.config(browser: 'FF3.6')
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 an=
t.option(name:'ThrowExceptionOnScriptError',
>> value:'false')
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>>
>> and:
>>
>> class MyTestWebTests extends grails.util.WebTest {
>>
>> =C2=A0 void testFirst() {
>>
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 UtilitiesWT util =3D new UtilitiesWT()
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 util.config()
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 do something...
>> =C2=A0 =C2=A0}
>> }
>>
>> That did not work unfortunately. I'm not sure how it's supposed to do if
>> you
>> want to make them in same file. void config() does not work and I also
>> tried
>> this:
>>
>> class MyTestWebTests extends grails.util.WebTest {
>>
>> =C2=A0 void testFirst() {
>>
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0config {
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 an=
t.option(name:'ThrowExceptionOnScriptError',
>> value:'false')
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 do something...
>> =C2=A0 =C2=A0}
>> }
>>
>> This did not work either. I tried those without ant. in the beginning of
>> opiton also.
>>
>>
>>
>> mascis wrote:
>>>
>>> Neither of them seems to be working. This:
>>> ant.config(ThrowExceptionOnScriptError: 'false') causes that tests won'=
t
>>> run and option(name:'ThrowExceptionOnScriptError', value:'false') does
>>> not
>>> work because WebTest assumes that this is a command and there is no
>>> command called "option". I also tried
>>> ant.option(name:'ThrowExceptionOnScriptError', value:'false') and
>>> several
>>> other combinations of commands mentioned earlier but I just can't get i=
t
>>> work.
>>>
>>>
>>> Jonathan Rosenberg-2 wrote:
>>>>
>>>> Try this
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 config {
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 option(name:'T=
hrowExceptionOnScriptError',
>>>> value:'false')
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>>>>
>>>> --
>>>> Jonathan Rosenberg
>>>> Founder & Executive Director
>>>> Tabby's Place, a Cat Sanctuary
>>>> http://www.tabbysplace.org/
>>>>
>>>>
>>>> On Tue, Nov 1, 2011 at 5:36 AM, Murat <murat.knecht@googlemail.com>
>>>> wrote:
>>>>> Hey,
>>>>>
>>>>> did you try matching the case of your Groovy configuration to that of
>>>>> your XML configuration, i.e.
>>>>>
>>>>> ant.config(ThrowExceptionOnScriptError: 'false' )
>>>>>
>>>>> ?
>>>>>
>>>>> In Groovy, we re-use the XML config, so the properties will be exactl=
y
>>>>> the same. Like so:
>>>>>
>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0def props =3D new Properties()
>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0props.load(new FileInputStream(f.path))
>>>>>
>>>>>
>>>>> Regards
>>>>> murat
>>>>>
>>>>>
>>>>> 2011/11/1 mascis <juho.piirto@gmail.com>:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> A new problem. I have to run tests so that WebTest ignores JS-errors=
.
>>>>>> In
>>>>>> xml-tests it can be done putting in config
>>>>>>
>>>>>> <option name=3D"ThrowExceptionOnScriptError" value=3D"false" />
>>>>>>
>>>>>> but I can't make it work with groovy. There is config file
>>>>>> webtest.properties and I tried putting there lines like
>>>>>>
>>>>>> wt.option.throwexceptiononscripterror =3D false
>>>>>> or
>>>>>> wt.config.throwexceptiononscripterror =3D false
>>>>>>
>>>>>> but those did not help. I made a separete config function also like
>>>>>>
>>>>>> =C2=A0void config()
>>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ant.config(browser: 'FF3.6')
>>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ant.config(protocol: 'https' )
>>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ant.option(throwexceptiononscripterror: 'false' )
>>>>>> (or
>>>>>> ant.config(...))
>>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ant.config(autorefresh: 'true')
>>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>>>>>>
>>>>>> this did not help either though this changed browser to FF3.6 so the
>>>>>> function works. Any ideas about this one?
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://old.nabble.com/Troubles-with-Grails-plugin-tp32751470p3275747=
4.html
>>>>>> Sent from the WebTest mailing list archive at Nabble.com.
>>>>>>
>>>>>> _______________________________________________
>>>>>> WebTest mailing list
>>>>>> WebTest@lists.canoo.com
>>>>>> http://lists.canoo.com/mailman/listinfo/webtest
>>>>>>
>>>>> _______________________________________________
>>>>> WebTest mailing list
>>>>> WebTest@lists.canoo.com
>>>>> http://lists.canoo.com/mailman/listinfo/webtest
>>>>>
>>>> _______________________________________________
>>>> WebTest mailing list
>>>> WebTest@lists.canoo.com
>>>> http://lists.canoo.com/mailman/listinfo/webtest
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Troubles-with-Grails-plugin-tp32751470p32772658.ht=
ml
>> Sent from the WebTest mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> WebTest mailing list
>> WebTest@lists.canoo.com
>> http://lists.canoo.com/mailman/listinfo/webtest
>>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>=20
>=20

--=20
View this message in context: http://old.nabble.com/Troubles-with-Grails-pl=
ugin-tp32751470p32772738.html
Sent from the WebTest mailing list archive at Nabble.com.