Bug 37704 - [plan item] Support GUI test tools
Summary: [plan item] Support GUI test tools
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P4 enhancement with 2 votes (vote)
Target Milestone: 3.0   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on: 38436 15025 38438
Blocks:
  Show dependency tree
 
Reported: 2003-05-15 11:29 EDT by Jim des Rivieres CLA
Modified: 2008-09-29 03:45 EDT (History)
14 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim des Rivieres CLA 2003-05-15 11:29:44 EDT
Support GUI test tools. SWT should provide common facilties and APIs so that 
GUI test tools can integrate with SWT-based UIs. [SWT]
Comment 1 Nick Edgar CLA 2003-09-15 15:47:05 EDT
Tom,

The UI team would be interested in exploring the use of Abbott to test our 
commands and keybindings infrastructure, and perhaps other areas of our test 
suites.

Could you please let us know:
- how close is this to being open source and under which license will it be 
open sourced (i.e., if it makes sense for us to use Abbott, how soon could we 
include it in the eclipse.org repository)?

- what other code does this bring in (e.g. we don't want to require Swing)

- is it possible to generate key events to a window overall, rather than a 
specific control in the window (our key bindings mechanism is implemented 
using Display.addFilter, so it gets first crack at key events before any 
controls)?

Thanks,
Nick

Comment 2 Tom Roche CLA 2003-10-15 20:28:19 EDT
Please excuse my delay in following up to bugzilla. I posted to Nick
separately about this awhile back; I'm adding some more recent stuff
as well.

Nick Edgar  2003-09-15 15:47 -------
> The UI team would be interested in exploring the use of [Abbot] to
> test our commands and keybindings infrastructure, and perhaps other
> areas of our test suites.

> Could you please let us know:

> - how close is this to being open source and under which license
> will it be open sourced (i.e., if it makes sense for us to use
> [Abbot], how soon could we include it in the eclipse.org repository)?

The license will be CPL, since Abbot itself is available under CPL.
"Closeness to release" is harder to determine, since that's the
lawyers' call. (And harder to talk about, since the lawyers don't even
like that.) However the process is currently such that we should have
a pretty good idea by mid-Nov 03.

> - what other code does this bring in (e.g. we don't want to require
> Swing)

Both abbotforswt and Abbot are in a sense superstructural to
javax.awt.Robot. Fortunately that is part of J2SE, and will therefore
be found in any compliant JDK. I have been told that it (and its
dependencies) are part of both "the IBM JDK" and the J2SE version of
J9. (I have no idea why one is privileged over the other--are they
both not JDKs from IBM?)

Note that abbotforswt has also produced a "base Robot" (i.e. our
SWTized equivalent of java.awt.Robot) that is free from Abbot
dependencies which we are hoping to donate to Eclipse, if desired.

> - is it possible to generate key events to a window overall, rather
> than a specific control in the window (our key bindings mechanism is
> implemented using Display.addFilter, so it gets first crack at key
> events before any controls)?

I don't know. But a Window hasa shell, a parentShell, and a contents,
all of which are Control's, so I'm pretty confident we could send key
events to any of those--would that do?

I'll make a task to check on this as soon as [the unnameable site
where we manage the project] recovers from its recent upgrade.

TIA, Tom Roche <tlroche@us.ibm.com> abbotforswt admin
Comment 3 Douglas Pollock CLA 2003-10-22 11:05:37 EDT
In the past day or two, I have released two test cases to the head for
platform-ui.  These tests case use java.awt.Robot to generate key events at the
OS-level.  To do this, do the following:

1.) Grab the SWT display, and addFilter() for the type of event to listen to.
2.) Create a new Robot.
3.) Send the events you want to track.  Remember to match every event with its
opposite.  For example, a key pressed requires a key released.  Otherwise, your
OS might become very unhappy.
4.) while (display.readAndDispatch());
Comment 4 Tom Roche CLA 2003-10-22 17:10:14 EDT
Douglas Pollock  2003-10-22 11:05 -------
> In the past day or two, I have released two test cases to the head
> for platform-ui. These tests case use java.awt.Robot to generate key
> events at the OS-level.

Thanks for the validation! Two questions, one suggestion:

? Could you point me at the specific testcases?

? I'm assuming that this means

Nick Edgar  2003-09-15 15:47 (question -> statement)
>> [it is] possible to generate key events to a window overall, rather
>> than a specific control in the window (our key bindings mechanism
>> is implemented using Display.addFilter, so it gets first crack at
>> key events before any controls)

  Is that correct? (Sorry for not following up on this earlier, but
  deadline looms in my "real job")

! Instead of going all the way down to the j.a.R level, you might
  consider using abbotforswt

<IBM internal URL omitted due to fear of repeat spanking by lawyers--
 ping me and I'll send it>

  We have more usable API than

> 1.) Grab the SWT display, and addFilter() for the type of event to
>     listen to.

> 2.) Create a new Robot.

> 3.) Send the events you want to track. Remember to match every event
>     with its opposite. For example, a key pressed requires a key
>     released. Otherwise, your OS might become very unhappy.

> 4.) while (display.readAndDispatch());

  and we might even be OSS Real Soon Now ...
Comment 5 Douglas Pollock CLA 2003-10-22 17:34:51 EDT
Look in "org.eclipse.ui.tests" ... in the package 
called "org.eclipse.ui.keys".  The test cases are Bug43538Test and 
Bug43610Test.

Yes, as of M3, we rather shakily held the reins to all keys coming into the 
system.  M4 was a lot more stable, but there are still some lingering issues 
to work around.  If you want top-level key events yourself, display.addFilter
(type,listener).  Though doing so while Eclipse is running is generally 
frowned upon; it's supposed to be a platform-ui-keys thing only.

I have adopted this approach for two reasons:
1.) We really needed test coverage a couple of months ago, and so sooner is 
better than later.  We can't use Abbot in Eclipse until legal issues are 
sorted out.
2.) For the two key binding tests so far, "java.awt.Robot" appears to be 
perfect.  We don't need much, since we are trapping keys at the top-level.  
We'll see what happens when things get more complicated.
Comment 6 Tom Roche CLA 2004-01-12 11:59:43 EST
Please note that

* Abbot

http://sourceforge.net/projects/abbot

  is available under CPL.

* abbotforswt has received all preliminary approvals to OSS (to
  Abbot), and goes for final approval 27 Jan 04.

* a binary plugin for Abbot (AWT/Swing) 0.11.0 is available @

http://prdownloads.sourceforge.net/abbot/abbot-0.11.0-eclipse.zip?download

https://w3.opensource.ibm.com/frs/viewRelease.php?release_id=545&group_id=1023

* a binary plugin for abbotforswt (containing our SWT-ized Robot) is @ 

https://w3.opensource.ibm.com/frs/viewRelease.php?release_id=545&group_id=1023

  It prereqs the Abbot plugin.

* EA users report success with abbotforswt on both Windows and Linux.
  (Abbot is widely used on many platforms.)
Comment 7 Christophe Cornu CLA 2004-03-23 18:48:18 EST
bug 15025 has been marked as fixed (generate system key and mouse events)
Comment 8 Ed Burnette CLA 2004-04-28 16:19:16 EDT
The latest 3.0 plan lists this as being completed but the entry is still open, 
is it really considered completed?
Comment 9 Tom Roche CLA 2004-04-28 16:30:37 EDT
Ed Burnette  2004-04-28 16:19
> is it really considered completed?

Umm ... my group has some test automation running, but it's incomplete
without

https://bugs.eclipse.org/bugs/show_bug.cgi?id=38436

E.g. MenuItem picking requires a non-performant, platform-specific
workaround.
Comment 10 Jim des Rivieres CLA 2004-04-28 17:20:44 EDT
Bug 38436 is one limitation which can be improved in the future (window 
systems permitting). We've made significant progress on this plan item, and 
certainly enough to declare success for 3.0.
Comment 11 Dan Kehn CLA 2004-04-28 17:47:35 EDT
Success?  If the goal was to enable Abbot (and presumably Costello), then the 
inability to reasonably drive via the menu is a serious (crippling?) 
restriction.  I would love to advocate Abbot / Costello as a viable 
alternative for our performance team.  We're not there yet.
Comment 12 Dan Kehn CLA 2004-05-14 16:57:21 EDT
Please see proposed patch to enable Abbot
https://bugs.eclipse.org/bugs/show_bug.cgi?id=38436.
Comment 13 Veronika Irvine CLA 2004-08-13 10:32:35 EDT
This is no longer a plan item but ongoing maintenance.  Please enter 
individual bug reports for any outstanding issues.