Finding n-th widget of any type [message #15433] |
Mon, 19 January 2009 10:36  |
Eclipse User |
|
|
|
Is it possible or does it make sense to add this feature to SWTBot?
Description: Finding the n-th widget of a certain type.
The reason for this idea: It could be nice for finding widgets which
aren't yet supported by SWTBot. So there would perhaps be no showstoppers
of that kind.
For example: SWTBot#widget(String type, int index) returns
org.eclipse.swt.widgets.Widget.
Or an API with generics if it is possible to return the object without
having to cast it.
What do you think about this?
|
|
|
|
|
|
|
|
|
|
|
Re: Testability of nebula widgets (Re: Finding n-th widget of any type) [message #17561 is a reply to message #16564] |
Thu, 22 January 2009 23:07   |
Eclipse User |
|
|
|
Hi Ketan,
Thanks for cc'ing us on this.
Working with SWTBot would be great for some of the things I'm working
on, and getting all Nebula widgets to well with it is a goal we should
always be thinking about, but I think I first need to brush up on it
before I have any intelligent questions or suggestions on how to get
started. I'll see what I can dig into over the next week, and then I'd
like to follow up on how to get CDateTime, and especially its core,
working with SWTBot.
cheers,
Jeremy
Ketan Padegaonkar wrote:
> Nebula users,
>
> (CC'ing the nebula newsgroup for more inputs on this)
>
> There have been numerous requests from SWTBot users for adding support
> for testing Nebula widgets. This happens to be one such case.
>
> One of the things that prevents testability is when nebula exposes its
> internals by way of exposing individual SWT controls and not 'nebula
> controls'.
>
> An example would be the date/time controls. Users would ideally want to
> interact with some form of a DateTimeComposite as a single widget that
> performs all operations pertaining to date and time and not as a set of
> individual widgets that they need to orchestrate.
>
> Can the nebula team help in this regard ? Can I help in any way in this?
>
> -- Ketan
>
> On 22/1/09 14:04, Hans Schwaebli wrote:
>> I cannot find the text field (which is "decorated" by Nebula using
>> listeners) by label. So I was looking for an alternative way, which is
>> described in this thread. I will try to find it by ID, maybe that will
>> work, at least as an workaround. Maybe it was not the best decision of
>> the Nebula design team not to use inheritance, since their classes are
>> widgets, so they should extend the Widget class I think.
>>
>>
>> Ketan Patel wrote:
>>
>>> I don't see how you can find FormatterText. You will only be able to
>>> find the Text since that is the only thing known by the Composite
>>> holding it. Unless you have ways to hook into the JVM itself to
>>> inspect the objects.
>>
>>> Hans Schwaebli wrote:
>>
>>>> Ketan Patel wrote:
>>>>> Can you provide an example where swt widget does not extend the
>>>>> Widget class?
>>
>>>> Nebula widgets, for example FormattedText. Instances are created by
>>>> passing a Text object when creating a new Nebula widget. They are
>>>> loosely coupled with listeners and not by extension or aggregation.
>>
>>
>
|
|
|
Re: Testability of nebula widgets (Re: Finding n-th widget of any type) [message #17574 is a reply to message #17561] |
Thu, 22 January 2009 23:24   |
Eclipse User |
|
|
|
Hi Jeremy,
The reference to DateTime was purely as an example, and I'm not sure if
the widget is actually testable (or not) with SWTBot.
I'm happy to answer any questions that may help improve testability of
the widgets, as it'll help nebula users write better tests.
-- Ketan
On 23/1/09 09:37, Jeremy Dowdall wrote:
> Working with SWTBot would be great for some of the things I'm working
> on, and getting all Nebula widgets to well with it is a goal we should
> always be thinking about, but I think I first need to brush up on it
> before I have any intelligent questions or suggestions on how to get
> started. I'll see what I can dig into over the next week, and then I'd
> like to follow up on how to get CDateTime, and especially its core,
> working with SWTBot.
|
|
|
Re: Testability of nebula widgets (Re: Finding n-th widget of any type) [message #17613 is a reply to message #17574] |
Fri, 23 January 2009 08:08  |
Eclipse User |
|
|
|
CDateTime is the widget I primarily work on, so it's the best for me to
start with. Once I understand SWTBot better I can certainly help with
the other widgets, but Nebula is presently comprised of independent lone
developers working on their own widget(s).
I also mentioned CDateTime's core because that is being broken out into
a more universal toolkit for making other custom widgets. Working with
you on this piece is of the greatest interest to me because then other
widgets that are based on it will benefit (not just CDateTime).
From the outside, CDateTime is probably testable with SWTBot as-is, but
internally - definitely not. This is also a part I want to explore as
we need automated testing of the actual widget as much as app developers
need testing of their whole UI.
Ketan Padegaonkar wrote:
> Hi Jeremy,
>
> The reference to DateTime was purely as an example, and I'm not sure if
> the widget is actually testable (or not) with SWTBot.
>
> I'm happy to answer any questions that may help improve testability of
> the widgets, as it'll help nebula users write better tests.
>
> -- Ketan
>
> On 23/1/09 09:37, Jeremy Dowdall wrote:
>> Working with SWTBot would be great for some of the things I'm working
>> on, and getting all Nebula widgets to well with it is a goal we should
>> always be thinking about, but I think I first need to brush up on it
>> before I have any intelligent questions or suggestions on how to get
>> started. I'll see what I can dig into over the next week, and then I'd
>> like to follow up on how to get CDateTime, and especially its core,
>> working with SWTBot.
>
|
|
|
Powered by
FUDForum. Page generated in 0.03687 seconds