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
8
votes
6 answers

How to test AjaxFormChoiceComponentUpdatingBehavior in WicketTester

In my Wicket application I used one radio button with "yes" and "no" options. If I select "No", I should display one dropdown choice. I wrote code using AjaxFormChoiceComponentUpdatingBehavior. How do I unittest this using WicketTester?
Robo
  • 81
  • 1
  • 2
6
votes
1 answer

How to type into input field with WicketTester?

I'm writing a unit test for a Wicket WebPage. I want to fire up a page, type into a field, click a link, and then make some assertions. Looking at the API of WicketTester and BaseWicketTester, I couldn't find any method that takes a path (like…
Jonik
  • 80,077
  • 70
  • 264
  • 372
6
votes
1 answer

Wicket page test, Jetty security configuration

I am trying to test my wicket project using Wicket Page Test. Starting the test causes Jetty to throw this error: 2015-03-24 17:46:24,789 WARN [:] [main] [] [||] - org.eclipse.jetty.webapp.WebAppContext - Failed startup of context…
Cloud
  • 458
  • 1
  • 13
  • 34
6
votes
1 answer

WicketTester how to get html output for component?

I want to check if a given component has a CSS class set. To do this, I would like to get the HTML output for just that specific component. WicketTester can provide the HTML output for the entire rendered page. What would be the best approach to…
Rob Audenaerde
  • 19,195
  • 10
  • 76
  • 121
5
votes
2 answers

How do I keep component paths constant across unit tests when using Wicket Tester

I have several wicket tests that target a sortable DataTable, specifically ajax-clicking the sortable column headers and asserting the contents of the rendered body rows. Now the component hierarchy of the table component's descendants is auto…
Michael-7
  • 1,739
  • 14
  • 17
4
votes
2 answers

How to unit test a custom Wicket component

Given this really simple Wicket component: public class ProductImage extends WebComponent { public ProductImage(String id, Product p) { super(id, new Model(p)); add(new AttributeModifier("src", true, new Model(p.getImage()))); …
Eduardo Costa
  • 1,974
  • 1
  • 16
  • 22
4
votes
1 answer

Wicket Auth/Roles user authentication before testing web Page

I have a web app which use Wicket Auth/Roles to login user and assign roles. (http://wicket.apache.org/learn/projects/authroles.html) You can refer to this example too: http://www.wicket-library.com/wicket-examples-6.0.x/authentication3/ I have many…
abuteau
  • 6,963
  • 4
  • 16
  • 20
4
votes
2 answers

Using WicketTester to verify a Validator is added to a TextField?

I have the following panel that I use in my wicket application and I want to write a test to ensure that calling addPatternValidator(String pattern) adds a PatternValidator to the TextField. public class StringTextBoxPanel extends Panel { private…
jrochette
  • 1,117
  • 5
  • 22
3
votes
3 answers

Can I get the source of the current Wicket Page?

I've been using wicketTester.getServetResponse.getDocument to get the text of the current page for testing, only to find that after an ajax request it is set to the ajax response, not the whole page. Is there any way to get a representation of the…
Duncan McGregor
  • 17,665
  • 12
  • 64
  • 118
3
votes
1 answer

WickeTester - IllegalStateException: No CDI context bound to application

I have Wicket Form and ProjectNameValidator class: @Inject ProjectDao dao; public ProjectNameValidator() { CdiContainer.get().getNonContextualManager().inject(this); } the injection here is because the @Inject annotation works only in…
3
votes
1 answer

Guice and Wicket: using SessionScoped injections

I have a working Wicket [v6] application with Guice [v3] - I have used dependency injection for repository operations right now and I want to expend it into using services that are session scoped (one per user's session). I have read through…
Paul
  • 389
  • 3
  • 11
3
votes
1 answer

Wicket (Java) : How to use wickettester to test if 404 redirected to correct page

With the wicketframework it's possible to use wickettester and see lastrenderedpage. I want to test if my wicketapplication redirects the user to my custom ErrorPage on runtimeexceptions and missing resources (404). For the first case i set the…
Beamie
  • 647
  • 7
  • 23
2
votes
2 answers

unit-testing Wicket input components

I just wrote my first Wicket component :) It contains a ListView with some Radio input fields. Now I want to unit test if a selected value makes its way to the model. As WicketTester.newFormTester("myForm") expects a form, I try to create a form on…
Marcus
  • 1,857
  • 4
  • 22
  • 44
2
votes
1 answer

Unit test with WicketTester and CDI-Unit works in Eclipse but fails during Maven build. What am I missing?

I am trying out using CDI-Unit to test my Wicket components, which are using CDI for dependency injection. Tests seems to work perfectly in Eclipse but fail during my Maven build and I cant seem to find any hints and what is wrong. I have created a…
Jesper Tejlgaard
  • 827
  • 10
  • 16
2
votes
1 answer

testing wicket pages

I am writing tests for wicket pages. I have three dropdowns on my page. Depending upon the values selected from the dropdowns the panel gets rendered(the panel contains a data table). How do I change the values of the dropdowns from the wicket test…
sweetcode
  • 159
  • 1
  • 12
1
2 3