Hi all, I have been working on DeveloperStudio UI test automation (SWTBot + Maven).
The framework has been set and I have started to write tests. I found some custom controls are not very straight forward to be tested. SWTBot [1] has its own API to to find swt components. And the custom controls which are extended from org.eclipse.swtbot.swt.* can be tested using wrappers [2]. There are support for other types of controls as well (some of the org.eclipse.ui.forms.widgets)[3]. I confronted 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 semantic error was shown by the eclipse editor(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 ' A query is already posted in stack overflow by myself [4], and I'm *still on a research.* I couldn't find any up-to-date document to get a clear impression on what are *not *supported by SWTBot. In the negative case the support can be contributed [5]. Please suggest me any workarounds or solutions to solve this issue. [1] http://www.eclipse.org/swtbot/ [2] http://wiki.eclipse.org/SWTBot/Testing_Custom_Controls [3] https://github.com/eclipse/swtbot/tree/master/org.eclipse.swtbot.eclipse.ui/src/org/eclipse/swtbot/eclipse/ui/project [4]http://stackoverflow.com/questions/12347729/swtbot-testing-for-org-eclipse-ui-forms-masterdetailsblock-extensions [5] http://aniszczyk.org/2010/05/09/swtbot-and-eclipse-forms/ On Tue, Jul 10, 2012 at 11:52 AM, Kanarupan Kularatnarajah < kanaru...@wso2.com> wrote: > Hi all, > > I'm working on WSO2 Developer Studio UI testing. > > I'm onto SWTBot [1] due to the following. > > - open source UI testing tool (*plug-ins*, SWT, RCP...) > - variety of cross platform support > - good integration with JUnit framework > - adequate information on the Internet > - also recommended from experienced colleagues > > Abstract: Created a plugin which uses maven plug-in (tycho surefire) > [1] to run UI tests during maven build cycle. The pom.xml of this plug-in > is set to test the WSO2 developer studio on top of org.eclipse.sdk.ide. > > This well known Maven Architecture gives us a glance [2]. > > Steps: > > 1. Created an eclipse plug-in which can be used to test other > units (plugins, bundles etc). > > - added SWTBot dependencies (screen shot attached: > Dependencies_added.png) > - written test classes > > 2. On Eclipse IDE this test plugin can be configured run relevant > through Run As-> Run Configurations > > - I tested the* *"org.eclipse.epp.package.jee.product" as the first > step (screen shot attached:Configuring_product.png) > > > 3. Set the pom.xml for the "org.eclipse.sdk.ide" testing (as the > POC before the actual dealing with WSO2 developer studio). > > - configured the *tycho-surefire-plugin* to use the UI [3] > (pom.xml is attached: POC_Product_pom.xml) > > > 4. On top of the "org.eclipse.sdk.ide", I have imposed the WSO2 > carbon features to test WSO2 developer studio. > > - Added the necessary dependencies to perform the above mentioned task > using the pom.xml files in Developer_studio_trunk-> features-> <inside all > the directories> > - Necessary Bundle dependencies are identified using the > <BundleArtifactDef> and the<BundleDef> in the pom.xml files (resulted > pom.xml is attached: WSO2_developerStudio_pom.xml) > > > [1] http://swtbot.com/ > > [2] > http://media.techtarget.com/tss/static/articles/content/MavenMagic/Figure1.jpg<http://www.theserverside.com/news/1364572/Maven-Magic> > > [3] > http://wiki.eclipse.org/Tycho/FAQ#How_to_use_SWTBot_or_some_UI_tool_for_testing.3F > > > -- > ... K. Kanarupan > > -- ... K. Kanarupan
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev