You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by lucast <lu...@hotmail.com> on 2014/06/02 13:33:14 UTC

TDD - End to End acceptance test - how to set form field values

Dear Forum,

I'm trying to (retro) fit TDD into my Wicket project (Wicket Spring
Hibernate) after reading "growing object-oriented software guided by tests"
by Steve Freeman and Nat Pryce.

One of the first thing the book suggest is to write an acceptance test for
each feature.

The simple feature I want to test is a user login.

Here are my steps to take:
    1 create organisation
    2 create user
       2.a set username
       2.b set password
       2.c set email
       2.d set organisation
    3 start application
    4 render login page
    5 populate username and password fields
    6 assert successful login

I am following the example from  Wicket's Wiki Spring Unit Testing the Proxy
Approach
<https://cwiki.apache.org/confluence/display/WICKET/Spring#Spring-UnitTestingtheProxyApproach> 
. 

So far, I can render the login page and assert the form components.

How do I set the form username and password before calling
WicketTester.submitForm()?

Thanks in advance,
Lucas

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/TDD-End-to-End-acceptance-test-how-to-set-form-field-values-tp4666093.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: TDD - End to End acceptance test - how to set form field values

Posted by Martin Grigorov <mg...@apache.org>.
Hi,


On Mon, Jun 2, 2014 at 1:33 PM, lucast <lu...@hotmail.com> wrote:

> Dear Forum,
>
> I'm trying to (retro) fit TDD into my Wicket project (Wicket Spring
> Hibernate) after reading "growing object-oriented software guided by tests"
> by Steve Freeman and Nat Pryce.
>
> One of the first thing the book suggest is to write an acceptance test for
> each feature.
>
> The simple feature I want to test is a user login.
>
> Here are my steps to take:
>     1 create organisation
>     2 create user
>        2.a set username
>        2.b set password
>        2.c set email
>        2.d set organisation
>     3 start application
>     4 render login page
>     5 populate username and password fields
>     6 assert successful login
>
> I am following the example from  Wicket's Wiki Spring Unit Testing the
> Proxy
> Approach
> <
> https://cwiki.apache.org/confluence/display/WICKET/Spring#Spring-UnitTestingtheProxyApproach
> >
> .
>
> So far, I can render the login page and assert the form components.
>
> How do I set the form username and password before calling
> WicketTester.submitForm()?
>

FormTester formTester = tester.newFormTester("formId");
formTester.setValue("relative:path:to:textFieldId", "John");
formTester.setValue("relative:path:to:passwordId", "secret")
formTester.submit()


>
> Thanks in advance,
> Lucas
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/TDD-End-to-End-acceptance-test-how-to-set-form-field-values-tp4666093.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>