Community
Participate
Working Groups
SWTBotHyperlink.click() does not use the same events as a user-activated click. Issue: IHyperlinkListeners attached to the widget are not notified. Expected result: click() should fire entered / activated / exited events. PS: Ketan: I'm working on a patch already (via github)
Fix here: http://github.com/elias42/swtbot/commit/dcd42787b649e6730105a7d5a7eb8f2306776306
I like your neat stub listener. Since the listener is notified in another thread, this test may at times generate false failures when the assertion runs on the mock but the UI thread has not notified it yet. A better alternative IMHO might be something like. assertWaitForTrue(new DefaultCondition(){ public boolean test(){ return listener.whatever; } }); public assertWaitForTrue(condition){ // throws TimeoutException if the condition fails! try{ bot.waitUntil(condition); } catch(TimeoutException e){ fail("Timed out waiting for listener to be notified!"); } }