Hi,
Do not use beginAt after logging in. beginAt simulate
a new conversation (typically a freshly opened
browser). Use gotoPage() to go to a specific location
with the same context.
// login
beginAt("/user/loginForm");
setTextField("user[email]", email);
setTextField("user[password]", password);
submit();
// get page under test
gotoPage("/location/status");
assertFormNotPresent("user_login");
++
Julien
--- Rob Desbois <[EMAIL PROTECTED]> a écrit :
> Hi,
>
> I'm trying to test pages that require the user to be
> logged in by performing
> a login request before the page under test:
>
> // login
> >
> beginAt("/user/loginForm");
> >
> setTextField("user[email]", email);
> > setTextField("user[password]", password);
> > submit();
>
> // get page under test
> >
> beginAt("/location/status");
> > assertFormNotPresent("user_login");
> >
>
> Using dumpCookies() I can see that PHPSESSID is
> being passed back in the
> response, however it is not being set in the
> TestContext - getCookies() always
> returns an empty list for that.
>
> I know how to set a cookie in the TestContext, but
> how can I retrieve the
> cookies sent back by the server?
>
> TIA,
> --rob
>
>
> --
> Rob Desbois
> >
-------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio
> 2005.
>
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/>
_______________________________________________
> JWebUnit-users mailing list
> [email protected]
>
https://lists.sourceforge.net/lists/listinfo/jwebunit-users
>
_____________________________________________________________________________
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
JWebUnit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users