You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Bill Lear <ra...@zopyra.com> on 2003/10/20 22:56:21 UTC
Testing Tapestry apps with jWebUnit
I've downloaded jWebUnit for evaluation and wondered if anyone here has
experience to share using it with Tapestry.
I'd like to know how you refer to components in the HTML page, since
Tapestry builds these names. For example, I have a page with a selection
box and a form that is rendered thus:
<form method="post" name="Form0" action="/eci/app">
<input type="hidden" name="service" value="direct/0/Home/sortOrderForm"/>
<input type="hidden" name="sp" value="S0"/>
<input type="hidden" name="Form0" value="sortOrderSelect"/>
<select name="sortOrderSelect">
<option value="0">Last Name</option>
<option value="1">First Name</option>
<option value="2">Department</option>
<option value="3">Email Address</option>
</select>
<input type="submit" value="Sort List">
</form>
How would I:
1) test that this form (and not, say another one) is present in the page.
2) select a value from the sort order list and submit the form by
pressing this button (again, not some other one)?
If I have links in the page:
<a href="/eci/app?service=direct/0/Home/employeeDetailLink2&sp=1">Joe</a>
<a href="/eci/app?service=direct/0/Home/employeeDetailLink2&sp=2">Bob</a>
<a href="/eci/app?service=direct/0/Home/employeeDetailLink2&sp=3">Jim</a>
How do I click on the third link?
Any help much appreciated.
Thanks.
Bill
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: Testing Tapestry apps with jWebUnit
Posted by Bill Lear <ra...@zopyra.com>.
On Monday, October 20, 2003 at 17:16:31 (-0400) Howard M. Lewis Ship writes:
>Supply ids as informal parameters? ...
I was thinking of this, but what about, say DirectLink components in a
foreach? Actually, jWebUnit has a "clickLinkWithText()" function that
I think I could use. So, if I have the link:
<a href="/eci/app?service=direct/0/Home/employeeDetailLink2&sp=2">Bob</a>
I could say clickLinkWithText("Bob").
For forms, I suppose I could just supply an id as informal parameter...
I'll give that a whirl and see how it goes. So far, I really like
jWebUnit. It does seem to be resilient to many page changes as well.
Bill
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: Testing Tapestry apps with jWebUnit
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Supply ids as informal parameters? I haven't used jWebUnit so its hard for me to say what kind of
document/DOM/XPath/magic access to the rendered HTML it supports.
The tools I've used in the past (such as Silk) work using a kind of "context"; not the button's
position in the DOM (for example) but the label on the button. The resulting scripts are pretty
resiliant to many changes to the page (such as layout and naming).
--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com
> -----Original Message-----
> From: Bill Lear [mailto:rael@zopyra.com]
> Sent: Monday, October 20, 2003 4:56 PM
> To: tapestry-user@jakarta.apache.org
> Subject: Testing Tapestry apps with jWebUnit
>
>
> I've downloaded jWebUnit for evaluation and wondered if
> anyone here has experience to share using it with Tapestry.
>
> I'd like to know how you refer to components in the HTML
> page, since Tapestry builds these names. For example, I have
> a page with a selection box and a form that is rendered thus:
>
> <form method="post" name="Form0" action="/eci/app">
> <input type="hidden" name="service"
> value="direct/0/Home/sortOrderForm"/>
> <input type="hidden" name="sp" value="S0"/>
> <input type="hidden" name="Form0" value="sortOrderSelect"/>
>
> <select name="sortOrderSelect">
> <option value="0">Last Name</option>
> <option value="1">First Name</option>
> <option value="2">Department</option>
> <option value="3">Email Address</option>
> </select>
> <input type="submit" value="Sort List">
> </form>
>
> How would I:
>
> 1) test that this form (and not, say another one) is
> present in the page.
>
> 2) select a value from the sort order list and submit the form by
> pressing this button (again, not some other one)?
>
> If I have links in the page:
>
> <a
> href="/eci/app?service=direct/0/Home/employeeDetailLink2&s
p=1">Joe</a>
> <a
> href="/eci/app?service=direct/0/Home/employeeDetailLink2&s
p=2">Bob</a>
> <a
> href="/eci/app?service=direct/0/Home/employeeDetailLink2&s
p=3">Jim</a>
>
> How do I click on the third link?
>
> Any help much appreciated.
>
> Thanks.
>
>
> Bill
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org