'Logging out' after testing successful login

4 views
Skip to first unread message

John Hodorowicz

unread,
May 1, 2008, 4:58:12 PM5/1/08
to mxunit
Hi,

I'm new to MXUnit and testing patterns in general. I am writing cases
to test logging in of different user roles. Each role has a separate
home page. My first test passes but all the following tests fail. The
failures are failing such that they are being directed to the homepage
for the passing test. This makes me think I need to 'log-out' the
tester after each test. Can this be done?

I have coded in a call to my logout script after the assertions but
I'm not sure if mxunit skips anything after the asserts; if it acts
like a return.

Any thoughts or tips on testing session based logins?

Thanks,
John

Peter Bell

unread,
May 1, 2008, 5:07:11 PM5/1/08
to mxu...@googlegroups.com
Mostly mock out the session scope stuff. Then for acceptance testing
make sure you have setuip() and teardown() methods that put the app in
a good known state.

Mocking session scope if one of the few good reasons for using a
session facade IMO.

Best Wishes,
Peter

John Hodorowicz

unread,
May 1, 2008, 5:19:03 PM5/1/08
to mxunit
I'm calling my logout script at the beginning of each test case to
make sure the app is in a ready state. It doesn't seem to be running
the logout script. I'm using Coldbox so maybe I should query the
Coldbox forum for some testing tips.

Thanks,
John

Marc Esher

unread,
May 1, 2008, 5:29:02 PM5/1/08
to mxu...@googlegroups.com
Is it possible there's some coldbox caching magic going on?

Sent from my iPhone

On May 1, 2008, at 5:19 PM, John Hodorowicz

Mike Rankin

unread,
May 4, 2008, 5:36:35 PM5/4/08
to mxunit
I tend to use a ham-handed approach to a lot of my testing. I'd
probably try to destroy the session scope in the teardown.
Reply all
Reply to author
Forward
0 new messages