Login  Register

Assert SystemWindow not visible

Posted by laurent laffont on Mar 01, 2011; 8:06pm
URL: https://forum.world.st/Assert-SystemWindow-not-visible-tp3330492.html

Hi,

I'm currently exploring ways of doing TDD on GUI.  (Is there a framework for this ?)

How can I know a window has been closed ? #visible always return true. 

self assert: (SystemWindow new openInWorld delete) visible not.

fails.

However this works but a bit "heavy":

(SystemWindow labelled: 'Zork') openInWorld delete.
Smalltalk garbageCollect.

self assert: (SystemWindow allSubInstances 
detect: [:aWindow| aWindow label = 'Zork']
ifNone: [nil]) isNil. 


Laurent Laffont - @lolgzs

Pharo Smalltalk Screencasts: http://www.pharocasts.com/
Blog: http://magaloma.blogspot.com/