Created
October 23, 2013 10:06
-
-
Save DinisCruz/7115920 to your computer and use it in GitHub Desktop.
23rd Oct 2013 - more SWTBot Groovy scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.eclipse.swtbot.eclipse.finder.*; | |
| import org.eclipse.swtbot.swt.finder.utils.* | |
| Thread.start | |
| { | |
| SWTBotPreferences.TIMEOUT = 100; | |
| try | |
| { | |
| def bot = new SWTWorkbenchBot(); | |
| //def pathToProjectToOpen = "/Users/zen/Fortify-Plugin/Eclipses/workspaces/test_proj"; | |
| def pathToProjectToOpen = "/Users/zen/Fortify-Plugin/TeamMentor_Eclipse_Plugin"; | |
| def importMenu = bot.menu("File").menu("Import..."); | |
| importMenu.click(); | |
| def shell = bot.shell("Import"); | |
| shell.activate(); | |
| bot.tree().expandNode("General").select("Existing Projects into Workspace"); | |
| bot.button("Next >").click(); | |
| bot.radio("Select root directory:").click(); | |
| bot.text(0).setText(pathToProjectToOpen); | |
| eclipseApi.log("before checking tree"); | |
| def tree = bot.tree(); | |
| eclipseApi.log("before checking tree"); | |
| tree.setFocus(); | |
| def allItems = tree.allItems; | |
| assert allItems.size() == 3 | |
| assert allItems[1].text.startsWith("TeamMentor.Eclipse.PlugIn.Fortify"); | |
| assert allItems[2].text.startsWith("TeamMentor.Feature"); | |
| assert bot.button("Finish").enabled | |
| shell.close(); | |
| //inspect(tree.allItems[1]); | |
| //eclipseApi.log("after: " + tree); | |
| //inspect(bot.button("Finish")); | |
| //bot.button("Finish").click(); | |
| } | |
| catch(Exception ex) | |
| { | |
| eclipseApi.log("ex: " + ex.getMessage()); | |
| } | |
| }; | |
| return "done"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment