UI testing update [message #98766] |
Thu, 17 July 2008 10:43 |
Eclipse User |
|
|
|
Originally posted by: mike.xmos.com
Hi,
I was reading through
https://bugs.eclipse.org/bugs/show_bug.cgi?id=204859 and it looks as
though the RapUITesting page is a bit out of date. Is there any chance
of a very brief overview of what the current method is to test widgets
by name e.g. what pugins to check out of CVS and what classes to use?
Cheers,
Mike
|
|
|
Re: UI testing update [message #98796 is a reply to message #98766] |
Thu, 17 July 2008 12:40 |
Eclipse User |
|
|
|
Originally posted by: rsternberg.innoopract.com
Hi Mike,
Mike Wrighton wrote:
> I was reading through
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=204859 and it looks as
> though the RapUITesting page is a bit out of date. Is there any chance
> of a very brief overview of what the current method is to test widgets
> by name e.g. what pugins to check out of CVS and what classes to use?
yes, this wiki article is outdated and needs a rewrite. I'll add a
marker there. RAP now provides a simple way of enabling UI tests:
1. Rendering widget ids to the client:
There is a constant WidgetUtil#ENABLE_UI_TESTS.
If you set a system property by the name contained in this constant to
"true", the widget ids are rendered into the id attribute of the
outermost DOM node of every client-side widget.
2. Using custom widget ids:
There is another constant WidgetUtil#CUSTOM_WIDGET_ID.
Setting the user data of a widget with the name contained in this
constant to some value results in this value being used as widget id
instead of the id given by RAP ("w1, "w2", ...).
Note that you have to ensure that the ids are unique.
Example:
mybutton.setData( WidgetUtil.CUSTOM_WIDGET_ID, "myButton" );
You can then use a UI testing tool of your choice to find the DOM node
with the id "mybutton".
Best Regards, Ralf
|
|
|
Re: UI testing update [message #98811 is a reply to message #98796] |
Thu, 17 July 2008 13:11 |
Eclipse User |
|
|
|
Originally posted by: mike.xmos.com
That sounds great, just what I need. The only other thing I was
wondering is how do you access a widget from a JFace Action? e.g. I
don't create buttons explicitly I create and register an action so is
there a way of getting the widget back so I can set the ID on it?
Ralf Sternberg wrote:
> Hi Mike,
>
> Mike Wrighton wrote:
>> I was reading through
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=204859 and it looks as
>> though the RapUITesting page is a bit out of date. Is there any chance
>> of a very brief overview of what the current method is to test widgets
>> by name e.g. what pugins to check out of CVS and what classes to use?
>
> yes, this wiki article is outdated and needs a rewrite. I'll add a
> marker there. RAP now provides a simple way of enabling UI tests:
>
> 1. Rendering widget ids to the client:
> There is a constant WidgetUtil#ENABLE_UI_TESTS.
> If you set a system property by the name contained in this constant to
> "true", the widget ids are rendered into the id attribute of the
> outermost DOM node of every client-side widget.
>
> 2. Using custom widget ids:
> There is another constant WidgetUtil#CUSTOM_WIDGET_ID.
> Setting the user data of a widget with the name contained in this
> constant to some value results in this value being used as widget id
> instead of the id given by RAP ("w1, "w2", ...).
> Note that you have to ensure that the ids are unique.
> Example:
>
> mybutton.setData( WidgetUtil.CUSTOM_WIDGET_ID, "myButton" );
>
> You can then use a UI testing tool of your choice to find the DOM node
> with the id "mybutton".
>
> Best Regards, Ralf
|
|
|
Powered by
FUDForum. Page generated in 0.02655 seconds