I looked at White.Core.UIItems.WindowItems.Window
's public interface and found the WaitTill
method, which paired with the IsCurrentlyActive
property did the trick:
///AppTest.cs
[Test]
public void ShouldDisplayMainForm() {
using( var wrapper = new WhiteWrapper( MYAPP_PATH ) ){
Window win = wrapper.GetWindow( "MYAPP_MAIN_FORM_TITLE" );
Assert.IsNotNull(win);
win.WaitTill( ()=> win.IsCurrentlyActive );
}
}
Now the test always fails. Sometimes it times out in the GetWindow
call, sometimes it does in WaitTill
. But it always fails when initialization does, so that's good enough for me.
To other White noobs: documentation is pretty scarce, so bear with it and look at the source (if you find some good doc source, please do tell).