[SWTBotTest] How to retrieve/check exists of a context menu [message #1597141] |
Mon, 02 February 2015 04:56 |
Huy Le Messages: 18 Registered: November 2014 |
Junior Member |
|
|
Hello,
I wrote a test to check an context menu not available as expected.
I've found no api support it. What i can do is using try..catch(WidgetNotFoundException) which is not a good solution since it take time till timeout happen, increase test time execution.
Do we have better answer for the issue?
Thanks.
Thanh Huy LE
[Updated on: Mon, 02 February 2015 05:57] Report message to a moderator
|
|
|
Re: [SWTBotTest] How to retrieve/check exists of a context menu [message #1602484 is a reply to message #1597141] |
Thu, 05 February 2015 15:45 |
|
Hello,
I think that you could do that by modifying a little the service
SWTBotUtils.hasContextMenu(...).
In this service there is a call to swtBotContextMenu.exist(). This one
has a waiting condition on the menu item, that execute this test:
items.addAll(menuFinder.findMenus(matcher));
return !items.isEmpty();
You can try to have the same test but without the waiting condition.
Regards,
Steve
Le 02/02/2015 05:56, Huy Le a écrit :
> Hello,
>
> I wrote a test to check an context menu not available as expected.
>
> I've found any api support it. What i can do is using
> try..catch(WidgetNotFoundException) which is not a good solution since
> it take time till timeout happen, increase test time execution.
>
> Do we have better answer for the issue?
>
> Thanks.
>
> Thanh Huy LE
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: [SWTBotTest] How to retrieve/check exists of a context menu [message #1610020 is a reply to message #1607974] |
Tue, 10 February 2015 13:51 |
|
Hello,
To access the Control using the SWTBotGetEditor, you need to recover the
EditPart of the Diagram and then its viewer. Therefore you should use
the following expression:
editor.getDiagramEditPart().getViewer().getControl().
Regards,
Steve
Le 09/02/2015 08:24, Huy Le a écrit :
> Thanks,
>
> However, SWTBotUtils.hasContextMenu() applied to TreeItem. The method
> requires two objects: Display and Control where we can retrieve them by
> call treeItem.display and treeItem.widget.getParent()
>
> How can we do same thing via SWTBotGefEditor when a node selected?
> As I know, editor.getWidget().getDisplay() return Display. What proper
> method return the Control?
>
> (I expect editor.getSWTBotGefViewer().getControl() but the method is
> protected)
>
> Thanh Huy LE
>
>
>
>
>
>
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.04626 seconds