Java Code Examples for org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView#show()
The following examples show how to use
org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView#show() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FetchRemoteTracesTest.java From tracecompass with Eclipse Public License 2.0 | 6 votes |
/** * Test 8.4: Run Profile "TestAllRecursive" */ @Test public void test_8_04() { SWTBotView projectExplorerBot = fBot.viewByTitle(PROJECT_EXPLORER); projectExplorerBot.show(); SWTBotTreeItem tracesFolderItem = getTracesFolderTreeItem(projectExplorerBot); tracesFolderItem.contextMenu(FETCH_COMMAND_NAME).click(); SWTBotShell shell = fBot.shell(FETCH_SHELL_NAME).activate(); fBot.comboBox().setSelection("TestAllRecursive"); fBot.button("Next >").click(); fBot.button("Finish").click(); fBot.waitUntil(Conditions.shellCloses(shell), FETCH_TIME_OUT); WaitUtils.waitForJobs(); TmfProjectElement project = TmfProjectRegistry.getProject(ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME), true); fBot.waitUntil(new TraceCountCondition(project, 3)); final TmfTraceFolder tracesFolder = project.getTracesFolder(); assertNotNull(tracesFolder); List<TmfTraceElement> traces = tracesFolder.getTraces(); assertEquals(3, traces.size()); testTrace(traces.get(0), CONNECTION_NODE1_NAME + "/resources/generated/synthetic-trace", TRACE_TYPE_KERNEL); testTrace(traces.get(1), CONNECTION_NODE1_NAME + "/resources/syslog", TRACE_TYPE_SYSLOG); testTrace(traces.get(2), CONNECTION_NODE1_NAME + "/resources/unrecognized", null); }
Example 2
Source File: FetchRemoteTracesTest.java From tracecompass with Eclipse Public License 2.0 | 6 votes |
/** * Test 9.2: Cannot connect to remote host (wrong password) * * This test is ignored to avoid repeated authentication failures in the CI * infrastructure. The @Ignore tag can be removed to run the test locally. */ @Test @Ignore public void test_9_02() { SWTBotView projectExplorerBot = fBot.viewByTitle(PROJECT_EXPLORER); projectExplorerBot.show(); SWTBotTreeItem tracesFolderItem = getTracesFolderTreeItem(projectExplorerBot); tracesFolderItem.contextMenu(FETCH_COMMAND_NAME).click(); SWTBotShell shell = fBot.shell(FETCH_SHELL_NAME).activate(); fBot.comboBox().setSelection("TestLocal"); fBot.button("Finish").click(); SWTBotShell anyShell = SWTBotUtils.anyShellOf(fBot, AUTHENTICATION_SHELL_NAME, PASSWORD_SHELL_NAME).activate(); if (anyShell.getText().equals(AUTHENTICATION_SHELL_NAME)) { fBot.button("Yes").click(); } fBot.shell(PASSWORD_SHELL_NAME).activate(); fBot.textWithLabel("Password:").setText("anonymous"); fBot.button("OK").click(); fBot.shell(PASSWORD_SHELL_NAME).activate(); fBot.button("Cancel").click(); /* ErrorDialog is inhibited by the platform when running tests */ fBot.button("Cancel").click(); fBot.waitUntil(Conditions.shellCloses(shell), FETCH_TIME_OUT); WaitUtils.waitForJobs(); }
Example 3
Source File: FetchRemoteTracesTest.java From tracecompass with Eclipse Public License 2.0 | 6 votes |
/** * Test 9.1: Cannot connect to remote host (node doesn't exist) */ @Test public void test_9_01() { SWTBotView projectExplorerBot = fBot.viewByTitle(PROJECT_EXPLORER); projectExplorerBot.show(); SWTBotTreeItem tracesFolderItem = getTracesFolderTreeItem(projectExplorerBot); tracesFolderItem.contextMenu(FETCH_COMMAND_NAME).click(); SWTBotShell shell = fBot.shell(FETCH_SHELL_NAME).activate(); fBot.comboBox().setSelection("TestUnknown"); fBot.button("Finish").click(); /* ErrorDialog is inhibited by the platform when running tests */ fBot.button("Cancel").click(); fBot.waitUntil(Conditions.shellCloses(shell), FETCH_TIME_OUT); WaitUtils.waitForJobs(); }
Example 4
Source File: FetchRemoteTracesTest.java From tracecompass with Eclipse Public License 2.0 | 6 votes |
/** * Test 8.14: Cancel Import */ @Test public void test_8_14() { SWTBotView projectExplorerBot = fBot.viewByTitle(PROJECT_EXPLORER); projectExplorerBot.show(); SWTBotTreeItem tracesFolderItem = getTracesFolderTreeItem(projectExplorerBot); tracesFolderItem.contextMenu(FETCH_COMMAND_NAME).click(); SWTBotShell shell = fBot.shell(FETCH_SHELL_NAME).activate(); fBot.comboBox().setSelection("TestAllRecursive"); fBot.button("Next >").click(); fBot.button("Finish").click(); fBot.button("Cancel").click(); fBot.waitUntil(Conditions.shellCloses(shell), FETCH_TIME_OUT); WaitUtils.waitForJobs(); /* Can't verify cancelled import, it depends on timing */ }
Example 5
Source File: FetchRemoteTracesTest.java From tracecompass with Eclipse Public License 2.0 | 6 votes |
/** * Test 8.13: Run Profile "TestSpecificMultiGroupRecursive" */ @Test public void test_8_13() { SWTBotView projectExplorerBot = fBot.viewByTitle(PROJECT_EXPLORER); projectExplorerBot.show(); SWTBotTreeItem tracesFolderItem = getTracesFolderTreeItem(projectExplorerBot); tracesFolderItem.contextMenu(FETCH_COMMAND_NAME).click(); SWTBotShell shell = fBot.shell(FETCH_SHELL_NAME).activate(); fBot.comboBox().setSelection("TestSpecificMultiGroupRecursive"); fBot.button("Next >").click(); fBot.button("Finish").click(); fBot.waitUntil(Conditions.shellCloses(shell), FETCH_TIME_OUT); WaitUtils.waitForJobs(); TmfProjectElement project = TmfProjectRegistry.getProject(ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME), true); fBot.waitUntil(new TraceCountCondition(project, 2)); final TmfTraceFolder tracesFolder = project.getTracesFolder(); assertNotNull(tracesFolder); List<TmfTraceElement> traces = tracesFolder.getTraces(); assertEquals(2, traces.size()); testTrace(traces.get(0), CONNECTION_NODE1_NAME + "/resources/generated/synthetic-trace", TRACE_TYPE_KERNEL); testTrace(traces.get(1), CONNECTION_NODE1_NAME + "/resources/syslog", TRACE_TYPE_SYSLOG); }
Example 6
Source File: FetchRemoteTracesTest.java From tracecompass with Eclipse Public License 2.0 | 6 votes |
/** * Test 8.11: Run Profile "TestSpecificRecursive" */ @Test public void test_8_11() { SWTBotView projectExplorerBot = fBot.viewByTitle(PROJECT_EXPLORER); projectExplorerBot.show(); SWTBotTreeItem tracesFolderItem = getTracesFolderTreeItem(projectExplorerBot); tracesFolderItem.contextMenu(FETCH_COMMAND_NAME).click(); SWTBotShell shell = fBot.shell(FETCH_SHELL_NAME).activate(); fBot.comboBox().setSelection("TestSpecificRecursive"); fBot.button("Next >").click(); fBot.button("Finish").click(); fBot.waitUntil(Conditions.shellCloses(shell), FETCH_TIME_OUT); WaitUtils.waitForJobs(); TmfProjectElement project = TmfProjectRegistry.getProject(ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME), true); fBot.waitUntil(new TraceCountCondition(project, 2)); final TmfTraceFolder tracesFolder = project.getTracesFolder(); assertNotNull(tracesFolder); List<TmfTraceElement> traces = tracesFolder.getTraces(); assertEquals(2, traces.size()); testTrace(traces.get(0), CONNECTION_NODE1_NAME + "/resources/generated/synthetic-trace", TRACE_TYPE_KERNEL); testTrace(traces.get(1), CONNECTION_NODE1_NAME + "/resources/syslog", TRACE_TYPE_SYSLOG); }
Example 7
Source File: FetchRemoteTracesTest.java From tracecompass with Eclipse Public License 2.0 | 6 votes |
/** * Test 8.10: Run Profile "TestAllNonRecursive" */ @Test public void test_8_10() { SWTBotView projectExplorerBot = fBot.viewByTitle(PROJECT_EXPLORER); projectExplorerBot.show(); SWTBotTreeItem tracesFolderItem = getTracesFolderTreeItem(projectExplorerBot); tracesFolderItem.contextMenu(FETCH_COMMAND_NAME).click(); SWTBotShell shell = fBot.shell(FETCH_SHELL_NAME).activate(); fBot.comboBox().setSelection("TestAllNonRecursive"); fBot.button("Next >").click(); fBot.button("Finish").click(); fBot.waitUntil(Conditions.shellCloses(shell), FETCH_TIME_OUT); WaitUtils.waitForJobs(); TmfProjectElement project = TmfProjectRegistry.getProject(ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME), true); fBot.waitUntil(new TraceCountCondition(project, 2)); final TmfTraceFolder tracesFolder = project.getTracesFolder(); assertNotNull(tracesFolder); List<TmfTraceElement> traces = tracesFolder.getTraces(); assertEquals(2, traces.size()); testTrace(traces.get(0), CONNECTION_NODE1_NAME + "/resources/syslog", TRACE_TYPE_SYSLOG); testTrace(traces.get(1), CONNECTION_NODE1_NAME + "/resources/unrecognized", null); }
Example 8
Source File: FetchRemoteTracesTest.java From tracecompass with Eclipse Public License 2.0 | 6 votes |
/** * Test 8.9: Run Profile "TestAllRecursive" (Skip next page) */ @Test public void test_8_09() { SWTBotView projectExplorerBot = fBot.viewByTitle(PROJECT_EXPLORER); projectExplorerBot.show(); SWTBotTreeItem tracesFolderItem = getTracesFolderTreeItem(projectExplorerBot); tracesFolderItem.contextMenu(FETCH_COMMAND_NAME).click(); SWTBotShell shell = fBot.shell(FETCH_SHELL_NAME).activate(); fBot.comboBox().setSelection("TestAllRecursive"); fBot.button("Finish").click(); fBot.waitUntil(Conditions.shellCloses(shell), FETCH_TIME_OUT); WaitUtils.waitForJobs(); TmfProjectElement project = TmfProjectRegistry.getProject(ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME), true); fBot.waitUntil(new TraceCountCondition(project, 3)); final TmfTraceFolder tracesFolder = project.getTracesFolder(); assertNotNull(tracesFolder); List<TmfTraceElement> traces = tracesFolder.getTraces(); assertEquals(3, traces.size()); testTrace(traces.get(0), CONNECTION_NODE1_NAME + "/resources/generated/synthetic-trace", TRACE_TYPE_KERNEL); testTrace(traces.get(1), CONNECTION_NODE1_NAME + "/resources/syslog", TRACE_TYPE_SYSLOG); testTrace(traces.get(2), CONNECTION_NODE1_NAME + "/resources/unrecognized", null); }
Example 9
Source File: ControlViewExcludeEventsTest.java From tracecompass with Eclipse Public License 2.0 | 5 votes |
/** * Test that the Properties view has been update and shows the the right * information. */ protected void testPropertiesEventExclude() { // Open the properties view (by id) SWTBotUtils.openView("org.eclipse.ui.views.PropertySheet"); // Select the event in the Control view fBot.viewById(ControlView.ID).show(); SWTBotTreeItem eventItem = SWTBotUtils.getTreeItem(fBot, fTree, getNodeName(), ControlViewSwtBotUtil.SESSION_GROUP_NAME, getSessionName(), ControlViewSwtBotUtil.UST_DOMAIN_NAME, ControlViewSwtBotUtil.DEFAULT_CHANNEL_NAME, ControlViewSwtBotUtil.ALL_EVENTS_NAME); eventItem.select(); // Get a bot and open the Properties view SWTBotView propertiesViewBot = fBot.viewByTitle(PROPERTIES_VIEW); propertiesViewBot.show(); // Get the Exclude field in the tree SWTBotTree propertiesViewTree = propertiesViewBot.bot().tree(); SWTBotTreeItem excludeTreeItem = propertiesViewTree.getTreeItem(EXCLUDE_TREE_ITEM); // We want the VALUE of the 'Exclude' row so the cell index is 1 String excludeExpression = excludeTreeItem.cell(1); // Assert that the expression in the Properties view is the same as // the one we entered assertEquals(EXCLUDE_EXPRESSION, excludeExpression); // Close the Properties view SWTBotUtils.closeView(PROPERTIES_VIEW, fBot); }
Example 10
Source File: ICEResourcePageTester.java From ice with Eclipse Public License 1.0 | 5 votes |
/** * Simulates a double-click of the specified resource in the Resources View. * * @param resource * The resource to click. */ private void doubleClickResource(ICEResource resource) { String resourceName = resource.getName(); // Activate the Resources View. SWTBotView resourcesView = getBot().viewByTitle("Resources"); resourcesView.show(); // Find the corresponding resource in the view, then double-click it. SWTBotTreeItem node = resourcesView.bot().tree() .expandNode(resourceName); node.doubleClick(); return; }
Example 11
Source File: SwtBotWizardUtil.java From dsl-devkit with Eclipse Public License 1.0 | 5 votes |
/** * Select a folder in a project. * * @param bot * the bot * @param folderName * the folder name */ public static void selectProjectFolder(final SwtWorkbenchBot bot, final String folderName) { SWTBotView packageExplorer = bot.viewByTitle("Project Explorer"); packageExplorer.show(); Composite comp = (Composite) packageExplorer.getWidget(); final Tree tree = bot.widget(WidgetMatcherFactory.widgetOfType(Tree.class), comp); PlatformUI.getWorkbench().getDisplay().syncExec(() -> { SWTBotTree botTree = new SWTBotTree(tree); if (!selectItem(botTree, folderName)) { fail("folder was not found"); } }); }
Example 12
Source File: SWTBotTestUtil.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public static void selectElementFromFormOverview(final SWTGefBot bot, final String widgetName) { final SWTBotView view = bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW); view.show(); view.setFocus(); final SWTBotTree tree = bot.treeWithId(BONITA_OVERVIEW_TREE_ID); tree.setFocus(); bot.waitUntil(Conditions.widgetIsEnabled(tree.getTreeItem(widgetName))); tree.select(widgetName); }
Example 13
Source File: ProjectExplorerTracesFolderTest.java From tracecompass with Eclipse Public License 2.0 | 5 votes |
/** * Action : Test the import wizard from workbench menu with no project selected * <p> * <pre> * Procedure : 1) Clear selection in Project Explorer view * 2) Open import wizard from menu File > Import... > Tracing > Trace Import * 3) Browse to directory ${local}/traces/import/ * 4) Select trace ExampleCustomTxt.log * 5) Keep <Auto Detection>, select "Create Links to workspace" and * 6) press Finish * </pre> * <p> * Expected Results: Verify that trace is imported to default "Tracing" project and can be opened. */ @Test public void test3_22ImportFromMenuProjectNotSelected() { SWTBotUtils.clearTracesFolderUI(fBot, TRACE_PROJECT_NAME); SWTBotView projectExplorerBot = fBot.viewByTitle("Project Explorer"); projectExplorerBot.show(); projectExplorerBot.bot().waitUntil(Conditions.widgetIsEnabled(projectExplorerBot.bot().tree())); projectExplorerBot.bot().tree().unselect(); SWTBotShell shell = openWorkbenchMenuImport(); int optionFlags = ImportTraceWizardPage.OPTION_CREATE_LINKS_IN_WORKSPACE; importTrace(shell, null, null, optionFlags, new ImportConfirmationSupplier(), CUSTOM_TEXT_LOG.getTracePath()); verifyTrace(CUSTOM_TEXT_LOG, optionFlags, CUSTOM_TEXT_LOG.getTraceName(), CUSTOM_TEXT_LOG.getTraceType(), DEFAULT_PROJECT_NAME); SWTBotUtils.deleteProject(DEFAULT_PROJECT_NAME, fBot); }
Example 14
Source File: ProjectExplorerTracesFolderTest.java From tracecompass with Eclipse Public License 2.0 | 5 votes |
private static String getTraceProperty(SWTBotTreeItem traceItem, String property) { SWTBotUtils.openView(IPageLayout.ID_PROP_SHEET); SWTBotView view = fBot.viewById(IPageLayout.ID_PROP_SHEET); view.show(); traceItem.select(); SWTBot viewBot = view.bot(); SWTBotUtils.waitUntil(bot -> bot.tree().cell(0, 0).equals(RESOURCE_PROPERTIES), viewBot, "Resource properties did not appear"); SWTBotTreeItem traceTypeItem = SWTBotUtils.getTreeItem(viewBot, viewBot.tree(), RESOURCE_PROPERTIES, property); return traceTypeItem.cell(1); }
Example 15
Source File: ControlFlowViewTest.java From tracecompass with Eclipse Public License 2.0 | 5 votes |
/** * Before Test */ @Override @Before public void before() { SWTBotView viewBot = getViewBot(); viewBot.show(); super.before(); viewBot.setFocus(); }
Example 16
Source File: ImportAndReadKernelSmokeTest.java From tracecompass with Eclipse Public License 2.0 | 5 votes |
private static void testStateSystemExplorer(String tracePath) { // Set up SWTWorkbenchBot bot = new SWTWorkbenchBot(); SWTBotUtils.openView(CpuUsageView.ID); SWTBotView cpuUsageBot = bot.viewById(CpuUsageView.ID); // Open the view SWTBotUtils.openView(TmfStateSystemExplorer.ID); SWTBotView sseBot = bot.viewByTitle("State System Explorer"); sseBot.show(); Set<@NonNull Entry<String, Set<String>>> actualAnalyses = getSsNames(sseBot); assertTrue("Wrong state systems: expected: " + EXPECTED_ANALYSES + ", actual: " + actualAnalyses, actualAnalyses.containsAll(EXPECTED_ANALYSES)); // Re-open the view and make sure it has the same results sseBot.close(); SWTBotUtils.openView(TmfStateSystemExplorer.ID); sseBot = bot.viewByTitle("State System Explorer"); sseBot.show(); actualAnalyses = getSsNames(sseBot); assertTrue("Wrong state systems: expected: " + EXPECTED_ANALYSES + ", actual: " + actualAnalyses, actualAnalyses.containsAll(EXPECTED_ANALYSES)); // Close the trace, and re-open it, let's compare one last time bot.closeAllEditors(); bot.waitUntil(treeHasRows(sseBot.bot().tree(), 0)); // re-open the trace SWTBotUtils.openTrace(TRACE_PROJECT_NAME, tracePath, KERNEL_TRACE_TYPE); actualAnalyses = getSsNames(sseBot); assertTrue("Wrong state systems: expected: " + EXPECTED_ANALYSES + ", actual: " + actualAnalyses, actualAnalyses.containsAll(EXPECTED_ANALYSES)); sseBot.close(); cpuUsageBot.close(); }
Example 17
Source File: BotProcessDiagramPerspective.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
public BotTreeView getTreeViewPart() { final SWTBotView view = bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW); view.show(); view.setFocus(); return new BotTreeView(bot); }
Example 18
Source File: BotProcessDiagramPropertiesViewFolder.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
public BotExecutionDiagramPropertiesView selectExecutionTab() { final SWTBotView view = bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_EXECUTION); view.show(); return new BotExecutionDiagramPropertiesView(bot, view); }
Example 19
Source File: BotProcessDiagramPropertiesViewFolder.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
/** * Select the general tab. * * @return */ public BotGeneralDiagramPropertiesView selectGeneralTab() { final SWTBotView view = bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL); view.show(); return new BotGeneralDiagramPropertiesView(bot, view); }
Example 20
Source File: ControlViewLoggerTest.java From tracecompass with Eclipse Public License 2.0 | 4 votes |
/** * Test that the Properties view has been update and shows the the right * information. * * @param domain * the logger domain to test */ protected void testLoggerProperties(TraceDomainType domain) { String domainName = new String(); String logLevel = new String(); switch (domain) { case JUL: domainName = ControlViewSwtBotUtil.JUL_DOMAIN_NAME; logLevel = "<= Warning"; break; case LOG4J: domainName = ControlViewSwtBotUtil.LOG4J_DOMAIN_NAME; logLevel = "<= Fatal"; break; case PYTHON: domainName = ControlViewSwtBotUtil.PYTHON_DOMAIN_NAME; logLevel = "<= Critical"; break; //$CASES-OMITTED$ default: break; } // Open the properties view (by id) SWTBotUtils.openView("org.eclipse.ui.views.PropertySheet"); // Case 1: Select the "logger" logger in the Control view fBot.viewById(ControlView.ID).show(); SWTBotTreeItem loggerItem = SWTBotUtils.getTreeItem(fBot, fTree, getNodeName(), ControlViewSwtBotUtil.SESSION_GROUP_NAME, getSessionName(), domainName, ControlViewSwtBotUtil.LOGGER_NAME); loggerItem.select(); // Get a bot and open the Properties view SWTBotView propertiesViewBot = fBot.viewByTitle(PROPERTIES_VIEW); propertiesViewBot.show(); // Get the Log Level field in the tree SWTBotTree propertiesViewTree = propertiesViewBot.bot().tree(); SWTBotTreeItem loglevelTreeItem = propertiesViewTree.getTreeItem(LOGLEVEL_PROPERTY_NAME); // We want the VALUE of the 'Log Level' row so the cell index is 1 String loglevelExpression = loglevelTreeItem.cell(1); // Assert that the expression in the Properties view is the same as // the one we entered assertEquals("All", loglevelExpression); // Case 2: Select the "anotherLogger" logger in the Control view fBot.viewById(ControlView.ID).show(); loggerItem = SWTBotUtils.getTreeItem(fBot, fTree, getNodeName(), ControlViewSwtBotUtil.SESSION_GROUP_NAME, getSessionName(), domainName, ControlViewSwtBotUtil.ANOTHER_LOGGER_NAME); loggerItem.select(); // Get a bot and open the Properties view propertiesViewBot = fBot.viewByTitle(PROPERTIES_VIEW); propertiesViewBot.show(); // Get the Log Level field in the tree propertiesViewTree = propertiesViewBot.bot().tree(); loglevelTreeItem = propertiesViewTree.getTreeItem(LOGLEVEL_PROPERTY_NAME); // We want the VALUE of the 'Log Level' row so the cell index is 1 loglevelExpression = loglevelTreeItem.cell(1); // Assert that the expression in the Properties view is the same as // the one we entered assertEquals(logLevel, loglevelExpression); // Close the Properties view SWTBotUtils.closeView(PROPERTIES_VIEW, fBot); }