« Return to Thread: [Functional Testing] Two Sessions?
Not currently no.
On 2 Jul 2009, at 15:42, Robert Fischer wrote:
I'm testing an interactive feature of my app, and I want to use g-func[1] to test it. This means I need to have two sessions on at the same time, so that when one does something, I can check for a change in the other. Is there an easy way to do this that I'm missing?
Depending on what is a reasonable feature need, there are a couple of ways to cut it.
For example, I think we would probably be able to swap out the HtmlUnit webclient for a new one mid-test, and pull back the other one by name. This effectively gives you separate browsers / sessions.
Another way would be to pull out pretty much everything from FunctionalTestCase into a FunctionTestClient that you can have multiple of and the test case class would just manage the "current" one and delegate all calls to it.
If the interaction you want to test is something like:
1. User A submits a chat message
2. User B refresh chat to see user A's message
3. User B submits reply chat message
4. User A refreshes to see B's message
Then I think this is still well within the ethos of G-Func as it is nicely linear and the tests remain easy to grok etc.
We could implement that quite simply I think, something like:
client "User A"
get("/messages")
client "User B"
post('/messages') { .... }
client "User A"
Eg the client method just switches to a named client.
Marc
~ ~ ~
Marc Palmer
Blog > http://www.anyware.co.uk
Twitter > http://twitter.com/wangjammer5
Grails Rocks > http://www.grailsrocks.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
« Return to Thread: [Functional Testing] Two Sessions?
| Free embeddable forum powered by Nabble | Forum Help |