Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Filling a tree with test data?(How can I fill a tree with test items?)
Filling a tree with test data? [message #1792032] Tue, 10 July 2018 10:54 Go to next message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 203
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Hi using eclipse 4.8 and the newest swtbot versions I try to write a test for a e4 rcp. having a part with a text and a tree I want to fill the tree with items (before the test). The test is writing something into text that acts as a filter. Dependent of the containing text only the items in the tree that contain the given text are shown. I don't know how to fill the tree using SWTBot. Have you any hints? Thanks! Christian
Re: Filling a tree with test data? [message #1792046 is a reply to message #1792032] Tue, 10 July 2018 13:33 Go to previous messageGo to next message
Eclipse UserFriend
Hi Christian.

May I suggest that perhaps you're going about things the wrong way. Rather than use SWTBot to "fill in data values", create your part of smaller independent pieces that can be tested individually. What is this tree supposed to show? Use a JFace TreeViewer with a Content Provider and Label Provider, and test those components. Test your model supplier that is used by the content provider. Test your contribution object to the MPart.

Brian.
Re: Filling a tree with test data? [message #1792054 is a reply to message #1792046] Tue, 10 July 2018 14:47 Go to previous messageGo to next message
Patrick Tasse is currently offline Patrick TasseFriend
Messages: 84
Registered: July 2009
Member
Hi Christian,

To add to what Brian has said, I am assuming that the tree is filled by the application, so it is up to the application to fill the tree by itself. With SWTBot you are simulating the steps that a user would do, like interacting with the filter text and verifying that the application reacts accordingly by filtering out elements in the tree.

Depending on how your application finds the data used to fill the tree, you might use your test setup to provide data to the application, perhaps by creating or copying some configuration or database file, etc. Or perhaps in your application the user must perform some actions before the tree is filled with data, then you can use SWTBot to simulate those actions (note that if those actions include interacting with a native file dialog, this is not currently supported by SWTBot).

Patrick
Re: Filling a tree with test data? [message #1792057 is a reply to message #1792054] Tue, 10 July 2018 14:52 Go to previous message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 203
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Good to have critical minds that prevent one from going wrong ways. Thanks I shall try as you proposed!
Previous Topic:How to get progress bar shell in swtbot?
Next Topic:Getting errormarkers of xtext editor
Goto Forum:
  


Current Time: Fri Apr 19 19:37:08 GMT 2024

Powered by FUDForum. Page generated in 0.02891 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top