Re: [6.5] testing Ajax stuff

2013-01-31 Thread Pierre Goupil
OK, I'll do it ASAP!


On Thu, Jan 31, 2013 at 11:33 PM, Martin Grigorov wrote:

> File a ticket please.
> Preferably with a patch, or at least a test case.
>
>
> On Thu, Jan 31, 2013 at 11:25 PM, Pierre Goupil  >wrote:
>
> > That's it! What a shame to be forced to manipulate the Ajax response by
> > hand to test this... Anyway, it is possible!
> >
> >
> > On Thu, Jan 31, 2013 at 7:36 PM, Pierre Goupil  > >wrote:
> >
> > > Good idea! So you think this comes from the CDATA section too: funny...
> > >
> > >
> > > On Thu, Jan 31, 2013 at 7:33 PM, Andrea Del Bene  > >wrote:
> > >
> > >> I think you should extract the HTML from CDATA section. I've run a
> test
> > >> with the response you wrote in your email and if I get rid of outer
> > tags it
> > >> works fine.
> > >>
> > >>  
> > >>> 
> > >>> 
> > >>>
> > >>
> > >>
> > >>
> > --**--**-
> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<
> > users-unsubscr...@wicket.apache.org>
> > >> For additional commands, e-mail: users-h...@wicket.apache.org
> > >>
> > >>
> > >
> > >
> > > --
> > > "Parce que c'est la nuit qu'il est beau de croire à la lumière."
> > >
> > > Edmond Rostand
> > >
> >
> >
> >
> > --
> > "Parce que c'est la nuit qu'il est beau de croire à la lumière."
> >
> > Edmond Rostand
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com 
>



-- 
"Parce que c'est la nuit qu'il est beau de croire à la lumière."

Edmond Rostand


Re: [6.5] testing Ajax stuff

2013-01-31 Thread Martin Grigorov
File a ticket please.
Preferably with a patch, or at least a test case.


On Thu, Jan 31, 2013 at 11:25 PM, Pierre Goupil wrote:

> That's it! What a shame to be forced to manipulate the Ajax response by
> hand to test this... Anyway, it is possible!
>
>
> On Thu, Jan 31, 2013 at 7:36 PM, Pierre Goupil  >wrote:
>
> > Good idea! So you think this comes from the CDATA section too: funny...
> >
> >
> > On Thu, Jan 31, 2013 at 7:33 PM, Andrea Del Bene  >wrote:
> >
> >> I think you should extract the HTML from CDATA section. I've run a test
> >> with the response you wrote in your email and if I get rid of outer
> tags it
> >> works fine.
> >>
> >>  
> >>> 
> >>> 
> >>>
> >>
> >>
> >>
> --**--**-
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<
> users-unsubscr...@wicket.apache.org>
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > "Parce que c'est la nuit qu'il est beau de croire à la lumière."
> >
> > Edmond Rostand
> >
>
>
>
> --
> "Parce que c'est la nuit qu'il est beau de croire à la lumière."
>
> Edmond Rostand
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


Re: [6.5] testing Ajax stuff

2013-01-31 Thread Pierre Goupil
That's it! What a shame to be forced to manipulate the Ajax response by
hand to test this... Anyway, it is possible!


On Thu, Jan 31, 2013 at 7:36 PM, Pierre Goupil wrote:

> Good idea! So you think this comes from the CDATA section too: funny...
>
>
> On Thu, Jan 31, 2013 at 7:33 PM, Andrea Del Bene wrote:
>
>> I think you should extract the HTML from CDATA section. I've run a test
>> with the response you wrote in your email and if I get rid of outer tags it
>> works fine.
>>
>>  
>>> 
>>> 
>>>
>>
>>
>> --**--**-
>> To unsubscribe, e-mail: 
>> users-unsubscribe@wicket.**apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> "Parce que c'est la nuit qu'il est beau de croire à la lumière."
>
> Edmond Rostand
>



-- 
"Parce que c'est la nuit qu'il est beau de croire à la lumière."

Edmond Rostand


Re: [6.5] testing Ajax stuff

2013-01-31 Thread Pierre Goupil
Good idea! So you think this comes from the CDATA section too: funny...


On Thu, Jan 31, 2013 at 7:33 PM, Andrea Del Bene wrote:

> I think you should extract the HTML from CDATA section. I've run a test
> with the response you wrote in your email and if I get rid of outer tags it
> works fine.
>
>  
>> 
>> 
>>
>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
"Parce que c'est la nuit qu'il est beau de croire à la lumière."

Edmond Rostand


Re: [6.5] testing Ajax stuff

2013-01-31 Thread Andrea Del Bene
I think you should extract the HTML from CDATA section. I've run a test 
with the response you wrote in your email and if I get rid of outer tags 
it works fine.







-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: [6.5] testing Ajax stuff

2013-01-31 Thread Pierre Goupil
After various tries, I must admit my failure.

Here is the Ajax response that I want to test against:





I've stripped down irrelevant parts. But see the 2  tags with class
"nav-thumb"?.

Now, Here is my test code:

final List tagTester =
TagTester.createTagsByAttribute(HomePageTest.tester.getLastResponseAsString(),
"class", "nav-thumb", false);
Assert.assertNotNull(tagTester);
Assert.assertEquals(7, tagTester.size());

It fails with:

java.lang.AssertionError: expected:<2> but was:<0>

What I think is that since I add my component  to my AjaxRequestTarget not directly with add() but using
its parent, then the TagTester can't find it. Just a wild guess, though.

To explain a bit more what I mean: since my component to update via Ajax is
complicated (ListViews and other stuff), I do it like that:

parent.addOrRemove(new Gallery(gallery"));
target.add(parent);

AFAIK this is idiomatic Wicket, but in my case it looks like this is what
has me stuck. Maybe I'm wrong here but if anybody knew a way to retrieve my
two  tags with class "nav-thumb" in an Ajax update, that would be
great.

Thanks in advance,

Pierre


On Thu, Jan 31, 2013 at 5:12 PM, Pierre Goupil wrote:

> !!!
>
> It looks like I made a mistake: getLastResponseAsString do give the last
> Ajax response. I thought you were speaking about
> getLastResponse().getDocument() which doesn't take Ajax into account.
>
> Thanks, I'll look for that!
>
> Regards,
>
> Pierre
>
>
> On Thu, Jan 31, 2013 at 4:44 PM, Pierre Goupil wrote:
>
>> Yes, I could but in fact it returns the last non-Ajax response. I see it
>> when providing it to TagTester#createTagsByAttribute.
>>
>> Thank you anyway.
>>
>>
>> On Thu, Jan 31, 2013 at 4:38 PM, Andrea Del Bene wrote:
>>
>>> Hi,
>>>
>>> I haven't tested it but I think you could get the last response from
>>> WicketTester (with getLastResponse or getLastResponseAsString), then you
>>> should be able to search your attributes inside the response.
>>>
>>>  Good afternoon,

 I'd like to test an Ajax response. More precisely, I'd like to get the
 list
 of HTML tags which attributes have a given value.

 I know of TagTester#**createTagsByAttribute but it looks like it is for
 non-Ajax only, correct me if I'm wrong.

 Is there any way to do that in a Wicket 6 unit test?

 Thanks and regards,

 Pierre




>>>
>>> --**--**
>>> -
>>> To unsubscribe, e-mail: 
>>> users-unsubscribe@wicket.**apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>>
>> --
>> "Parce que c'est la nuit qu'il est beau de croire à la lumière."
>>
>> Edmond Rostand
>>
>
>
>
> --
> "Parce que c'est la nuit qu'il est beau de croire à la lumière."
>
> Edmond Rostand
>



-- 
"Parce que c'est la nuit qu'il est beau de croire à la lumière."

Edmond Rostand


Re: [6.5] testing Ajax stuff

2013-01-31 Thread Pierre Goupil
!!!

It looks like I made a mistake: getLastResponseAsString do give the last
Ajax response. I thought you were speaking about
getLastResponse().getDocument() which doesn't take Ajax into account.

Thanks, I'll look for that!

Regards,

Pierre


On Thu, Jan 31, 2013 at 4:44 PM, Pierre Goupil wrote:

> Yes, I could but in fact it returns the last non-Ajax response. I see it
> when providing it to TagTester#createTagsByAttribute.
>
> Thank you anyway.
>
>
> On Thu, Jan 31, 2013 at 4:38 PM, Andrea Del Bene wrote:
>
>> Hi,
>>
>> I haven't tested it but I think you could get the last response from
>> WicketTester (with getLastResponse or getLastResponseAsString), then you
>> should be able to search your attributes inside the response.
>>
>>  Good afternoon,
>>>
>>> I'd like to test an Ajax response. More precisely, I'd like to get the
>>> list
>>> of HTML tags which attributes have a given value.
>>>
>>> I know of TagTester#**createTagsByAttribute but it looks like it is for
>>> non-Ajax only, correct me if I'm wrong.
>>>
>>> Is there any way to do that in a Wicket 6 unit test?
>>>
>>> Thanks and regards,
>>>
>>> Pierre
>>>
>>>
>>>
>>>
>>
>> --**--**-
>> To unsubscribe, e-mail: 
>> users-unsubscribe@wicket.**apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> "Parce que c'est la nuit qu'il est beau de croire à la lumière."
>
> Edmond Rostand
>



-- 
"Parce que c'est la nuit qu'il est beau de croire à la lumière."

Edmond Rostand


Re: [6.5] testing Ajax stuff

2013-01-31 Thread Pierre Goupil
Yes, I could but in fact it returns the last non-Ajax response. I see it
when providing it to TagTester#createTagsByAttribute.

Thank you anyway.


On Thu, Jan 31, 2013 at 4:38 PM, Andrea Del Bene wrote:

> Hi,
>
> I haven't tested it but I think you could get the last response from
> WicketTester (with getLastResponse or getLastResponseAsString), then you
> should be able to search your attributes inside the response.
>
>  Good afternoon,
>>
>> I'd like to test an Ajax response. More precisely, I'd like to get the
>> list
>> of HTML tags which attributes have a given value.
>>
>> I know of TagTester#**createTagsByAttribute but it looks like it is for
>> non-Ajax only, correct me if I'm wrong.
>>
>> Is there any way to do that in a Wicket 6 unit test?
>>
>> Thanks and regards,
>>
>> Pierre
>>
>>
>>
>>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
"Parce que c'est la nuit qu'il est beau de croire à la lumière."

Edmond Rostand


Re: [6.5] testing Ajax stuff

2013-01-31 Thread Andrea Del Bene

Hi,

I haven't tested it but I think you could get the last response from 
WicketTester (with getLastResponse or getLastResponseAsString), then you 
should be able to search your attributes inside the response.

Good afternoon,

I'd like to test an Ajax response. More precisely, I'd like to get the list
of HTML tags which attributes have a given value.

I know of TagTester#createTagsByAttribute but it looks like it is for
non-Ajax only, correct me if I'm wrong.

Is there any way to do that in a Wicket 6 unit test?

Thanks and regards,

Pierre






-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org