[Seaside] Pharo/Seaside UI testing

Sven Van Caekenberghe sven at beta9.be
Thu Jan 20 20:33:51 UTC 2011


Hey Tony,

On 20 Jan 2011, at 19:18, Tony Fleig wrote:

> I just tried it and it seemd to work:
> 
> http://www.tonyfleig.com/smallthoughts/blog/seasideautomatedtesting
> 
> There's an updated version usinf Zinc in place of WebClient here:
> 
> http://www.tonyfleig.com/smallthoughts/blog/seasideautomatedtesting2
> 
> Let me know if it still doesn't work for you.

This is great!

Since our last discussion, I was interested to see how the redirects went and I saw that sadly you still had to them manually. So I decided to load all your code and to try to find out what went wrong. (BTW, I was already planning to check out TFLogin, so this was a good first step.)

I found the problem and commited a new version of Zn fixing the problem.

You could simplify the use of Zn in your code as follows:

TLTest>>#setup

	"...."
	client := (ZnHttpClient new).
	client settings followRedirect: true. "actually not needed since this is the default"
	client settings timeout: 5.

TLTest>>#clickOn:in:with:

	"..."
	response := (client post: url data: args).
	"response isRedirect ifTrue: [
		url := self baseUrl, (response location).
		response := client get: url ]."
	^ response contents

(I added some newer API in the commented out section). This could further be simplified to:

	^ (client post: url data: args) contents

All TF-Login test are/remain green with these changes.

Sven

PS: I also applied a small fix to actually honor the timeout ;-)

BTW: There is also a Zinc-Seaside adaptor, so you could use the Zn server part as well.




More information about the seaside mailing list