Questions tagged [wicket-tester]

Wicket-Tester is a unit testing framework specifically built for use with web sites/applications built with the Apache Wicket Framework.

Wicket-Tester is a unit testing framework specifically built for unit-testing web sites/applications built with the Apache Wicket Framework.

Copied from the JavaDoc
A package with utility classes to ease unit testing of Wicket applications without the need for a servlet container. The only classes required by users to test are WicketTester and FormTester. WicketTester extends MockWebApplication and extends it with convenience methods to start (render) a page and to test (assert) certain conditions.

FormTester is a utility class to make unit testing an HTML form a breeze.

Links for more information

37 questions
1
vote
1 answer

Testing Wicket panels with constructor arguments

I got a page with several panels that takes several parameters in their constructors. One of them being a menu that takes a list for the different buttons in the menu. I've tried to test it as components but get a null pointer exception. Using a…
Alvin
  • 178
  • 8
1
vote
1 answer

wicket and AtUnit

I've started playing with Wicket and I've chosen Guice as dependency injection framework. Now I'm trying to learn how to write a unit test for a WebPage object. I googled a bit and I've found this post but it mentioned AtUnit so I decided to give…
kamiseq
  • 11
  • 2
1
vote
1 answer

How do I query the text of an element (Component) using WicketTester?

Rather than specifying the id-path for components to click in WicketTester I'd like to find the link with a specific text. I can use MarkupContainer.visitChildren to run through the tree, but can I get the actual rendered component text for each…
Duncan McGregor
  • 17,665
  • 12
  • 64
  • 118
1
vote
1 answer

WicketTester Select Radio Choice and click DownloadLink

I have an issue to understand how to do it correctly, as I could not find any solution on the net. I try to test radio selection and click on a download link (bonus would be asserting the downloaded file). My Code within the Panel…
kism3t
  • 1,343
  • 1
  • 14
  • 33
1
vote
1 answer

Set a Page for Component Testing with Apache Wicket

I am testing some components in my wicket 7 application. My Component is nothing special but it inherits from public PageAwarePanel extends Panel { @Override protected void onInitialize() { super.onInitialize(); //refuse if…
kism3t
  • 1,343
  • 1
  • 14
  • 33
1
vote
2 answers

Wicket JUnit test doesn't use UTF-8 properties

I am building an application with Wicket and I am writing JUnit tests for my pages. My pages are in one package, which also contains a properties file called wicket-package.utf8.properties. The properties are successfully loaded when I deploy the…
lmazgon
  • 1,215
  • 1
  • 21
  • 40
1
vote
1 answer

How to test a link's text in Wicket

I'm trying to implement a link with dynamic text in Wicket, with the username as its text. My first thought was to do something like this in the markup: bla bla With the…
ethanfar
  • 3,733
  • 24
  • 43
1
vote
1 answer

How can I test AutoComplete component with WicketTester

I'm wondering if anyone of you could know how to test auto-complete textfield using wickettester, I have tried formTester.setValue("path",""); wicketTester.executeAjaxEvent("path","onchange"); I've tried also: Component component =…
hzitoun
  • 5,492
  • 1
  • 36
  • 43
1
vote
1 answer

Wickettester on two submits of same form

I'm having trouble sending a wickettester form twice and validating that the error message given the first time is removed in the second submit. In the code given below I first submit an empty form which is giving an error message. Then I want to…
staffang
  • 176
  • 10
0
votes
2 answers

WicketTester with Hibernate

I'm currently figuring out how to make my Wicket Application testable. Basically, it is a Wicket / Hibernate / Apache Derby setup. Hibernate is used as a filter (as seen on: http://community.jboss.org/wiki/OpenSessionInView / see…
Rob Audenaerde
  • 19,195
  • 10
  • 76
  • 121
0
votes
1 answer

How can I set http Header Data in WicketTester

I have web application that is behind a proxy. If the user has logged in, an http-header is set. I have a page that checks the header, to make sure the user isn't logged in. How can I add the header to the MockHttpRequest generated by…
Raystorm
  • 6,180
  • 4
  • 35
  • 62
0
votes
1 answer

How can I tell from a Wicket Page object that it has changed?

Here's my scenario. I'm testing a Wicket app, and I'm parsing the page text wicktetTester.getServletResponse.getDocument as XML in order to find components with XPath. This is quite expensive, so I'd like to keep the dom4j.Document until the page…
Duncan McGregor
  • 17,665
  • 12
  • 64
  • 118
0
votes
1 answer

Why my unit test is giving me an AssertionFailedError when I try to render another page

I am learning unit testing and trying to check if the login is valid on the HomePage and if so that the SuccessPage is rendered but it is giving me an AssertionFailedError .java: @Test public void validLogin(){ …
JägerKS
  • 3
  • 4
0
votes
2 answers

How to write unit testing checking null input values using wicket

I am busy with a wicket application and need to do unit testing, and I have a login page that validates inputs from a List but I have no idea where to start, I did try something but it gave me errors and just have no clue what I am doing…
JägerKS
  • 3
  • 4
0
votes
1 answer

How can I run a test in deployment mode with WicketTester?

I want to run my tests in WicketTester in deployment mode? Is it possible to do that? I tried searching the web, but WicketTester is not really well documented.