You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by thobile <nn...@gmail.com> on 2010/11/03 10:58:57 UTC

Wicket Tester

Hi Everyone

I am having a problem in refreshing wickettester page, is there anyone who
can help me. I have tried few examples from the net but I failed. Thank you
in advance
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Tester-tp3025082p3025082.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: Wicket Tester

Posted by Martin Grigorov <mg...@apache.org>.
You can't make anything Javascript specific with WicketTester.
I.e. clicking the link you assume that the confirmation passed successfully.

On Wed, Nov 3, 2010 at 12:37 PM, thobile <nn...@gmail.com> wrote:

>
> I have the following code:
>
> Wicket Page Code:
> Link<SdInternshipIntakeSummary> deleteLink = new
> Link<SdInternshipIntakeSummary>(
> DELETE_LINK, item.getModel()) {
>
> private static final long serialVersionUID = 1L;
>
> @Override
> public void onClick() {
> SdInternshipIntakeSummary selected = getModelObject();
> ((InternshipMaintenancePage) getPage()).deleteIntake(selected);
> }
> };
> deleteLink.add(new SimpleAttributeModifier(
> "onclick",
> "return confirm('Are you sure you want to delete Internships Intake
> Summary?');"));
>
> I want to test this component using wicket tester, I have the following
> code:
>
> Wicket Tester Code
>
> //checking listview size
> ListView listView1 = (ListView)
>
> getWicketTester().getComponentFromLastRenderedPage("intake-summary-report-panel:intake-summary-table");
> // int initialSize = listView1.size();
>
> //click delete link
>
> getWicketTester().clickLink("intake-summary-report-panel:intake-summary-table:0:delete-link");
>
> //checking listview size after I have deleted the record
> ListView listView2 = (ListView)
>
> getWicketTester().getComponentFromLastRenderedPage("intake-summary-report-panel:intake-summary-table");
> // int secondSize = listView2.size();
>
> //checking if the Listview size is updated
> Assert.assertEquals(listView2.size(), (initialSize - 1));
>
> Please help is there anything that I am missing, note this link is not Ajax
>
> How do we navigate to SimpleAttributeModiffier using Wickettester
> because it seems as if I need to confirm firts  before the page can be
> updated
>
>
> On Wed, Nov 3, 2010 at 12:46 PM, Martin Grigorov-4 [via Apache Wicket]
> <ml...@n4.nabble.com>>
> wrote:
> > tell us what exactly you want to do
> > what did you tried ?
> >
> > On Wed, Nov 3, 2010 at 10:58 AM, thobile <[hidden email]> wrote:
> >
> >>
> >> Hi Everyone
> >>
> >> I am having a problem in refreshing wickettester page, is there anyone
> who
> >> can help me. I have tried few examples from the net but I failed. Thank
> >> you
> >> in advance
> >> --
> >> View this message in context:
> >>
> >>
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Tester-tp3025082p3025082.html
> >> Sent from the Forum for Wicket Core developers mailing list archive at
> >> Nabble.com.
> >>
> >
> >
> > ________________________________
> > View message @
> >
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Tester-tp3025082p3025137.html
> > To unsubscribe from Wicket Tester, click here.
> >
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Tester-tp3025082p3025200.html
> Sent from the Forum for Wicket Core developers mailing list archive at
> Nabble.com.
>

Re: Wicket Tester

Posted by thobile <nn...@gmail.com>.
I have the following code:

Wicket Page Code:
Link<SdInternshipIntakeSummary> deleteLink = new
Link<SdInternshipIntakeSummary>(
DELETE_LINK, item.getModel()) {

private static final long serialVersionUID = 1L;

@Override
public void onClick() {
SdInternshipIntakeSummary selected = getModelObject();
((InternshipMaintenancePage) getPage()).deleteIntake(selected);
}
};
deleteLink.add(new SimpleAttributeModifier(
"onclick",
"return confirm('Are you sure you want to delete Internships Intake
Summary?');"));

I want to test this component using wicket tester, I have the following code:

Wicket Tester Code

//checking listview size
ListView listView1 = (ListView)
getWicketTester().getComponentFromLastRenderedPage("intake-summary-report-panel:intake-summary-table");
// int initialSize = listView1.size();

//click delete link
getWicketTester().clickLink("intake-summary-report-panel:intake-summary-table:0:delete-link");

//checking listview size after I have deleted the record
ListView listView2 = (ListView)
getWicketTester().getComponentFromLastRenderedPage("intake-summary-report-panel:intake-summary-table");
// int secondSize = listView2.size();

//checking if the Listview size is updated
Assert.assertEquals(listView2.size(), (initialSize - 1));

Please help is there anything that I am missing, note this link is not Ajax

How do we navigate to SimpleAttributeModiffier using Wickettester
because it seems as if I need to confirm firts  before the page can be
updated


On Wed, Nov 3, 2010 at 12:46 PM, Martin Grigorov-4 [via Apache Wicket]
<ml...@n4.nabble.com> wrote:
> tell us what exactly you want to do
> what did you tried ?
>
> On Wed, Nov 3, 2010 at 10:58 AM, thobile <[hidden email]> wrote:
>
>>
>> Hi Everyone
>>
>> I am having a problem in refreshing wickettester page, is there anyone who
>> can help me. I have tried few examples from the net but I failed. Thank
>> you
>> in advance
>> --
>> View this message in context:
>>
>> http://apache-wicket.1842946.n4.nabble.com/Wicket-Tester-tp3025082p3025082.html
>> Sent from the Forum for Wicket Core developers mailing list archive at
>> Nabble.com.
>>
>
>
> ________________________________
> View message @
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Tester-tp3025082p3025137.html
> To unsubscribe from Wicket Tester, click here.
>

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Tester-tp3025082p3025200.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: Wicket Tester

Posted by Martin Grigorov <mg...@apache.org>.
tell us what exactly you want to do
what did you tried ?

On Wed, Nov 3, 2010 at 10:58 AM, thobile <nn...@gmail.com> wrote:

>
> Hi Everyone
>
> I am having a problem in refreshing wickettester page, is there anyone who
> can help me. I have tried few examples from the net but I failed. Thank you
> in advance
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Tester-tp3025082p3025082.html
> Sent from the Forum for Wicket Core developers mailing list archive at
> Nabble.com.
>