[Pharo-project] GUI Testing Library

Tudor Girba tudor at tudorgirba.com
Sat Dec 3 12:09:37 CET 2011


Hi Sean,

I just wrote the first test case for Glamour using the BDDExtensions. This was for a bug that that was present in Glamour since several months, but I just did not know how to test.

With the new facilities, it got as simple as:

testExplicitAcceptDoesNotAffectTextPort
	...
	textMorph := self find: GLMPluggableTextMorph in: window.
	textMorph simulateClick.
	self simulateKeyStrokes: '4'.
	self assert: (browser panes first port: #text) value = '1234'.
	self simulateKeyStroke: $s command.
	self simulateKeyStrokes: '56'.
	self assert: (browser panes first port: #text) value = '123456'

It's just cool.

Thanks,
Doru


On 23 Nov 2011, at 16:17, Tudor Girba wrote:

> Wow, this looks brilliant!
> 
> I will definitely give it a try in the following days.
> 
> Doru
> 
> On Wed, Nov 23, 2011 at 4:10 PM, Sean P. DeNigris <sean at clipperadams.com> wrote:
>> 
>> Tudor Girba-2 wrote
>>> 
>>> Could you provide more information? Or maybe an example?
>>> 
>> Sure. Thanks for the push to write tests :)
>> 
>> I just uploaded a new version with some simple tests. Here is a snippet:
>> testSimulateCmdKeystroke
>> 
>>        | ws |
>>        ws := Workspace open.
>>        self simulateKeyStrokes: 'var := 3.'.
>> 
>>        self simulateKeyStroke: $s command.
>> 
>>        self assert: ws hasUnacceptedEdits = false.
>> 
>> I'll be adding functionality as I go because I'm using it to test my own
>> GUIs, but let me know if there's anything specific that you'd really love to
>> see here...
>> 
>> Sean
>> 
>> p.s. only in a live, open, dynamic system like Smalltalk could I do this so
>> easily. I've read books devoted to this topic, but I coded this up in a few
>> minutes.
>> 
>> --
>> View this message in context: http://forum.world.st/GUI-Testing-Library-tp4097866p4099975.html
>> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>> 
>> 
> 
> 
> 
> -- 
> www.tudorgirba.com
> "Every thing has its own flow"

--
www.tudorgirba.com

"From an abstract enough point of view, any two things are similar."






More information about the Pharo-project mailing list