Skip to main content



      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 03:07 Go to next message
Eclipse UserFriend
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 09:18 Go to previous messageGo to next message
Eclipse UserFriend
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 09:32 Go to previous message
Eclipse UserFriend
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: Sun Jun 22 08:50:09 EDT 2025

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

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

Back to the top