Title: RE: Re : [Jwebunit-users] Ideas


Hi Julien,

I will file a feature request for my suggestions... later after the week-end :)

Now, about my implementation of assertLabeled**, I was using assertElementPresentByXPath because that's the only way I found to write these implementations based on jWebUnit.
If you want to include these methods in the set of basic ones, I would suggest you to implement these methods based on the core plugin library. I mean, in the jWebUnit-htmlunit-plugin, the implementation should be based on htmlunit or another way around if not possible. Beside, you should let the assertElementPresentByXPath available to users for the specific/weird cases.

In fact, I don't know how htmlunit is working... and I'm only guessing how jWebUnit is working based on the documentation and the code I read, and, my own usage of that cool tool :) If I told something completely wrong here above... Apologizes :]

Another idea about the implementation is to have non-void methods. For example, you could have an assertFormPresent which returns a form object:
 HtmlForm assertFormPresent(String formIdorName)
And further in your test, you could call an assert method on the HtmlForm object. Let's say:
 HtmlForm form = assertFormPresent("formid");
 form.assertTextFieldPresent("textFieldIdorName");

Maybe the final code will be more readable... But I guess this requires a very big refactoring of the existing code... But leave it for now :)

I hope I answered your questions. Probably some other users have ideas to give about that topic :o)

Cheers,

Fred.

-----Original Message-----
From:   Julien HENRY [mailto:[EMAIL PROTECTED]]
Sent:   Fri 7/7/2006 6:34 PM
To:     Usage problems for jWebUnit
Cc:     Frédéric Burlet
Subject:        Re : [Jwebunit-users] Ideas

Hi Fred,

Thanks for your interest in jWebUnit evolution. Some of your request need a bit of reflection. Could you please fill a feature request for assertLabeled** methods.
Concerning assertHiddenElementWithNamePresent, I think assertHiddenFieldPresent is a better name. You can fill another feature request for it.

The main question I have concerning your feature requests is the following: should we try to wrap as many XPath assertion as possible, or simply ask jWebUnit users to use assertElementPresentByXPath in their  test cases?

++
Julien

----- Message d'origine ----
De : Fred <[EMAIL PROTECTED]>
À : [email protected]
Envoyé le : Vendredi, 7 Juillet 2006, 4h17mn 59s
Objet : [Jwebunit-users] Ideas


Hi,

When I was writing tests I noticed that it could be usefull to add the
following methods to complete the set of basic ones:

assertLabeledTextFieldPresent(String textFieldId, String textFieldName, String
labelContent)
assertLabeledCheckBoxPresent(String checkBoxId, String checkBoxName, String
labelContent)
assertLabeledSelectBoxPresent(String selectId, String selectName, String
labelContent)
assertLabeledTextAreaPresent(String textAreaId, String textAreaName, String
labelContent)
assertLabeledRadioButtonPresent(String radioId, String radioGroup, String
radioOption, String labelContent)
assertHiddenElementWithNamePresent(String hiddenName)

My first implementation was the following for example for the first one:
        assertElementPresentByXPath("//[EMAIL PROTECTED]"" + labelForName + "\"
and .=\"" + labelContent + "\"]");
        assertElementPresentByXPath("//[EMAIL PROTECTED]"text\" and @name=\"" +
textFieldId + "\" and @id=\"" + textFieldName + "\"]");

This clearly defines that we have a label with a for attribute which refers to
a text field with the given id.
This allows me to detect some errors in the html generated by my jsp's :o)

Yes, indeed, I said "first implementation" because another idea came up while
writing this mail :o)
The assertLabeledTextFieldPresent could have an extra parameter which is the
form id or form name. This would imply that we check that a specific form has
a specific field...

My 1¢ contribution :o)

Regards,

Fred.

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users







*DISCLAIMER*

This e-mail (including any attachments) may contain information which is privileged or confidential or constitute non-public information.It is to be conveyed only to the intended recipient(s).If you received this e-mail in error, please notify the sender immediately by e-mail or telephone and delete the e-mail from your system without reading, copying or disclosing its contents to any other person.


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to