Fwd: Announcing SmallHttpUnitTest

stéphane ducasse ducasse at iam.unibe.ch
Tue Oct 19 17:27:24 UTC 2004


Sounds quite cool :)


Begin forwarded message:

> Resent-From: vwnc at cs.uiuc.edu
> From: Roger Whitney <whitney at cs.sdsu.edu>
> Date: 19 octobre 2004 18:42:11 GMT+02:00
> To: VWNC List <vwnc at cs.uiuc.edu>
> Resent-Cc: recipient list not shown: ;
> Subject: Announcing SmallHttpUnitTest
>
> SmallHttpUnitTest is a VW framework for testing web pages. It is 
> available at the Cincom Public Repository. You can read more about it 
> at:
>
> 	http://www.blainebuxton.com/projects/smallhttpunittest.htm
>
> SmallHttpUnitTest was developed at Camp Smalltalk in Portland this 
> summer by Blaine Buxton & myself. The goal was to produce a compact 
> language to access and test web pages. It has been used both to test 
> web pages and to extract date from web pages.
>
> Below is an example SUnit test, which tests Seaside's Counter. To 
> access a page one opens an HttpBrowser on a url. To access elements of 
> the page one can send  the tag name as a message to the browser 
> object, so browser h1 below returns all the h1 elements of the page. 
> One can also access page elements via tag attributes. So browser foo: 
> 'bar' will return all tags with attribute foo with value bar. One can 
> nest messages so  "(browser p foo: 'bar') a" will return all anchor 
> tags in side paragraphs that have an attibute foo with value 'bar'. 
> See the above URL and the tests that come with SmallHttpUnitTest for 
> more examples of usage.
>
> testNavigation
> 	| browser |
> 	browser := HttpBrowser on: 'http://localhost:8008/seaside/go/counter'.
> 	self assert: (browser h1 allSatisfy: [:each | each text = '0']).
> 	self assert: (browser a text includesAllOf: #('++' '--')).
>
> 	browser click: [:a | a text = '++'].
> 	self assert: (browser h1 text includesExactly: #('1')).
>
> 	browser click: '++'.
> 	self assert: (browser h1 text includesExactly: #('2')).
>
> 	browser click: '--'.
> 	self assert: (browser h1 text includesExactly: #('1')).
>
> ----
> Roger Whitney              Department of Computer Science
> whitney at cs.sdsu.edu        San Diego State University
> http://www.eli.sdsu.edu/   San Diego, CA 92182-7720
> (619) 583-1978
> (619) 594-3535 (office)
> (619) 594-6746 (fax)
>




More information about the Squeak-dev mailing list