Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Returning to a base state after an error...?
Returning to a base state after an error...? [message #488326] Mon, 28 September 2009 07:07 Go to next message
Steven Chamberlin is currently offline Steven Chamberlin
Messages: 30
Registered: July 2009
Member
Hi, when a junit testcase fails, often there are windows still left open. If subsequent tests then try to execute, they will get confused because command of the workbench is being hijacked by this open window, which is waiting for a response. Does anyone have a good idea for a graceful way to click away any unexpected windows that might come up when a test fails so that subsequent tests can execute? Like maybe add some logic to the teardown that would click away any open windows, somehow? I'm sure people have thought about this already so would like to get your thoughts/ideas. Please include sample code if possible.

Also does anyone know if junit 4 is supported yet by SWT-Bot? Thanks a lot!

-- Steve
Re: Returning to a base state after an error...? [message #488370 is a reply to message #488326] Mon, 28 September 2009 13:18 Go to previous messageGo to next message
Pascal G is currently offline Pascal G
Messages: 157
Registered: July 2009
Senior Member
Steven Chamberlin wrote:
> Also does anyone know if junit 4 is supported yet by SWT-Bot? Thanks a
> lot!

Yes it does. In fact, the dependencies of org.eclipse.swtbot.swt.finder
towards junit is 4.3.0 or higher (with 2.0.0.371-dev-e34)


--
Pascal GĂ©linas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/

*Because performance matters.*
Re: Returning to a base state after an error...? [message #488384 is a reply to message #488326] Mon, 28 September 2009 13:32 Go to previous message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
On 28/09/09 12:37 PM, Steven Chamberlin wrote:
> Hi, when a junit testcase fails, often there are windows still left
> open. If subsequent tests then try to execute, they will get confused
> because command of the workbench is being hijacked by this open window,
> which is waiting for a response. Does anyone have a good idea for a
> graceful way to click away any unexpected windows that might come up
> when a test fails so that subsequent tests can execute? Like maybe add
> some logic to the teardown that would click away any open windows,
> somehow? I'm sure people have thought about this already so would like
> to get your thoughts/ideas. Please include sample code if possible.

http://github.com/ketan/swtbot/blob/master/org.eclipse.swtbo t.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/ widgets/SWTBotEclipseEditorTest.java

The method annotated with @After is what you're looking for.


--
Ketan
http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr
Previous Topic:pressShortcut() problem with Keystrokes.MOD2
Next Topic:Application error on rcp using headless testing framework
Goto Forum:
  


Current Time: Mon Sep 22 14:31:06 GMT 2014

Powered by FUDForum. Page generated in 0.01667 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software