Home » Eclipse Projects » Eclipse Platform » How to do GUI tests
How to do GUI tests [message #324209] |
Sun, 20 January 2008 05:35  |
Eclipse User |
|
|
|
Hi all,
I'm trying to figure out if there is a way to do JUnit tests of the user
interface part of my plug-in. Since some of the stuff that happens with
the various GUI contributions (in particular actions, commands, content
type filters, etc.) is not 100% trivial, I'd like to have some JUnit
tests, that simulate the user behavior, which would trigger execution of
the corresponding code.
I tried to find some tests for the org.eclipse.*.ui plugins, but none of
the things I could find were doing tests like that. So, I tried to
programmatically select the elements in the navigator view, for example,
and was hoping that that would trigger the corresponding
"selectionChanged" events. But I didn't even get that far, because
somehow I cannot even initialize the GUI properly, it seems to remain
stuck at the "Welcome" screen.
I'm a bit lost and would appreciate any pointers to what to look at.
Thanks a lot
Jochen
|
|
|
Re: How to do GUI tests [message #324212 is a reply to message #324209] |
Sun, 20 January 2008 09:49   |
Eclipse User |
|
|
|
Jochen schrieb:
> Hi all,
>
> I'm trying to figure out if there is a way to do JUnit tests of the user
> interface part of my plug-in. Since some of the stuff that happens with
> the various GUI contributions (in particular actions, commands, content
> type filters, etc.) is not 100% trivial, I'd like to have some JUnit
> tests, that simulate the user behavior, which would trigger execution of
> the corresponding code.
>
> I tried to find some tests for the org.eclipse.*.ui plugins, but none of
> the things I could find were doing tests like that. So, I tried to
> programmatically select the elements in the navigator view, for example,
> and was hoping that that would trigger the corresponding
> "selectionChanged" events. But I didn't even get that far, because
> somehow I cannot even initialize the GUI properly, it seems to remain
> stuck at the "Welcome" screen.
This won't work in SWT. You need to post those events using Display#post().
>
> I'm a bit lost and would appreciate any pointers to what to look at.
> Thanks a lot
You can
take:http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ui .tests/
there a the main platform-UI tests. When testing RCP you'll need to use
a Launcher.
Tom
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
Re: How to do GUI tests [message #324262 is a reply to message #324209] |
Mon, 21 January 2008 13:31  |
Eclipse User |
|
|
|
"Jochen" <jochen.wuttke@gmx.de> wrote in message
news:fmv85h$alt$1@build.eclipse.org...
> I'm trying to figure out if there is a way to do JUnit tests of the user
> interface part of my plug-in. Since some of the stuff that happens with
> the various GUI contributions (in particular actions, commands, content
> type filters, etc.) is not 100% trivial, I'd like to have some JUnit
> tests, that simulate the user behavior, which would trigger execution of
> the corresponding code.
>
> I tried to find some tests for the org.eclipse.*.ui plugins, but none of
> the things I could find were doing tests like that. So, I tried to
> programmatically select the elements in the navigator view, for example,
> and was hoping that that would trigger the corresponding
> "selectionChanged" events. But I didn't even get that far, because somehow
> I cannot even initialize the GUI properly, it seems to remain stuck at the
> "Welcome" screen.
Take a look at WindowTester for recording and playing back SWT / JFace / RCP
JUnit tests...
http://www.instantiations.com/windowtester/
Note that WindowTester is a commercial product that is free to developers of
open source projects including any Eclipse committer.
http://www.instantiations.com/company/opensource.html
-Eric Clayberg
Sr. Vice President of Product Development
Instantiations, Inc.
http://www.instantiations.com
http://www.windowbuilderpro.com/
Author: "Eclipse: Building Commercial Quality Plug-ins"
http://www.awprofessional.com/title/032142672X
|
|
|
Goto Forum:
Current Time: Thu Jul 10 07:35:43 EDT 2025
Powered by FUDForum. Page generated in 0.08870 seconds
|