| SWTBot testing controls which extend org.eclipse.ui.forms.MasterDetailsBlock [message #910769] |
Mon, 10 September 2012 07:20  |
kanarupan kularatnarajah Messages: 8 Registered: June 2012 |
Junior Member |
|
|
I'm trying to automate the swtbot ui testing for an eclipse plugin, with maven.
The particular eclipse plugin has a custom control which is extended from org.eclipse.ui.forms.MasterDetailsBlock.
This custom control contains a org.eclipse.swt.widgets.Tree.
I'm using org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.5" and org.eclipse.swtbot.swt.finder;bundle-version="2.0.5".
SWTBot couldn't find any tree when I attempt to search as follows,
SWTBotTree tree = bot.tree(); for (SWTBotTreeItem treeItem : tree.getAllItems()) {}
I tried with (which is working for org.eclipse.ui.forms.widgets.FormText),
MasterDetailsBlock masterDetailsBlock=bot.widget(widgetOfType(MasterDetailsBlock.class));
But following syntax error was shown by the eclipse (3.7.2).
'Multiple markers at this line - Bound mismatch: The generic method widgetOfType(Class) of type WidgetMatcherFactory is not applicable for the arguments (Class). The inferred type MasterDetailsBlock is not a valid substitute for the bounded parameter - Bound mismatch: The generic method widget(Matcher) of type SWTBotFactory is not applicable for the arguments (Matcher). The inferred type MasterDetailsBlock is not a valid substitute for the bounded parameter '
Please suggest me any workaround or solution to this issue.
Does SWTBot support to test org.eclipse.ui.forms.MasterDetailsBlock components? In the negative case how to contribute that facility?
Thanks in advance.
|
|
|
| Re: SWTBot testing controls which extend org.eclipse.ui.forms.MasterDetailsBlock [message #911215 is a reply to message #910769] |
Tue, 11 September 2012 03:33   |
 |
Mickael Istria Messages: 612 Registered: July 2009 Location: Grenoble, France |
Senior Member |
|
|
On 09/10/2012 01:20 PM, kanarupan kularatnarajah wrote:
> I tried with (which is working for
org.eclipse.ui.forms.widgets.FormText),
> MasterDetailsBlock
> masterDetailsBlock=bot.widget(widgetOfType(MasterDetailsBlock.class));
> Does SWTBot support to test org.eclipse.ui.forms.MasterDetailsBlock
> components?
The method "widgetOfType" signature is:
<T extends org.eclipse.swt.widgets.Widget> org.hamcrest.Matcher<T>
inUIThread(org.hamcrest.Matcher<?> matcher)
As you can see, it expects the argument T to extend
"org.eclipse.swt.widgets.Widget". A MasterDetailsBlock is not a Widget,
it's more a kind of Factory or Controller. You can't access it with
SWTBot APIs.
> In the negative case how to contribute that facility?
It does not make sense to support this in SWTBot since a
MasterDetailsBlock is not a UI component, it's a logical one.
Instead, you can seek into the details part using regular SWTBot APIs,
just as if there were no MasterDetails in your editor.
--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01800 seconds