Re: problem to test form in modal window with wicket tester
I didn't find getContent() method to modalWindow component, but it works well in two steps : ConnexionContentPanel loginPanel = (ConnexionContentPanel) modalWindow.get(modalWindow.getContentId()); Form? loginForm = (Form?) loginPanel.get(loginForm); thanks a lot ! 2011/5/26 Andrea Del Bene adelb...@ciseonweb.it Form id is corret, but remember that form and feedback panel are not added directly to modal window. They are inside ConnexionContentPanel which in turn is added to modalwindow. In your test you should be able to access form calling getContent() before get(loginForm), i.e: modalWindow.getContent().get(loginForm) this is the code to construct modal window final ModalWindowE4N modalConnexion = new ModalWindowE4N(modalConnexion); modalConnexion.setTitle(Connexion à l'espace membre); modalConnexion.setContent(new ConnexionContentPanel(modalConnexion.getContentId())); add(modalConnexion); Form is added in ConnexionContentPanel : public ConnexionContentPanel(String id) { super(id); //Création du formulaire dont les champs seront liés aux champs d'un membre grace au model FormMembre loginForm = new FormMembre(loginForm, new CompoundPropertyModelMembre(new LoadableDetachableModelMembre() { @Override protected Membre load() { return new Membre(); } })); //Création et ajout des champs id et pwd au formulaire TextFieldMembre idField = new TextFieldMembre(membreId); idField.setRequired(true); loginForm.add(idField); PasswordTextField pwdField = new PasswordTextField(password); pwdField.setRequired(true); loginForm.add(pwdField); //Ajout d'un du feedback panel qui contiendra les erreurs relevées par le formulaire final FeedbackPanel feedBackPanel = new FeedbackPanel(errorMsg); feedBackPanel.setOutputMarkupId(true); add(feedBackPanel); //création du bouton ajax pour soumettre le formulaire AjaxButton submitbutton = new AjaxButton(ajaxSubmitLogin) { @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { Membre modelObject = (Membre) form.getModelObject(); Membre membre; membre = serviceIdentif.identifier(modelObject.getId(), modelObject.getPassword()); if(membre == null) error(Identifiant ou mot de passe incorrect); else setResponsePage(TableauBordPage.class); } @Override protected void onError(AjaxRequestTarget target, Form? form) { target.addComponent(feedBackPanel); } }; loginForm.add(submitbutton); //ajout du formulaire au panel add(loginForm); } you can see that form id is correct. It is the same problem with FeedBackPanel errorMsg : I get a null pointer when I try to get it with modalWindow.get(errorMsg); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Mathilde Pellerin Ingénieur en Génie Logiciel Tél mobile : 06.60.78.79.03 E-mail : mathilde.pelle...@gmail.com Mon CV en ligne : http://www.mathilde-pellerin.fr/ http://www.mathilde-pellerin.fr/Mes liens : http://www.viadeo.com/fr/profile/mathilde.pellerin http://fr.linkedin.com/in/mathildepellerin
Re: problem to test form in modal window with wicket tester
Sorry, I didn't noticed that getContent() is protected. The solution you found is perfect :-) I didn't find getContent() method to modalWindow component, but it works well in two steps : ConnexionContentPanel loginPanel = (ConnexionContentPanel) modalWindow.get(modalWindow.getContentId()); Form? loginForm = (Form?) loginPanel.get(loginForm); thanks a lot ! 2011/5/26 Andrea Del Beneadelb...@ciseonweb.it - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: test pages with selenuim
Am 16.04.2011 22:11, schrieb shetc: What is advantage of Wicket Page Test over WicketTester? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/test-pages-with-selenuim-tp3452652p3454541.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org As he stated in his heading - he was looking for integrating selenium and wicket testing. This library could help on that task. Or did i miss something in your question? Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: test pages with selenuim
I use WicketTester on its own now. Will it help me to also use Selenium to test Wicket as well? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/test-pages-with-selenuim-tp3452652p3455847.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: test pages with selenuim
Am 17.04.2011 19:54, schrieb shetc: I use WicketTester on its own now. Will it help me to also use Selenium to test Wicket as well? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/test-pages-with-selenuim-tp3452652p3455847.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org With selenium you get more browser-like testing. It is a library executing browser tasks by an action script. With wicket tester you do a more component-oriented testing. So wickettester is more usable for unit-testing and selenium for acceptance / integration testing. The decision if you have to use selenium in your tests to depends on your development process. If you do a more behavior - driven - developement process you can simply define your action script and run it in selenium. So you will get a big picture (What else has to be done to achieve my task / goal). If you like it more to do it unit-test driven then maybe you have so many tests that adding selenium is not nessecary. Hth Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: test pages with selenuim
Am 15.04.2011 20:04, schrieb fachhoch: I am trying to test my wicket application using selenuim , I had no success , did anybody try ? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/test-pages-with-selenuim-tp3452652p3452652.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org Did you know http://wicketpagetest.sourceforge.net/ Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: test pages with selenuim
What is advantage of Wicket Page Test over WicketTester? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/test-pages-with-selenuim-tp3452652p3454541.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
test pages with selenuim
I am trying to test my wicket application using selenuim , I had no success , did anybody try ? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/test-pages-with-selenuim-tp3452652p3452652.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: test pages with selenuim
On Apr 15, 2011, at 11:04 AM, fachhoch wrote: I am trying to test my wicket application using selenuim , I had no success , did anybody try ? Yeah. I use Selenium with a ruby solution, just because that's how I was introduced to it. http://tersesystems.com/2010/10/05/simplest-possible-acceptance-test If you want to integrate Selenium tests into a continous integration server running on Linux, you'll probably want the headless mode enabled, which is typically done with Xvfb. http://blog.kabisa.nl/2010/05/24/headless-cucumbers-and-capybaras-with-selenium-and-hudson/ Will.
Re: test pages with selenuim
Do you know that wicket provides a page tester ? If not take a look at http://wicket.apache.org/apidocs/1.4/org/apache/wicket/util/tester/WicketTester.html WicketTester -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/test-pages-with-selenuim-tp3452652p3452716.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
TEST
Hi! I've received this message when I tried to answer a question: Delivery to the following recipient failed permanently: users@wicket.apache.org Technical details of permanent failure: Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 552 552 spam score (5.0) exceeded threshold (FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX (state 18). It seems to be something serious error with the mailing server if I could trigger the spam filter only with 2 sentences. -- Zoltán Nagy
Re: TEST
HTML email raises the score pretty much. Martijn On Tue, Mar 1, 2011 at 1:45 PM, Zoltán Nagy zberke...@gmail.com wrote: Hi! I've received this message when I tried to answer a question: Delivery to the following recipient failed permanently: users@wicket.apache.org Technical details of permanent failure: Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 552 552 spam score (5.0) exceeded threshold (FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX (state 18). It seems to be something serious error with the mailing server if I could trigger the spam filter only with 2 sentences. -- Zoltán Nagy -- Become a Wicket expert, learn from the best: http://wicketinaction.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: TEST
Thanks! I turn off formating. 2011/3/1 Martijn Dashorst martijn.dasho...@gmail.com HTML email raises the score pretty much. Martijn -- Zoltán Nagy - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Test
I have been having the same problem for the last 2 weeks. Every time i send a mail or a reply, i get a mail delivery failure. Today it however seemed to be working. I have been able to send a reply. If this gets through, i will conclude that the issue has been resolved or resolved its self. Josh. On Fri, Feb 25, 2011 at 12:49 AM, Jim Goodwin jwg...@gmail.com wrote: Everything I send to this list is being bounced by a spam-filter at the list-serv end. Just testing a very simple text-only message. Very sorry if this actually goes through, nothing else would - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Test
In my case it turned out that (A) I was pasting in a snippet of XML; (B) my mail client (Thunderbird ) decided therefore to send the whole message as HTML; (C) apache's SpamAssassin has rules about HTML and decided it was spam. The fix (in TBird) was to edit the Contact record for users@wicket.apache.org. There is a preference for plaintext/HTML. I had as usual left it at the default, which lets TBird guess. Setting it to plaintext solved the problem. (FWIW: Along the way I think I figured out also that the SpamAssassin rules that Apache is using also award penalty points for email addresses that end in digits, like mine or yours (Josh), as well as free email services like gmail, and even my non-free ISP comcast, and email addresses with no real username in brackets. It just didn't love me. But getting rid of the HTML lowered my score enough to get through.) On 2/25/2011 3:44 AM, Josh Kamau wrote: I have been having the same problem for the last 2 weeks. Every time i send a mail or a reply, i get a mail delivery failure. Today it however seemed to be working. I have been able to send a reply. If this gets through, i will conclude that the issue has been resolved or resolved its self. Josh. On Fri, Feb 25, 2011 at 12:49 AM, Jim Goodwinjwg...@gmail.com wrote: Everything I send to this list is being bounced by a spam-filter at the list-serv end. Just testing a very simple text-only message. Very sorry if this actually goes through, nothing else would - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Test
Everything I send to this list is being bounced by a spam-filter at the list-serv end. Just testing a very simple text-only message. Very sorry if this actually goes through, nothing else would - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Test
Oh, it worked! :) On Thu, Feb 24, 2011 at 3:49 PM, Jim Goodwin jwg...@gmail.com wrote: Everything I send to this list is being bounced by a spam-filter at the list-serv end. Just testing a very simple text-only message. Very sorry if this actually goes through, nothing else would - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Jeremy Thomerson http://wickettraining.com *Need a CMS for Wicket? Use Brix! http://brixcms.org*
Re: WicketTester and the test of image visibility
most of our unit tests check the markup, see there. -igor On Fri, Feb 4, 2011 at 1:19 AM, Dmitriy Neretin dmitriy.nere...@googlemail.com wrote: Could you provide me a simple exmaplte how can I do that? Thank you! On 3 February 2011 18:33, Igor Vaynberg igor.vaynb...@gmail.com wrote: visibility can be triggered from a lot of places, isvisible() only checks the visibility flag. the best way to test it is to see if the image tag appears in the rendered markup. -igor On Thu, Feb 3, 2011 at 1:16 AM, Dmitriy Neretin dmitriy.nere...@googlemail.com wrote: Hello everybody! Is the WicketTester method isVisible() the right solution to test if the Image is shown on the webpage? Thank you! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketTester and the test of image visibility
Could you provide me a simple exmaplte how can I do that? Thank you! On 3 February 2011 18:33, Igor Vaynberg igor.vaynb...@gmail.com wrote: visibility can be triggered from a lot of places, isvisible() only checks the visibility flag. the best way to test it is to see if the image tag appears in the rendered markup. -igor On Thu, Feb 3, 2011 at 1:16 AM, Dmitriy Neretin dmitriy.nere...@googlemail.com wrote: Hello everybody! Is the WicketTester method isVisible() the right solution to test if the Image is shown on the webpage? Thank you! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
WicketTester and the test of image visibility
Hello everybody! Is the WicketTester method isVisible() the right solution to test if the Image is shown on the webpage? Thank you!
Re: WicketTester and the test of image visibility
visibility can be triggered from a lot of places, isvisible() only checks the visibility flag. the best way to test it is to see if the image tag appears in the rendered markup. -igor On Thu, Feb 3, 2011 at 1:16 AM, Dmitriy Neretin dmitriy.nere...@googlemail.com wrote: Hello everybody! Is the WicketTester method isVisible() the right solution to test if the Image is shown on the webpage? Thank you! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Unit-Test AjaxLazyLoadPanel on a page after successful load
Thanks, after i got it that i have to set the second parameter to the parent of my lazyload the tester worked. Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Unit-Test AjaxLazyLoadPanel on a page after successful load
Hi *, i try to get it for hours now, but i can't. I have a page with an AjaxLazyLoadPanel on it. The lazyLoadComponent on it is a simple panel. Everything works as expected. But if i start my unit test (wickettester.startPage) the content panel is not exchanged. All i get is the lazy load panel. What do i have to do to get the panel exchange? Do i have to execute an ajax event. I know the wicket test page api. But i would like to get it with the wickettester. Wicket-Version is 1.4.14 Thanks in Advance Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Unit-Test AjaxLazyLoadPanel on a page after successful load
Hi Per, you can use the AjaxLazyLoadPanelTester there is an example at: http://svn.apache.org/repos/asf/wicket/releases/wicket-1.4.14/wicket-extensions/src/test/java/org/apache/wicket/extensions/markup/html/AjaxLazyLoadPanelTesterTest.java On Wed, Dec 22, 2010 at 5:07 PM, Per Newgro per.new...@gmx.ch wrote: Hi *, i try to get it for hours now, but i can't. I have a page with an AjaxLazyLoadPanel on it. The lazyLoadComponent on it is a simple panel. Everything works as expected. But if i start my unit test (wickettester.startPage) the content panel is not exchanged. All i get is the lazy load panel. What do i have to do to get the panel exchange? Do i have to execute an ajax event. I know the wicket test page api. But i would like to get it with the wickettester. Wicket-Version is 1.4.14 Thanks in Advance Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
Test CheckBoxMultipleChoice or CheckGroup
Hello list, I'm trying to set checkboxes with junit but without significant success. My trouble is to find checkboxes. I've not found any way to access it if I use CheckBoxMultipleChoice. With CheckGroup I get access with Visitor tester.getLastRenderedPage().visitChildren(Check.class, new IVisitorComponent() { public Object component(Component component) { if(component.getDefaultModelObject().equals(TestLabel)) [...] but it's very ugly way. Any suggestions? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Test CheckBoxMultipleChoice or CheckGroup
Use getters: https://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html 2010/12/15 Anton Bessonov exe...@googlemail.com: Hello list, I'm trying to set checkboxes with junit but without significant success. My trouble is to find checkboxes. I've not found any way to access it if I use CheckBoxMultipleChoice. With CheckGroup I get access with Visitor tester.getLastRenderedPage().visitChildren(Check.class, new IVisitorComponent() { public Object component(Component component) { if(component.getDefaultModelObject().equals(TestLabel)) [...] but it's very ugly way. Any suggestions? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Test CheckBoxMultipleChoice or CheckGroup
Thanks, I will try! Use getters: https://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
issue using executeAjaxEvent for a test
Hi All, I have an issue trying to test an ajax event. I have two different wicket classes which need to talk each other. Both classes have a TextField plus a ListMultipleChoice. When the user types a word into the class A textField the items of the class A list get filtered and, based on the new class A list choices, the class B list gets filtered as well. To achieve that I have the following on the class A textField //Class A new OnChangeAjaxBehavior() { /** * */ private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { [12] listMultipleChoice.setDefaultModelObject(getValue(txtField.getDefaultModelObjectAsString())); ListString selectedClassAItems = getSelected(); classB.filterByClassAItems(selectedClassAItems); target.addComponent(classB.getListMultipleChoice()); target.addComponent(listMultipleChoice); } }; which actually it's working fine. To test it I have the following textFieldString classATextField = (TextFieldString) classAWicketTester.getComponentFromLastRenderedPage(panel:ajaxMultiChoiceform:filterBox); classATextField.setDefaultModelObject(filtered); classAWicketTester.executeAjaxEvent(classATextField.getPageRelativePath(), onchange); ListMultipleChoiceString classAItems = (ListMultipleChoiceString) classAWicketTester.getComponentFromLastRenderedPage(panel:ajaxMultiChoiceform:filteredList); assertEquals([filteredItem], classAItems.getChoices().toString()); ListMultipleChoiceString classBItems = (ListMultipleChoiceString) classBWicketTester.getComponentFromLastRenderedPage(panel:ajaxMultiChoiceform:filteredList); assertEquals([filteredClassBItem], classBItems.getChoices().toString()); ### Now the issue is that for some reason using the executeAjaxEvent, to fire the onchange event, the model into txtField.getDefaultModelObjectAsString() (line 12) is always null hence I cannot retrieve the text value set and filter both lists. I've checked during the debugging the ids of the component and they are exactly the same, so I'm sure the textField called here in line 12 is the same one used to set classATextField.setDefaultModelObject(filtered); but for some reason even if it's the same the model is null. Any clue? Is executeAjaxEvent enough the fire the onUpdate? Regards Antonio - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
inmethod grid test fails
Hi Guys I am having some trouble testing the inmethod grid, specifically when I remove a row from the data list. On pagerender the grid tries to render the deleted row, which of course does not exist anymore. This problem does not occur running the application for real. I try to click the column that deletes the row like this : tester.clickLink(pilotForm:pilotGrid:form:bodyContainer:body:row:1:item:delete:delete,true); Are it because I've failed to set some ajax specific thing up for the wicket tester? regards Nino
Wicket page test 2.0.0 is now available (for Wicket 1.5)
Dear all, Wicket page test 2.0.0 is now available. It is the first version that works with Wicket 1.5-M1 and onwards. It is a library allowing you to unit test your Wicket pages easily, supporting AJAX and Javascript without changes to your pages. Get it from maven as described in http://wicketpagetest.sourceforge.net/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket page test 1.6.1 is now available
Dear all, Wicket page test 1.6.1 is now available. It is a library allowing you to unit test your Wicket pages easily, supporting AJAX and Javascript without changes to your pages. This minor release contains the follow changes: * Fixed issue 3043110[1]. * Fixed issue 3037392[2]. * Fixed issue 3037395[3]. Get it from maven as described in http://wicketpagetest.sourceforge.net/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket page test 1.6 is now available
Dear all, Wicket page test 1.6 is now available. It is a library allowing you to unit test your Wicket pages easily, supporting AJAX and Javascript without changes to your pages. This release contains the follow changes: * Support manual testing: allow some things to be mocked, without starting Selenium. * Include a factory to create change-resisting mocks. * Fixed issue 3024401[1]. * Fixed issue 3008847[2]. * Fixed issue 3008846[3]. That is, now it works with Wicket 1.4.9. Get it from maven as described in http://wicketpagetest.sourceforge.net/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
[BLOG] Canned Wicket Test Examples
Hello! Just wanted to honk my horn: three examples of using the built in wicket test facilities to test AJAX enabled controls, the check box, radio group and the drop down. http://blog.crisp.se/perlundholm/2010/06/20/127701780.html /Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Unit Test InMethod DataGrid
Thank you very much Nino and Kent, I've read about Wicketpagetest before and I've been planning to try it out. Looks like now is my chance :-) Ronan On 04/06/2010 02:16, Kent Tong wrote: Hi Ronan, Looking at the output of WicketTester.debugComponentTrees() I can see that the grid row is the deepest level with a wicket id: ... panel:storyGrid:form:bodyContainer:body:row:2:item com.inmethod.grid.common.AbstractGridRow If you use http://wicketpagetest.sourceforge.net, then you can test it easily like: Selenium s = ...; assert s.getText(wicket=//storyGrid//body//row[2]//item[3]).equals(foo; In this example you're checking the the 3rd cell in the 2nd row (both are 0-based). - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Unit Test InMethod DataGrid
Hi, Does anybody know how to check the values of individual cells of an InMethod DataGrid/Treedrid. in a unit test? Looking at the output of WicketTester.debugComponentTrees() I can see that the grid row is the deepest level with a wicket id: NFO - BaseWicketTester - path panel:storyGrid:form:bodyContainer:body com.inmethod.grid.datagrid.DataGridBody INFO - BaseWicketTester - path panel:storyGrid:form:bodyContainer:body:row com.inmethod.grid.common.AbstractPageableView INFO - BaseWicketTester - path panel:storyGrid:form:bodyContainer:body:row:1 org.apache.wicket.markup.repeater.Item INFO - BaseWicketTester - path panel:storyGrid:form:bodyContainer:body:row:1:item com.inmethod.grid.common.AbstractGridRow INFO - BaseWicketTester - path panel:storyGrid:form:bodyContainer:body:row:2 org.apache.wicket.markup.repeater.Item INFO - BaseWicketTester - path panel:storyGrid:form:bodyContainer:body:row:2:item com.inmethod.grid.common.AbstractGridRow I've looked at those component classes and can't see anything helpful in them. Hoping I'm not missing the obvious, Ronan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Unit Test InMethod DataGrid
what about grabbing the model behind and checking that instead? 2010/6/3 Ronan O'Connell ronanoconnell1...@gmail.com: Hi, Does anybody know how to check the values of individual cells of an InMethod DataGrid/Treedrid. in a unit test? Looking at the output of WicketTester.debugComponentTrees() I can see that the grid row is the deepest level with a wicket id: NFO - BaseWicketTester - path panel:storyGrid:form:bodyContainer:body com.inmethod.grid.datagrid.DataGridBody INFO - BaseWicketTester - path panel:storyGrid:form:bodyContainer:body:row com.inmethod.grid.common.AbstractPageableView INFO - BaseWicketTester - path panel:storyGrid:form:bodyContainer:body:row:1 org.apache.wicket.markup.repeater.Item INFO - BaseWicketTester - path panel:storyGrid:form:bodyContainer:body:row:1:item com.inmethod.grid.common.AbstractGridRow INFO - BaseWicketTester - path panel:storyGrid:form:bodyContainer:body:row:2 org.apache.wicket.markup.repeater.Item INFO - BaseWicketTester - path panel:storyGrid:form:bodyContainer:body:row:2:item com.inmethod.grid.common.AbstractGridRow I've looked at those component classes and can't see anything helpful in them. Hoping I'm not missing the obvious, Ronan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Unit Test InMethod DataGrid
Hi Ronan, Looking at the output of WicketTester.debugComponentTrees() I can see that the grid row is the deepest level with a wicket id: ... panel:storyGrid:form:bodyContainer:body:row:2:item com.inmethod.grid.common.AbstractGridRow If you use http://wicketpagetest.sourceforge.net, then you can test it easily like: Selenium s = ...; assert s.getText(wicket=//storyGrid//body//row[2]//item[3]).equals(foo; In this example you're checking the the 3rd cell in the 2nd row (both are 0-based). -- Kent Tong Useful news for CIO's at http://www2.cpttm.org.mo/cyberlab/cio-news - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to test a link in wicket:links
Hi Kent, Thanks for the answer, but that looks like it requires Spring, I'm not using Spring. I was hoping to use the test framework that is included in Wicket, not go outside it. Well, it doesn't require you to use Spring in your code. However, it is indeed assumed that you're using a IoC framework (eg, Spring or Guice). Why? Only when you do, is it possible to really unit test a page, otherwise your page will be invoking the real business logic and database access in the tests. I come across this doing a demo of Wicket and it kind of broke the whole spiel about Look, you can do unittests of the GUI!! thing. That's exactly the point. If your tests are touching the database, then they aren't really unit tests anymore. -- Kent Tong Borrow IT books for free at http://www2.cpttm.org.mo/cyberlab/mslib - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to test a link in wicket:links
Hi Kent, Thanks for the answer, but that looks like it requires Spring, I'm not using Spring. I was hoping to use the test framework that is included in Wicket, not go outside it. I come across this doing a demo of Wicket and it kind of broke the whole spiel about Look, you can do unittests of the GUI!! thing. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-test-a-link-in-wicket-links-tp2233376p2240885.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to test a link in wicket:links
wicket:link is a convenience, if it doesnt fit your usecase then use a real link with wicket id, that is what wicket:link does for you anyways. if you dont want to do that then figure out how to parse the generate href out of markup generated by the tester. -igor On Wed, Jun 2, 2010 at 2:42 PM, cat-in-a-hat peter_is...@yahoo.com wrote: Hi Kent, Thanks for the answer, but that looks like it requires Spring, I'm not using Spring. I was hoping to use the test framework that is included in Wicket, not go outside it. I come across this doing a demo of Wicket and it kind of broke the whole spiel about Look, you can do unittests of the GUI!! thing. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-test-a-link-in-wicket-links-tp2233376p2240885.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to test a link in wicket:links
Hi Peter, If I use wicket:link around a link, how can I click on it with WicketTester.clickLink()? It don't have a wicket:id so what would the path be? Please try http://wicketpagetest.sourceforge.net which supports testing the links. You can do it like: selenium.click(link=My Page); ... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to test a link in wicket:links
Hi, If I use wicket:link around a link, how can I click on it with WicketTester.clickLink()? It don't have a wicket:id so what would the path be? Thanks/Peter -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-test-a-link-in-wicket-links-tp2233376p2233376.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket page test 1.5 is now available
Dear all, Wicket page test 1.5 is now available. It is a library allowing you to unit test your Wicket pages easily, supporting AJAX and Javascript without changes to your pages. New features implemented in this version: * Start the Selenium server automatically. * Support JUnit4 in addition to TestNG. * Support unit testing the navigation within the Breadcrumb subsystem * Open a Component in a page for unit testing * Fixed issue 2998400. Get it from maven as described in http://wicketpagetest.sourceforge.net/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket-Spring 1.4.8 runs into exception in unit test
Hi *, today i updated wicket from 1.4.7 to 1.4.8. I found a hardcoded dependency to wicket-spring 1.4.1 in my pom. I updated it to 1.4.8 to. Now i get in my page test the following exception in setup. But what does it mean? Where can i change something to make this work. Until now i didn't found a starting point. Maybe someone solved this already. - Unit test layout is related to world-known wicket-example. org.apache.wicket.WicketRuntimeException: There is no application attached to current thread main at org.apache.wicket.Application.get(Application.java:179) at org.apache.wicket.injection.web.InjectorHolder.setInjector(InjectorHolder.java:88) at org.apache.wicket.spring.injection.annot.test.AnnotApplicationContextMock.init(AnnotApplicationContextMock.java:61) at my.chaman.frontend.wicket.MockContext.init(MockContext.java:11) at my.chaman.frontend.wicket.ApplicationForTesting.init(ApplicationForTesting.java:11) at my.chaman.frontend.wicket.pricetype.edit.pricetypetext.PriceTypeTextPageTest.setUp(PriceTypeTextPageTest.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket-Spring 1.4.8 runs into exception in unit test
Is your unit test setting up the application before it starts (i.e. in the setUp method if you're using junit?). If you can't figure it out, create a quickstart that demonstrates it, and attach that to a JIRA. -- Jeremy Thomerson http://www.wickettraining.com On Tue, May 4, 2010 at 11:42 AM, Per Newgro per.new...@gmx.ch wrote: Hi *, today i updated wicket from 1.4.7 to 1.4.8. I found a hardcoded dependency to wicket-spring 1.4.1 in my pom. I updated it to 1.4.8 to. Now i get in my page test the following exception in setup. But what does it mean? Where can i change something to make this work. Until now i didn't found a starting point. Maybe someone solved this already. - Unit test layout is related to world-known wicket-example. org.apache.wicket.WicketRuntimeException: There is no application attached to current thread main at org.apache.wicket.Application.get(Application.java:179) at org.apache.wicket.injection.web.InjectorHolder.setInjector(InjectorHolder.java:88) at org.apache.wicket.spring.injection.annot.test.AnnotApplicationContextMock.init(AnnotApplicationContextMock.java:61) at my.chaman.frontend.wicket.MockContext.init(MockContext.java:11) at my.chaman.frontend.wicket.ApplicationForTesting.init(ApplicationForTesting.java:11) at my.chaman.frontend.wicket.pricetype.edit.pricetypetext.PriceTypeTextPageTest.setUp(PriceTypeTextPageTest.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket-Spring 1.4.8 runs into exception in unit test
Did you upgrade to spring 3? I ran into an issue with the testng spring test not creating the application context before wicket tester tried to use it (iirc @BeforeTest executed before the super classes @BeforeClass) Ended up switching anything annotated with @BeforeTest to @BeforeMethod. I assume junit has similar annotations. On Tue, May 4, 2010 at 11:15 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Is your unit test setting up the application before it starts (i.e. in the setUp method if you're using junit?). If you can't figure it out, create a quickstart that demonstrates it, and attach that to a JIRA. -- Jeremy Thomerson http://www.wickettraining.com On Tue, May 4, 2010 at 11:42 AM, Per Newgro per.new...@gmx.ch wrote: Hi *, today i updated wicket from 1.4.7 to 1.4.8. I found a hardcoded dependency to wicket-spring 1.4.1 in my pom. I updated it to 1.4.8 to. Now i get in my page test the following exception in setup. But what does it mean? Where can i change something to make this work. Until now i didn't found a starting point. Maybe someone solved this already. - Unit test layout is related to world-known wicket-example. org.apache.wicket.WicketRuntimeException: There is no application attached to current thread main at org.apache.wicket.Application.get(Application.java:179) at org.apache.wicket.injection.web.InjectorHolder.setInjector(InjectorHolder.java:88) at org.apache.wicket.spring.injection.annot.test.AnnotApplicationContextMock.init(AnnotApplicationContextMock.java:61) at my.chaman.frontend.wicket.MockContext.init(MockContext.java:11) at my.chaman.frontend.wicket.ApplicationForTesting.init(ApplicationForTesting.java:11) at my.chaman.frontend.wicket.pricetype.edit.pricetypetext.PriceTypeTextPageTest.setUp(PriceTypeTextPageTest.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket page test 1.4 is now available
Dear all, Wicket page test 1.4 is now available. It is a library allowing you to unit test your Wicket pages easily, supporting AJAX and Javascript without changes to your pages. New features implemented in this version: * Provide a super easy way to locate a DOM element with the Wicket ID. For example, to locate the input element generated by a TextField with wicket:id=productName, just use wicket=//productName as the locator. To locate such element in the 3rd form with wicket:id=myForm, use wicket=//myForm[3]//productName. Get it from maven as described in http://wicketpagetest.sourceforge.net/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Best way to test clickLink on a bookmarkable page link in ListView
Hi, What would be the best way to test clickLink on a bookmarkabel page link added into ListView? How should I construct URL for assertPageLink, clickLink and assertLabel methods? Test code: tester.assertComponent(userLinks, ListView.class); tester.assertListView(userLinks, new ArrayListUser(userService.findAllSurveys())); // tester.assertPageLink(???, UserMainPage.class); // tester.clickLink(???) // tester.assertLabel(???, name1); Page source: CollectionUser users = userService.findAllUsers(); ListViewUser listView = new ListViewUser(userLinks, new ArrayListUser(users)) { @Override protected void populateItem(ListItemUser listItem) { User user = listItem.getModelObject(); String username = user.getUserName(); String name = user.getName(); PageParameters pageParameters = new PageParameters(); pageParameters.add(UserMainPage.USER_ID_PARAMETER_NAME, username); listItem.add(new BookmarkablePageLinkUserMainPage(link, UserMainPage.class, pageParameters).add( new Label(nameLabel, name))); } }; Thanks in advance. Cheers
Re: Wicket page test 1.3 is now available
If you want to compose test pages on the fly, you should try also mashupwebpage: public void testSomeFieldComponent() { Page page = new MashupWebPage(); Form form; page.add(form = new MashUpForm(GID)); FormComponent customField; form.add(customField = new CustomFieldToBeTested(GID)); tester.startPage(page); FormTester formtester = tester.newFormTester(form.getPageRelativePath()); formtester.setValue(getRelativePath(form, customField), test-value); formtester.submit(); tester.assertNoErrorMessages(); } http://code.google.com/p/wicket-mashup/ ** Martin 2010/3/27 Kent Tong k...@cpttm.org.mo: Dear all, Wicket page test 1.3 is now available. It is a library allowing you to unit test your Wicket pages easily, supporting AJAX and Javascript without changes to your pages. New features implemented in this version: * Provide a generic starter page to launch another page whose constructor needs some arguments. * Provide a page navigator to inspect the arguments passed to the response page. * Easier way to open a page. Get it from maven as described in http://wicketpagetest.sourceforge.net/ -- Author of books for learning CXF, Axis2, Wicket, JSF (http://www.agileskills2.org) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket page test 1.3 is now available
Dear all, Wicket page test 1.3 is now available. It is a library allowing you to unit test your Wicket pages easily, supporting AJAX and Javascript without changes to your pages. New features implemented in this version: * Provide a generic starter page to launch another page whose constructor needs some arguments. * Provide a page navigator to inspect the arguments passed to the response page. * Easier way to open a page. Get it from maven as described in http://wicketpagetest.sourceforge.net/ -- Author of books for learning CXF, Axis2, Wicket, JSF (http://www.agileskills2.org) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Announce: wicket page test 1.2 is now available
Dear all, Wicket page test allows you to unit test Wicket pages easily including its AJAX functionality. Major enhancements in 1.2 is that now you can wait for the completion of Ajax easily, without writing any Javascript. For example, in a test case, do something like: WicketSelenium ws = new WicketSelenium(selenium); selenium.click(link=Calculate next); //this is an ajax link ws.waitUntilAjaxDone(); assert selenium.getText(output).equals(Current: 1); For more info, please see http://wicketpagetest.sourceforge.net/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Serialization test
I want to test the following: 1. Whether I have any private members stored on my pages that are not a primitive java type, or IModel 2. If they are IModels, that I do call onDetach() on them. Reflection helps me to answer the 1st question but the second one baffles me. Any tips on how to verify that I am calling onDetach() on all privately stored IModels? I notice that Martijn has a presentation on the subject here, but there is just not enough code in there for me to get to solution myself. http://www.slideshare.net/dashorst/keep-your-wicket-application-in-production Thanks, Pieter
Re: Serialization test
Force your servlet container to serialize sessions after each request and add non-serializable field to objects that you don't want to be serialized. 2010/1/27 pieter claassen pie...@claassen.co.uk: I want to test the following: 1. Whether I have any private members stored on my pages that are not a primitive java type, or IModel 2. If they are IModels, that I do call onDetach() on them. Reflection helps me to answer the 1st question but the second one baffles me. Any tips on how to verify that I am calling onDetach() on all privately stored IModels? I notice that Martijn has a presentation on the subject here, but there is just not enough code in there for me to get to solution myself. http://www.slideshare.net/dashorst/keep-your-wicket-application-in-production Thanks, Pieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Serialization test
You can't verify for any IModel if it has been detached, but what works fine is e.g. checking all LoadableDetachableModel subclasses. You have to rely on specific IModel implementations that have some kind of API to check if they have been detached, just like LoadableDetachableModel#isAttached() On Wed, Jan 27, 2010 at 3:51 PM, pieter claassen pie...@claassen.co.uk wrote: I want to test the following: 1. Whether I have any private members stored on my pages that are not a primitive java type, or IModel 2. If they are IModels, that I do call onDetach() on them. Reflection helps me to answer the 1st question but the second one baffles me. Any tips on how to verify that I am calling onDetach() on all privately stored IModels? I notice that Martijn has a presentation on the subject here, but there is just not enough code in there for me to get to solution myself. http://www.slideshare.net/dashorst/keep-your-wicket-application-in-production Thanks, Pieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
starting tomcat in pre-integration-test haults build
If I start tomcat in the pre-integration-test the build hangs. Why is this? D/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Announce: wicket page test 1.1.0 available
Dear all, wicket page test allows you to unit test Wicket pages including its AJAX functionality. Major enhancements in 1.1.0: * It now supports Google Guice along with the existing support for Spring (Thanks to our new member developer, Andy Chu). * It is now organized in modules so that you won't be including, say, Selenium and Jetty code at runtime. Fore more info, please see http://wicketpagetest.sourceforge.net/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: unit test of AjaxLazyLoadPanel and ModalWindow
Bernard Lupin wrote: As suggested by message subject, you had a problem for testing AjaxLazyLoadPanel and ModalWindow. You provided a solution for the first case (great!), but there is nothing in this thread about testing ModelWindow. try http://wicketpagetest.sourceforge.net/examples.html which supports AJAX without any special work by you. - -- Kent Tong Better way to unit test Wicket pages (http://wicketpagetest.sourceforge.net) -- View this message in context: http://old.nabble.com/unit-test-of-AjaxLazyLoadPanel-and-ModalWindow-tp16851306p26809771.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: unit test of AjaxLazyLoadPanel and ModalWindow
Hi, As suggested by message subject, you had a problem for testing AjaxLazyLoadPanel and ModalWindow. You provided a solution for the first case (great!), but there is nothing in this thread about testing ModelWindow. Does your solution apply to ModalWindow too ? Or is there another method ? NB : I'm using the iframe version of ModalWindows... Regards Bernard Antony Stubbs wrote: And here's a nicer version to add to your library: /** * Triggers an {...@link AjaxLazyLoadPanel} to fetch it's contents. * * @param wc the {...@link WicketTester} to execute the behaviour ( {...@link WicketTester#executeBehavior} ). * @param container contains the {...@link AjaxLazyLoadPanel} to trigger */ private void executeAjaxLazyLoadPanel(final WicketTester wc, Panel container) { container.visitChildren( AjaxLazyLoadPanel.class, new IVisitorAjaxLazyLoadPanel() { @Override public Object component(AjaxLazyLoadPanel component) { ListIBehavior behaviors = component.getBehaviors(); // get the AbstractAjaxBehaviour which is responsible for // getting the contents of the lazy panel AbstractAjaxBehavior b = (AbstractAjaxBehavior) behaviors.get( 0 ); // tell wicket tester to execute it :) wc.executeBehavior( b ); // continue with visitation rights, or not, i don't care return CONTINUE_TRAVERSAL; } } ); } Antony Stubbs wrote: And boom! Thanks for the inspiration Frank! final WicketTester wc = constructBasicPanel(); wc.debugComponentTrees(); wc.dumpPage(); // delicious is the constructed panel, which contains a AjaxLazyLoadPanel... // visit it's children, looking for the AjaxLazyLoadPanel delicious.visitChildren( AjaxLazyLoadPanel.class, new IVisitorAjaxLazyLoadPanel(){ @Override public Object component(AjaxLazyLoadPanel component) { // get the AbstractAjaxBehaviour which is responsible for getting the contents of the lazy panel ListIBehavior behaviors = component.getBehaviors(); final AbstractAjaxBehavior b; b = (AbstractAjaxBehavior) behaviors.get( 0 ); // tell wicket tester to execute it :) wc.executeBehavior( b ); // continue with visitation rights, or not, i don't care return null; }} ); wc.debugComponentTrees(); wc.dumpPage(); // and volah, your lazy panel is now replaced with the contents :) wc.assertComponent( panel:lazy:content:repeaterContainer:bookmarks:1, Item.class ); wc.assertInvisible( panel:lazy:content:noBookmarks ); Let me know what you think or if you have any improvements! Antony Stubbs wrote: Thanks for the info Frank. Any tips on how to do so? Frank Bille wrote: On Thu, Apr 24, 2008 at 8:10 PM, qk wuhanqiangk...@gmail.com wrote: 1. after the page was rendered using WicketTester.startPage(), the real content (the one that returned by getLazyLoadComponent()) was not loaded by default. I always got an empty panel. Is there a way that I can have the real content rendered? Wicket tester doesn't parse javascript, so it can't execute the ajax callback. You have to do that yourself. Frank - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://old.nabble.com/unit-test-of-AjaxLazyLoadPanel-and-ModalWindow-tp16851306p26793515.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: JNDI and mvn test
Hi, I'm executing the standard Wicket maven archetype's test target and it is having trouble finding my JNDI datasource. *mvn jetty:run* works just fine but when I execute the *mvn test* target from within m2eclipse, I get a huge stracktrace with the following excerpt: Caused by: javax.naming.NameNotFoundException; remaining name 'jdbc/ds' My pom references a jetty-env.xml file which includes the definition for this datasource but that entry is in the Jetty plugin section and I don't think it is is getting sourced when exec'ing the *mvn test *target. How should the maven lifecycle test know about jetty specific configuration files read by the jetty plugin? You could use simple-jndi for your purposes. I could provide you an example if you want to give it a try. Best Regards, Ilja Pavkovic -- binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin +49 · 171 · 9342 465 Handelsregister: HRB 115854 - Amtsgericht Charlottenburg Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket Test Harness and HTTP objects
I discovered as I implemented the SessionListener to clean up user record locks that the WicketTester object does not behave as expected in regards to the HttpSession objects. I expected to have my MockHttpSession already configured with the application session object bound in the specified location. In otherwords I would expect the following to work: MySession session = MySession.get(); HttpSession htSession = tester.getHttpSession(); assertEquals(session, htSession.get(wicket:myapp.context: + Session.SESSION_ATTRIBUTE_NAME)) This is a true condition with a deployed application, however the mapping has to be done manually by my testcase. Is this by design or is this a bug? The mock objects should provide enough imitation of reality to allow testing integration points like this a bit easier.
Test (sorry)
Please ignore
JNDI and mvn test
I'm executing the standard Wicket maven archetype's test target and it is having trouble finding my JNDI datasource. *mvn jetty:run* works just fine but when I execute the *mvn test* target from within m2eclipse, I get a huge stracktrace with the following excerpt: Caused by: javax.naming.NameNotFoundException; remaining name 'jdbc/ds' My pom references a jetty-env.xml file which includes the definition for this datasource but that entry is in the Jetty plugin section and I don't think it is is getting sourced when exec'ing the *mvn test *target. I will post to the Maven forum but before doing so was hoping someone here could suggest how to have maven test corectly see the datasource in my jetty-env.xml file while execing the *mvn test* target. Thanks, -Luther
Re: Wicket tester test coverage
If the element is not in a loop, just specify the HTML ID in the template. If it is in a loop, use xpath. oh. Thanks :$ I thought wicket id were incremeting on request, meaning that even without loop the same page loaded twice would end up with a different id (with an incremented number). I should test it ! zedros wrote: on a broader picture, my main question was about the way you proceed, Do you test every page, including every validator or.. ? If doing so, for pages that quite often are then not touched much, i would fear the time needed for proper testing quite hard to justify. Am i wrong here ? I test my code based on risk. If it is the code that is frequently use, has a high impact if it breaks, or is likely to contain bugs, I'll test it more thoroughly. ok, thanks for this explanation :) have a good day zedros - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: test for dropdownchoice with ajax - response is homepage always
On Tue, 2009-12-01 at 08:32 +0200, Martin Makundi wrote: Hi! When I test a page like this http://www.wicket-library.com/wicket-examples/ajax/choice with wicket tester and submit the form, the response page is the HomePage instead of the expected page (ChoicePage). Do you use a formtester? The wicket tester executeajax does not properly submit the form values so what we do is we create a dummy formtester before calling executeajaxevent. That might help. Thanx for your feedback! Did you have a look at http://is.gd/58mq3 which shows the test? Yes, I'm using a formTester. What is your actual advice how to work around? I didn't get this :) Cheers, Martin ** Martin This issue was already reported some time ago without a final result: http://old.nabble.com/unit-test-for-dropdownchoice-with-ajax-td21141772.html I created an example project that shows this issue: http://github.com/magro/misc/tree/master/wicket-tester-drop-downs/ This is the short link to the failing test case (on github): http://is.gd/58mq3 This is the tested page class: http://is.gd/58mDm I'm using wicket 1.4.3. Is there any error in the test? Can I do anything to work around this, or is it a bug? Thanx cheers, Martin -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grotzke http://www.javakaffee.de/blog/ signature.asc Description: This is a digitally signed message part
Re: test for dropdownchoice with ajax - response is homepage always
Thanx for your feedback! Did you have a look at http://is.gd/58mq3 which shows the test? Ofcourse I didn't look ;) Now, having looked at it your bug is that FORMTESTER CAN BE SUBMITTED ONLY ONCE! If you want to use it another time, you need to call newFormTester again. ** Martin ** Martin This issue was already reported some time ago without a final result: http://old.nabble.com/unit-test-for-dropdownchoice-with-ajax-td21141772.html I created an example project that shows this issue: http://github.com/magro/misc/tree/master/wicket-tester-drop-downs/ This is the short link to the failing test case (on github): http://is.gd/58mq3 This is the tested page class: http://is.gd/58mDm I'm using wicket 1.4.3. Is there any error in the test? Can I do anything to work around this, or is it a bug? Thanx cheers, Martin -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: test for dropdownchoice with ajax - response is homepage always
On Tue, 2009-12-01 at 11:44 +0200, Martin Makundi wrote: Thanx for your feedback! Did you have a look at http://is.gd/58mq3 which shows the test? Ofcourse I didn't look ;) Now, having looked at it your bug is that FORMTESTER CAN BE SUBMITTED ONLY ONCE! If you want to use it another time, you need to call newFormTester again. Thanx, this fixed the issue! Now I extended the test to make sure that the previously selected make and model are still selected after the final submit - and this fails with the second drop down (the model): this returns null from dropDown.getDefaultModelObject. I pushed this, so http://is.gd/58mq3 shows these changes. Is there another thing that needs to be changed in the test? Cheers, Martin ** Martin ** Martin This issue was already reported some time ago without a final result: http://old.nabble.com/unit-test-for-dropdownchoice-with-ajax-td21141772.html I created an example project that shows this issue: http://github.com/magro/misc/tree/master/wicket-tester-drop-downs/ This is the short link to the failing test case (on github): http://is.gd/58mq3 This is the tested page class: http://is.gd/58mDm I'm using wicket 1.4.3. Is there any error in the test? Can I do anything to work around this, or is it a bug? Thanx cheers, Martin -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org signature.asc Description: This is a digitally signed message part
Re: test for dropdownchoice with ajax - response is homepage always
Line 63 you are re-using the same formTester. Cannot work. ** Martin 2009/12/1 Martin Grotzke martin.grot...@javakaffee.de: On Tue, 2009-12-01 at 11:44 +0200, Martin Makundi wrote: Thanx for your feedback! Did you have a look at http://is.gd/58mq3 which shows the test? Ofcourse I didn't look ;) Now, having looked at it your bug is that FORMTESTER CAN BE SUBMITTED ONLY ONCE! If you want to use it another time, you need to call newFormTester again. Thanx, this fixed the issue! Now I extended the test to make sure that the previously selected make and model are still selected after the final submit - and this fails with the second drop down (the model): this returns null from dropDown.getDefaultModelObject. I pushed this, so http://is.gd/58mq3 shows these changes. Is there another thing that needs to be changed in the test? Cheers, Martin ** Martin ** Martin This issue was already reported some time ago without a final result: http://old.nabble.com/unit-test-for-dropdownchoice-with-ajax-td21141772.html I created an example project that shows this issue: http://github.com/magro/misc/tree/master/wicket-tester-drop-downs/ This is the short link to the failing test case (on github): http://is.gd/58mq3 This is the tested page class: http://is.gd/58mDm I'm using wicket 1.4.3. Is there any error in the test? Can I do anything to work around this, or is it a bug? Thanx cheers, Martin -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: test for dropdownchoice with ajax - response is homepage always
On Tue, 2009-12-01 at 15:46 +0200, Martin Makundi wrote: Line 63 you are re-using the same formTester. Cannot work. Wow, really fast! :) However, I already had tested this and it doesn't make any difference - the test still fails with the same error. FWIW, I updated and pushed the test so that you can see what I actually changed. Thanx cheers, Martin ** Martin 2009/12/1 Martin Grotzke martin.grot...@javakaffee.de: On Tue, 2009-12-01 at 11:44 +0200, Martin Makundi wrote: Thanx for your feedback! Did you have a look at http://is.gd/58mq3 which shows the test? Ofcourse I didn't look ;) Now, having looked at it your bug is that FORMTESTER CAN BE SUBMITTED ONLY ONCE! If you want to use it another time, you need to call newFormTester again. Thanx, this fixed the issue! Now I extended the test to make sure that the previously selected make and model are still selected after the final submit - and this fails with the second drop down (the model): this returns null from dropDown.getDefaultModelObject. I pushed this, so http://is.gd/58mq3 shows these changes. Is there another thing that needs to be changed in the test? Cheers, Martin ** Martin ** Martin This issue was already reported some time ago without a final result: http://old.nabble.com/unit-test-for-dropdownchoice-with-ajax-td21141772.html I created an example project that shows this issue: http://github.com/magro/misc/tree/master/wicket-tester-drop-downs/ This is the short link to the failing test case (on github): http://is.gd/58mq3 This is the tested page class: http://is.gd/58mDm I'm using wicket 1.4.3. Is there any error in the test? Can I do anything to work around this, or is it a bug? Thanx cheers, Martin -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org signature.asc Description: This is a digitally signed message part
Re: test for dropdownchoice with ajax - response is homepage always
However, I already had tested this and it doesn't make any difference - the test still fails with the same error. I am not sure what you are doing. Do like this { // Operation 1 FormTester f1 = tester.newFormTester (...); f1.setValue tester.execute ... } { // Operation 2 FormTester f1 = tester.newFormTester (...); f1.setValue f1.submit } ** Martin Thanx cheers, Martin ** Martin 2009/12/1 Martin Grotzke martin.grot...@javakaffee.de: On Tue, 2009-12-01 at 11:44 +0200, Martin Makundi wrote: Thanx for your feedback! Did you have a look at http://is.gd/58mq3 which shows the test? Ofcourse I didn't look ;) Now, having looked at it your bug is that FORMTESTER CAN BE SUBMITTED ONLY ONCE! If you want to use it another time, you need to call newFormTester again. Thanx, this fixed the issue! Now I extended the test to make sure that the previously selected make and model are still selected after the final submit - and this fails with the second drop down (the model): this returns null from dropDown.getDefaultModelObject. I pushed this, so http://is.gd/58mq3 shows these changes. Is there another thing that needs to be changed in the test? Cheers, Martin ** Martin ** Martin This issue was already reported some time ago without a final result: http://old.nabble.com/unit-test-for-dropdownchoice-with-ajax-td21141772.html I created an example project that shows this issue: http://github.com/magro/misc/tree/master/wicket-tester-drop-downs/ This is the short link to the failing test case (on github): http://is.gd/58mq3 This is the tested page class: http://is.gd/58mDm I'm using wicket 1.4.3. Is there any error in the test? Can I do anything to work around this, or is it a bug? Thanx cheers, Martin -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: test for dropdownchoice with ajax - response is homepage always
Great, it's working now. I didn't use exactly the same formTester which was used for selecting the second dropdown before, that was the reason why it didn't work. Thanx for your help, cheers, Martin On Tue, 2009-12-01 at 16:03 +0200, Martin Makundi wrote: However, I already had tested this and it doesn't make any difference - the test still fails with the same error. I am not sure what you are doing. Do like this { // Operation 1 FormTester f1 = tester.newFormTester (...); f1.setValue tester.execute ... } { // Operation 2 FormTester f1 = tester.newFormTester (...); f1.setValue f1.submit } ** Martin Thanx cheers, Martin ** Martin 2009/12/1 Martin Grotzke martin.grot...@javakaffee.de: On Tue, 2009-12-01 at 11:44 +0200, Martin Makundi wrote: Thanx for your feedback! Did you have a look at http://is.gd/58mq3 which shows the test? Ofcourse I didn't look ;) Now, having looked at it your bug is that FORMTESTER CAN BE SUBMITTED ONLY ONCE! If you want to use it another time, you need to call newFormTester again. Thanx, this fixed the issue! Now I extended the test to make sure that the previously selected make and model are still selected after the final submit - and this fails with the second drop down (the model): this returns null from dropDown.getDefaultModelObject. I pushed this, so http://is.gd/58mq3 shows these changes. Is there another thing that needs to be changed in the test? Cheers, Martin ** Martin ** Martin This issue was already reported some time ago without a final result: http://old.nabble.com/unit-test-for-dropdownchoice-with-ajax-td21141772.html I created an example project that shows this issue: http://github.com/magro/misc/tree/master/wicket-tester-drop-downs/ This is the short link to the failing test case (on github): http://is.gd/58mq3 This is the tested page class: http://is.gd/58mDm I'm using wicket 1.4.3. Is there any error in the test? Can I do anything to work around this, or is it a bug? Thanx cheers, Martin -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org signature.asc Description: This is a digitally signed message part
test for dropdownchoice with ajax - response is homepage always
Hi, When I test a page like this http://www.wicket-library.com/wicket-examples/ajax/choice with wicket tester and submit the form, the response page is the HomePage instead of the expected page (ChoicePage). This issue was already reported some time ago without a final result: http://old.nabble.com/unit-test-for-dropdownchoice-with-ajax-td21141772.html I created an example project that shows this issue: http://github.com/magro/misc/tree/master/wicket-tester-drop-downs/ This is the short link to the failing test case (on github): http://is.gd/58mq3 This is the tested page class: http://is.gd/58mDm I'm using wicket 1.4.3. Is there any error in the test? Can I do anything to work around this, or is it a bug? Thanx cheers, Martin -- Martin Grotzke http://www.javakaffee.de/blog/ signature.asc Description: This is a digitally signed message part
Re: test for dropdownchoice with ajax - response is homepage always
Hi! When I test a page like this http://www.wicket-library.com/wicket-examples/ajax/choice with wicket tester and submit the form, the response page is the HomePage instead of the expected page (ChoicePage). Do you use a formtester? The wicket tester executeajax does not properly submit the form values so what we do is we create a dummy formtester before calling executeajaxevent. That might help. ** Martin This issue was already reported some time ago without a final result: http://old.nabble.com/unit-test-for-dropdownchoice-with-ajax-td21141772.html I created an example project that shows this issue: http://github.com/magro/misc/tree/master/wicket-tester-drop-downs/ This is the short link to the failing test case (on github): http://is.gd/58mq3 This is the tested page class: http://is.gd/58mDm I'm using wicket 1.4.3. Is there any error in the test? Can I do anything to work around this, or is it a bug? Thanx cheers, Martin -- Martin Grotzke http://www.javakaffee.de/blog/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket tester test coverage
zedros wrote: I saw it, but we're using guice (when, it wouldn't be a show stopper in the end). Still, on the technical side, there's also this issue with selenium using mostly id, whereas wicket'ids change with each request... How do you solve this issue ? If the element is not in a loop, just specify the HTML ID in the template. If it is in a loop, use xpath. zedros wrote: on a broader picture, my main question was about the way you proceed, Do you test every page, including every validator or.. ? If doing so, for pages that quite often are then not touched much, i would fear the time needed for proper testing quite hard to justify. Am i wrong here ? I test my code based on risk. If it is the code that is frequently use, has a high impact if it breaks, or is likely to contain bugs, I'll test it more thoroughly. - -- Kent Tong Better way to unit test Wicket pages (http://wicketpagetest.sourceforge.net) -- View this message in context: http://old.nabble.com/Wicket-tester-test-coverage-tp26505428p26541425.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket tester test coverage
I use it, and what I'm looking for is a mean to ensure my test coverage. On Wed, Nov 25, 2009 at 6:13 AM, Kent Tong k...@cpttm.org.mo wrote: Pierre Goupil wrote: So I'm looking for a way to list all Page instances in a Wicket app, which could then allow me to be sure that they are all covered by a test. And when it's done maybe I could use the same system in order to ensure that Selenium (the automated functional testing tool) has covered all my pages as well (more deeply). What you need is TDD. Once you adopt TDD, you will have every page tested. - -- Kent Tong Better way to unit test Wicket pages ( http://wicketpagetest.sourceforge.net) -- View this message in context: http://old.nabble.com/Wicket-tester-test-coverage-tp26505428p26507647.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand)
Re: Wicket tester test coverage
Hi Kent On Wed, Nov 25, 2009 at 6:13 AM, Kent Tong k...@cpttm.org.mo wrote: What you need is TDD. Once you adopt TDD, you will have every page tested. I was under the assumption that unit testing isn't valuable for GUI, esp. web gui, since the effort is too important... I think I even read uncle bob saying so. How do you suggest to write/do TDD for web pages ? thanks in advance ++ zedros - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket tester test coverage
Use Cobertura or similar. It will work for both your use cases and provide you with coverage metrics. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 25, 2009 at 2:23 AM, Pierre Goupil goupilpie...@gmail.comwrote: I use it, and what I'm looking for is a mean to ensure my test coverage. On Wed, Nov 25, 2009 at 6:13 AM, Kent Tong k...@cpttm.org.mo wrote: Pierre Goupil wrote: So I'm looking for a way to list all Page instances in a Wicket app, which could then allow me to be sure that they are all covered by a test. And when it's done maybe I could use the same system in order to ensure that Selenium (the automated functional testing tool) has covered all my pages as well (more deeply). What you need is TDD. Once you adopt TDD, you will have every page tested. - -- Kent Tong Better way to unit test Wicket pages ( http://wicketpagetest.sourceforge.net) -- View this message in context: http://old.nabble.com/Wicket-tester-test-coverage-tp26505428p26507647.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand)
Re: Wicket tester test coverage
Hi, What you can do is scan all Page classes (or Panel classes, etc) on the class-path and check if there are tests for them. Put this code in a unit test. Fail the test if you find a class without accompanying test. You can use this example to get started with the class path scanning: http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup Regards, Daan van Etten On Wed, 2009-11-25 at 09:23 +0100, Pierre Goupil wrote: I use it, and what I'm looking for is a mean to ensure my test coverage. On Wed, Nov 25, 2009 at 6:13 AM, Kent Tong k...@cpttm.org.mo wrote: Pierre Goupil wrote: So I'm looking for a way to list all Page instances in a Wicket app, which could then allow me to be sure that they are all covered by a test. And when it's done maybe I could use the same system in order to ensure that Selenium (the automated functional testing tool) has covered all my pages as well (more deeply). What you need is TDD. Once you adopt TDD, you will have every page tested. - -- Kent Tong Better way to unit test Wicket pages ( http://wicketpagetest.sourceforge.net) -- View this message in context: http://old.nabble.com/Wicket-tester-test-coverage-tp26505428p26507647.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket tester test coverage
Spring has a classpath scanner which you can copy and adapt to scan for pages and then try to instantiate them. The problem is often that pages don't have a default constructor, which is a problem if you want to instantiate them automagically. Martijn On Wed, Nov 25, 2009 at 12:57 AM, Pierre Goupil goupilpie...@gmail.com wrote: Guys, One thing that I like regarding Wicket tester is that it easily allows one to check a Page under design for any exception that it could throw at creation-time. Actually, doing such a basic test is for me essential, so as it takes only two lines of code, I systematically check all my pages this way. You know, the: // start and render the test page this.tester.startPage(HomePage.class); // assert rendered page class this.tester.assertRenderedPage(HomePage.class); thing. What I like so much with it is that any error which would occur when you load the page in FF / IE... occurs without leaving Eclipse and immediately. When the workflow to find the page in the browser is long and repetitive, it's a relief! BUT, when the number of pages grow, two related problems emerge: -you have to duplicate these two lines of code everytime, which is a (small) pain in itself -and you have no guarantee that you didn't forget any page, which is worst. So I'm looking for a way to list all Page instances in a Wicket app, which could then allow me to be sure that they are all covered by a test. And when it's done maybe I could use the same system in order to ensure that Selenium (the automated functional testing tool) has covered all my pages as well (more deeply). I could use a test coverage tool, but 1) it wouldn't work with Selenium 2) I don't want to generate a report, I want the test suit to fail if a Page is not covered by my test class. Could anyone suggest where to start, please? Regards, Pierre -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand) -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket tester test coverage
zedros wrote: I was under the assumption that unit testing isn't valuable for GUI, esp. web gui, since the effort is too important... I think I even read uncle bob saying so. How do you suggest to write/do TDD for web pages ? Without reference to his article, I can only guess that it may be pointless to test the position or the color of a button in automated tests. On the other hand, functionality of GUI can definitely be tested. For example, I am writing a Wicket application with TDD (sort of) with the library shown in my signature. It is working very well. - -- Kent Tong Better way to unit test Wicket pages (http://wicketpagetest.sourceforge.net) -- View this message in context: http://old.nabble.com/Wicket-tester-test-coverage-tp26505428p26509652.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket tester test coverage
In my other post I gave a link to a full-fledged example which scans for Panel classes with the default constructor and instantiates them. http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup This has almost no value (in my opinion) for reporting unit testing coverage. It only checks for exceptions and if the code matches the markup at instantiation. An exception could easily be thrown when replacing panels, clicking on a link or submitting a form. This is not tested. Regards, Daan van Etten On Wed, 2009-11-25 at 10:06 +0100, Martijn Dashorst wrote: Spring has a classpath scanner which you can copy and adapt to scan for pages and then try to instantiate them. The problem is often that pages don't have a default constructor, which is a problem if you want to instantiate them automagically. Martijn On Wed, Nov 25, 2009 at 12:57 AM, Pierre Goupil goupilpie...@gmail.com wrote: Guys, One thing that I like regarding Wicket tester is that it easily allows one to check a Page under design for any exception that it could throw at creation-time. Actually, doing such a basic test is for me essential, so as it takes only two lines of code, I systematically check all my pages this way. You know, the: // start and render the test page this.tester.startPage(HomePage.class); // assert rendered page class this.tester.assertRenderedPage(HomePage.class); thing. What I like so much with it is that any error which would occur when you load the page in FF / IE... occurs without leaving Eclipse and immediately. When the workflow to find the page in the browser is long and repetitive, it's a relief! BUT, when the number of pages grow, two related problems emerge: -you have to duplicate these two lines of code everytime, which is a (small) pain in itself -and you have no guarantee that you didn't forget any page, which is worst. So I'm looking for a way to list all Page instances in a Wicket app, which could then allow me to be sure that they are all covered by a test. And when it's done maybe I could use the same system in order to ensure that Selenium (the automated functional testing tool) has covered all my pages as well (more deeply). I could use a test coverage tool, but 1) it wouldn't work with Selenium 2) I don't want to generate a report, I want the test suit to fail if a Page is not covered by my test class. Could anyone suggest where to start, please? Regards, Pierre -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket tester test coverage
Ouch! It's exactly what my first point was trying to achieve. Thanx a lot! Now, I'll have to adapt it to Selenium. I'll try post it on your blog, Daan. Who said TDD?. I know that not so much is tested in this way be it's so exhaustive (regarding the total number of Pages / Components to check) plus it provide so fast feedback that I find it mandatory for whom wishes to do TDD in Wicket. Regards, Pierre On Wed, Nov 25, 2009 at 10:06 AM, Martijn Dashorst martijn.dasho...@gmail.com wrote: Spring has a classpath scanner which you can copy and adapt to scan for pages and then try to instantiate them. The problem is often that pages don't have a default constructor, which is a problem if you want to instantiate them automagically. Martijn On Wed, Nov 25, 2009 at 12:57 AM, Pierre Goupil goupilpie...@gmail.com wrote: Guys, One thing that I like regarding Wicket tester is that it easily allows one to check a Page under design for any exception that it could throw at creation-time. Actually, doing such a basic test is for me essential, so as it takes only two lines of code, I systematically check all my pages this way. You know, the: // start and render the test page this.tester.startPage(HomePage.class); // assert rendered page class this.tester.assertRenderedPage(HomePage.class); thing. What I like so much with it is that any error which would occur when you load the page in FF / IE... occurs without leaving Eclipse and immediately. When the workflow to find the page in the browser is long and repetitive, it's a relief! BUT, when the number of pages grow, two related problems emerge: -you have to duplicate these two lines of code everytime, which is a (small) pain in itself -and you have no guarantee that you didn't forget any page, which is worst. So I'm looking for a way to list all Page instances in a Wicket app, which could then allow me to be sure that they are all covered by a test. And when it's done maybe I could use the same system in order to ensure that Selenium (the automated functional testing tool) has covered all my pages as well (more deeply). I could use a test coverage tool, but 1) it wouldn't work with Selenium 2) I don't want to generate a report, I want the test suit to fail if a Page is not covered by my test class. Could anyone suggest where to start, please? Regards, Pierre -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand) -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand)
Re: Wicket tester test coverage
Pierre Goupil wrote: I use it, and what I'm looking for is a mean to ensure my test coverage. If you're using TDD, you will have developed the page and the unit test for that page at the same time and by definition you won't have a page that is not tested. - -- Kent Tong Better way to unit test Wicket pages (http://wicketpagetest.sourceforge.net) -- View this message in context: http://old.nabble.com/Wicket-tester-test-coverage-tp26505428p26509669.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket tester test coverage
Sure. But from the beginning, I was looking for a way not to write the famous 2 lines of code (see above) for each page and component. I'll have a look for sure at your lib, the Selenium integration is promising. :-) On Wed, Nov 25, 2009 at 10:25 AM, Kent Tong k...@cpttm.org.mo wrote: Pierre Goupil wrote: I use it, and what I'm looking for is a mean to ensure my test coverage. If you're using TDD, you will have developed the page and the unit test for that page at the same time and by definition you won't have a page that is not tested. - -- Kent Tong Better way to unit test Wicket pages ( http://wicketpagetest.sourceforge.net) -- View this message in context: http://old.nabble.com/Wicket-tester-test-coverage-tp26505428p26509669.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand)
Re: Wicket tester test coverage
Yeah, test coverage is a big word here. But as I said I was not looking for a way to generate a report, just a mean to have my test suit fail if 1) a page throws an exception at instantiation 2) a page has not been so tested. That's exactly what you did and I'm not surprised not to be the first one to wonder how to achieve this. Of course this test is pretty basic, but as it's totally automated, that's no big deal. You just have to know what is does and what its limits are. Reading your blog, I see that I made the same assumptions than you regarding that matter and that the need was the very same. On Wed, Nov 25, 2009 at 10:24 AM, Daan van Etten d...@stuq.nl wrote: In my other post I gave a link to a full-fledged example which scans for Panel classes with the default constructor and instantiates them. http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup This has almost no value (in my opinion) for reporting unit testing coverage. It only checks for exceptions and if the code matches the markup at instantiation. An exception could easily be thrown when replacing panels, clicking on a link or submitting a form. This is not tested. Regards, Daan van Etten On Wed, 2009-11-25 at 10:06 +0100, Martijn Dashorst wrote: Spring has a classpath scanner which you can copy and adapt to scan for pages and then try to instantiate them. The problem is often that pages don't have a default constructor, which is a problem if you want to instantiate them automagically. Martijn On Wed, Nov 25, 2009 at 12:57 AM, Pierre Goupil goupilpie...@gmail.com wrote: Guys, One thing that I like regarding Wicket tester is that it easily allows one to check a Page under design for any exception that it could throw at creation-time. Actually, doing such a basic test is for me essential, so as it takes only two lines of code, I systematically check all my pages this way. You know, the: // start and render the test page this.tester.startPage(HomePage.class); // assert rendered page class this.tester.assertRenderedPage(HomePage.class); thing. What I like so much with it is that any error which would occur when you load the page in FF / IE... occurs without leaving Eclipse and immediately. When the workflow to find the page in the browser is long and repetitive, it's a relief! BUT, when the number of pages grow, two related problems emerge: -you have to duplicate these two lines of code everytime, which is a (small) pain in itself -and you have no guarantee that you didn't forget any page, which is worst. So I'm looking for a way to list all Page instances in a Wicket app, which could then allow me to be sure that they are all covered by a test. And when it's done maybe I could use the same system in order to ensure that Selenium (the automated functional testing tool) has covered all my pages as well (more deeply). I could use a test coverage tool, but 1) it wouldn't work with Selenium 2) I don't want to generate a report, I want the test suit to fail if a Page is not covered by my test class. Could anyone suggest where to start, please? Regards, Pierre -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand)
Re: Wicket tester test coverage
Item 2 (fail if a page has not been tested) is not in my solution, but I'm glad I could help :-) Regards, Daan van Etten On Wed, 2009-11-25 at 10:32 +0100, Pierre Goupil wrote: Yeah, test coverage is a big word here. But as I said I was not looking for a way to generate a report, just a mean to have my test suit fail if 1) a page throws an exception at instantiation 2) a page has not been so tested. That's exactly what you did and I'm not surprised not to be the first one to wonder how to achieve this. Of course this test is pretty basic, but as it's totally automated, that's no big deal. You just have to know what is does and what its limits are. Reading your blog, I see that I made the same assumptions than you regarding that matter and that the need was the very same. On Wed, Nov 25, 2009 at 10:24 AM, Daan van Etten d...@stuq.nl wrote: In my other post I gave a link to a full-fledged example which scans for Panel classes with the default constructor and instantiates them. http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup This has almost no value (in my opinion) for reporting unit testing coverage. It only checks for exceptions and if the code matches the markup at instantiation. An exception could easily be thrown when replacing panels, clicking on a link or submitting a form. This is not tested. Regards, Daan van Etten On Wed, 2009-11-25 at 10:06 +0100, Martijn Dashorst wrote: Spring has a classpath scanner which you can copy and adapt to scan for pages and then try to instantiate them. The problem is often that pages don't have a default constructor, which is a problem if you want to instantiate them automagically. Martijn On Wed, Nov 25, 2009 at 12:57 AM, Pierre Goupil goupilpie...@gmail.com wrote: Guys, One thing that I like regarding Wicket tester is that it easily allows one to check a Page under design for any exception that it could throw at creation-time. Actually, doing such a basic test is for me essential, so as it takes only two lines of code, I systematically check all my pages this way. You know, the: // start and render the test page this.tester.startPage(HomePage.class); // assert rendered page class this.tester.assertRenderedPage(HomePage.class); thing. What I like so much with it is that any error which would occur when you load the page in FF / IE... occurs without leaving Eclipse and immediately. When the workflow to find the page in the browser is long and repetitive, it's a relief! BUT, when the number of pages grow, two related problems emerge: -you have to duplicate these two lines of code everytime, which is a (small) pain in itself -and you have no guarantee that you didn't forget any page, which is worst. So I'm looking for a way to list all Page instances in a Wicket app, which could then allow me to be sure that they are all covered by a test. And when it's done maybe I could use the same system in order to ensure that Selenium (the automated functional testing tool) has covered all my pages as well (more deeply). I could use a test coverage tool, but 1) it wouldn't work with Selenium 2) I don't want to generate a report, I want the test suit to fail if a Page is not covered by my test class. Could anyone suggest where to start, please? Regards, Pierre -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket tester test coverage
No, it isn't but: -with your solution, no test has to be written especially for each Component / Page (if one just want to check for exception) -so we are assured that no Page / Component is forgotten (in the check for exception process)) :-) On Wed, Nov 25, 2009 at 10:40 AM, Daan van Etten d...@stuq.nl wrote: Item 2 (fail if a page has not been tested) is not in my solution, but I'm glad I could help :-) Regards, Daan van Etten On Wed, 2009-11-25 at 10:32 +0100, Pierre Goupil wrote: Yeah, test coverage is a big word here. But as I said I was not looking for a way to generate a report, just a mean to have my test suit fail if 1) a page throws an exception at instantiation 2) a page has not been so tested. That's exactly what you did and I'm not surprised not to be the first one to wonder how to achieve this. Of course this test is pretty basic, but as it's totally automated, that's no big deal. You just have to know what is does and what its limits are. Reading your blog, I see that I made the same assumptions than you regarding that matter and that the need was the very same. On Wed, Nov 25, 2009 at 10:24 AM, Daan van Etten d...@stuq.nl wrote: In my other post I gave a link to a full-fledged example which scans for Panel classes with the default constructor and instantiates them. http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup This has almost no value (in my opinion) for reporting unit testing coverage. It only checks for exceptions and if the code matches the markup at instantiation. An exception could easily be thrown when replacing panels, clicking on a link or submitting a form. This is not tested. Regards, Daan van Etten On Wed, 2009-11-25 at 10:06 +0100, Martijn Dashorst wrote: Spring has a classpath scanner which you can copy and adapt to scan for pages and then try to instantiate them. The problem is often that pages don't have a default constructor, which is a problem if you want to instantiate them automagically. Martijn On Wed, Nov 25, 2009 at 12:57 AM, Pierre Goupil goupilpie...@gmail.com wrote: Guys, One thing that I like regarding Wicket tester is that it easily allows one to check a Page under design for any exception that it could throw at creation-time. Actually, doing such a basic test is for me essential, so as it takes only two lines of code, I systematically check all my pages this way. You know, the: // start and render the test page this.tester.startPage(HomePage.class); // assert rendered page class this.tester.assertRenderedPage(HomePage.class); thing. What I like so much with it is that any error which would occur when you load the page in FF / IE... occurs without leaving Eclipse and immediately. When the workflow to find the page in the browser is long and repetitive, it's a relief! BUT, when the number of pages grow, two related problems emerge: -you have to duplicate these two lines of code everytime, which is a (small) pain in itself -and you have no guarantee that you didn't forget any page, which is worst. So I'm looking for a way to list all Page instances in a Wicket app, which could then allow me to be sure that they are all covered by a test. And when it's done maybe I could use the same system in order to ensure that Selenium (the automated functional testing tool) has covered all my pages as well (more deeply). I could use a test coverage tool, but 1) it wouldn't work with Selenium 2) I don't want to generate a report, I want the test suit to fail if a Page is not covered by my test class. Could anyone suggest where to start, please? Regards, Pierre -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand)
Re: Wicket tester test coverage
Without reference to his article, I can only guess that it may be pointless to test the position or the color of a button in automated tests. I think it was this one : http://www.infoq.com/news/2009/11/uncle-bob-tdd-applicability but in fact uncle bob mainly says it's pointless to do TDD when not knowing where it'll end, but still one should then write the tests afterwards. On the other hand, functionality of GUI can definitely be tested. For example, I am writing a Wicket application with TDD (sort of) with the library shown in my signature. It is working very well. I saw it, but we're using guice (when, it wouldn't be a show stopper in the end). Still, on the technical side, there's also this issue with selenium using mostly id, whereas wicket'ids change with each request... How do you solve this issue ? on a broader picture, my main question was about the way you proceed, Do you test every page, including every validator or.. ? If doing so, for pages that quite often are then not touched much, i would fear the time needed for proper testing quite hard to justify. Am i wrong here ? bye zedros - -- Kent Tong Better way to unit test Wicket pages (http://wicketpagetest.sourceforge.net) -- View this message in context: http://old.nabble.com/Wicket-tester-test-coverage-tp26505428p26509652.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket tester test coverage
Guys, One thing that I like regarding Wicket tester is that it easily allows one to check a Page under design for any exception that it could throw at creation-time. Actually, doing such a basic test is for me essential, so as it takes only two lines of code, I systematically check all my pages this way. You know, the: // start and render the test page this.tester.startPage(HomePage.class); // assert rendered page class this.tester.assertRenderedPage(HomePage.class); thing. What I like so much with it is that any error which would occur when you load the page in FF / IE... occurs without leaving Eclipse and immediately. When the workflow to find the page in the browser is long and repetitive, it's a relief! BUT, when the number of pages grow, two related problems emerge: -you have to duplicate these two lines of code everytime, which is a (small) pain in itself -and you have no guarantee that you didn't forget any page, which is worst. So I'm looking for a way to list all Page instances in a Wicket app, which could then allow me to be sure that they are all covered by a test. And when it's done maybe I could use the same system in order to ensure that Selenium (the automated functional testing tool) has covered all my pages as well (more deeply). I could use a test coverage tool, but 1) it wouldn't work with Selenium 2) I don't want to generate a report, I want the test suit to fail if a Page is not covered by my test class. Could anyone suggest where to start, please? Regards, Pierre -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand)
Re: Wicket tester test coverage
Pierre Goupil wrote: So I'm looking for a way to list all Page instances in a Wicket app, which could then allow me to be sure that they are all covered by a test. And when it's done maybe I could use the same system in order to ensure that Selenium (the automated functional testing tool) has covered all my pages as well (more deeply). What you need is TDD. Once you adopt TDD, you will have every page tested. - -- Kent Tong Better way to unit test Wicket pages (http://wicketpagetest.sourceforge.net) -- View this message in context: http://old.nabble.com/Wicket-tester-test-coverage-tp26505428p26507647.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
small library to unit test Wicket pages
Dear all, I've made a small library to unit test Wicket pages: It launches Jetty to run your webapp in-process and launches the Selenium client. Then you inject POJO mock objects into @SpringBean annotated fields and use the Selenium client to drive your page. Why I think it is useful? * The key benefit is that you can control the right thing (the data your pages get, from the services), and then observe the right thing (HTML DOM elements, possible manipulated by Javascript/AJAX). * Your real application is run. You don't need to modify it in anyway. * It's very easy to implement as it relies on well established tools (Selenium and Jetty). It means it can easily be kept updated with new versions of Wicket. * Potentially this approach can be applied to frameworks other than Wicket. You're welcome to test it. Visit http://wicketpagetest.sourceforge.net/index.html for more info. -- Kent Tong Useful FREE software at http://www2.cpttm.org.mo/cyberlab/freeware - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to do unit test for a session protected wicket page?
Hi, all: I have a page which is protected by MySession.isLogin(). I want to unit test this page and write the following code: --- WicketTester tester = new WicketTester(new WebsiteApplication()); tester.createRequestCycle(); tester.setupRequestAndResponse(); tester.startPage(GmailImportPage.class); WebsiteSession session = (WebsiteSession)tester.getWicketSession(); Member m = new Member(); m.setId(2); session.setMember(m); tester.assertRenderedPage(GmailImportPage.class); --- But, the result is: expected: GmailImportPage but was IndexPage that right, IndexPage is my Index Page setting by WebsiteApplication, I think maybe I lost some steps, can anybody help me? Thanks. -- Many thanks! Haulyn Microproduction Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to do unit test for a session protected wicket page?
El jue, 22-10-2009 a las 17:07 +0800, Haulyn R. Jason escribió: Hi, all: I have a page which is protected by MySession.isLogin(). I want to unit test this page and write the following code: --- WicketTester tester = new WicketTester(new WebsiteApplication()); tester.createRequestCycle(); tester.setupRequestAndResponse(); put a User in the Session here and then isLogin() will pass tester.startPage(GmailImportPage.class); WebsiteSession session = (WebsiteSession)tester.getWicketSession(); Member m = new Member(); m.setId(2); session.setMember(m); tester.assertRenderedPage(GmailImportPage.class); --- But, the result is: expected: GmailImportPage but was IndexPage that right, IndexPage is my Index Page setting by WebsiteApplication, I think maybe I lost some steps, can anybody help me? Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to do unit test for a session protected wicket page?
Thanks very much, it works! On Thu, Oct 22, 2009 at 6:17 PM, Martin Grigorov mcgreg...@e-card.bg wrote: El jue, 22-10-2009 a las 17:07 +0800, Haulyn R. Jason escribió: Hi, all: I have a page which is protected by MySession.isLogin(). I want to unit test this page and write the following code: --- WicketTester tester = new WicketTester(new WebsiteApplication()); tester.createRequestCycle(); tester.setupRequestAndResponse(); put a User in the Session here and then isLogin() will pass tester.startPage(GmailImportPage.class); WebsiteSession session = (WebsiteSession)tester.getWicketSession(); Member m = new Member(); m.setId(2); session.setMember(m); tester.assertRenderedPage(GmailImportPage.class); --- But, the result is: expected: GmailImportPage but was IndexPage that right, IndexPage is my Index Page setting by WebsiteApplication, I think maybe I lost some steps, can anybody help me? Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Many thanks! Haulyn Microproduction You can access me with the following ways: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com, hmp.hau...@foxmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
test
Re: test
Test test? -- Jeremy Thomerson http://www.wickettraining.com On Wed, Oct 14, 2009 at 11:03 PM, wicketmon...@comcast.net wrote:
Howto test redirect to non-wicket base page
Hi *, i would like to test behavior of my page. In constructor there is a redirect if page parameter not set. But the redirect target is a url and not a wicket page instance. What is the best attribute to add my assertion to? MyPage(PageParams p) { if (p.get(xyz) == null) { redirectTo(http://www.myurl.ch;); } add(new Label(Rendered); } void redirectTo(String url) { getRequestCycle().setRedirect(true); getRequestCycle().setRequestTarget(new RedirectRequestTarget(url)); } lastRenderedPage is null so i can't add my assertion to this. Cheers Per -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Howto test redirect to non-wicket base page
Per, You can also throw a RestartResponseException or a subclass thereof. That is the recommended way within a constructor anyway. For you it would be RedirectToUrlException (or something like that). Regards, Erik. Per Newgro wrote: Hi *, i would like to test behavior of my page. In constructor there is a redirect if page parameter not set. But the redirect target is a url and not a wicket page instance. What is the best attribute to add my assertion to? MyPage(PageParams p) { if (p.get(xyz) == null) { redirectTo(http://www.myurl.ch;); } add(new Label(Rendered); } void redirectTo(String url) { getRequestCycle().setRedirect(true); getRequestCycle().setRequestTarget(new RedirectRequestTarget(url)); } lastRenderedPage is null so i can't add my assertion to this. Cheers Per -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Howto test redirect to non-wicket base page
Thanks Erik, this is definitly worth a shot. There seem to be many new classes in 1.4. So i have to dig deeper into wicket again. Thanks for showing me the light on this. Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to test AjaxFallbackButtons with WicketTester
Hi, All! I have user update form, and it have search users subform. This subform use AjaxFallbackButton as submit button. I want to test this functionality with WicketTester, but when I try do it: FormTester ft=tester.newFormTester(updateForm:selectUserForm); ft.setValue(searchUserField,test); ft.submit(searchUserButton); // this is AjaxFallbackButton After this I don`t have any search results. String searchRes=tester.getComponentFromLastRenderedPage(updateForm:selectUserForm:searchUserResultsSelector).getDefaultModelObjectAsString(); assertEquals(t...@blabla.ru, searchRes); I have one user and this user is t...@blabla.ru. Have you any ideas? Denis. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How test modal windows with wicket tester?
Hi, Martin! I try use tester.assertVisible(messageTabs:panel:company:commentForm:commentCreateModal) where messageTabs:panel:company:commentForm:commentCreateModal is my.app.class.NotificationModalWindow where NotificationModalWindow extends ModalWindow. But it not work, messageTabs:panel:company:commentForm:commentCreateModal is always visible.. Denis. Martin Makundi пишет: Hi! There is nothing special in testing modal windows. It is just a panel with a panel inside. You can use tester.assertVisible... THe only trick is if you have windowCloseCallbacks.. you need to invoke those manually using tester.executeBehavior... ** Martin 2009/9/8 Denis Kandrov dkand...@unipro.ru: I have dashboard, that have modal windows for adding comments and view dashboard message. How can I get this modal window for testing with wicket tester? And how to check that modal window is opened? Denis. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org