Search in sources :

Example 26 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class AbstractTest method cleanUpAfterTest.

@AfterClass
public static void cleanUpAfterTest() {
    // Clean up projects from Project Explorer
    new ProjectExplorer().deleteAllProjects();
    // Close all shells if test fails (could interfere next tests)
    WorkbenchShellHandler.getInstance().closeAllNonWorbenchShells();
    // Kill running jobs if any
    OpenShiftUtils.killJobs();
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) AfterClass(org.junit.AfterClass)

Example 27 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class ImportApplicationBase method cleanClonnedProjects.

@AfterClass
public static void cleanClonnedProjects() {
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.deleteAllProjects();
    TestUtils.cleanupGitFolder(OpenShiftResources.NODEJS_GIT_NAME);
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) AfterClass(org.junit.AfterClass)

Example 28 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class CreateApplicationFromTemplateTest method deleteTestsProjectFromWorkspace.

@AfterClass
public static void deleteTestsProjectFromWorkspace() {
    new ProjectExplorer().deleteAllProjects(false);
    DatastoreOS3.generateProjectName();
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) AfterClass(org.junit.AfterClass)

Example 29 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class NodeJSAppDebugTest method testVariablesAvailableInView.

@Test
public void testVariablesAvailableInView() throws CoreException, IOException {
    ProjectExplorer pe = new ProjectExplorer();
    pe.open();
    pe.getProject(OpenShiftResources.NODEJS_GIT_NAME).getProjectItem("server.js").open();
    new WaitUntil(new EditorWithTitleIsActive("server.js"));
    TextEditor editor = new TextEditor("server.js");
    setLineBreakpoint(editor, BREAKPOINT_LINE);
    triggerDebugSession();
    // test couple of js variables
    TreeItem var_db = getVariable(VAR_db);
    TreeItem var_initDb = getVariable(VAR_initDb);
    TreeItem var_require = getVariable(VAR_require);
    assertTrue("Variable '" + VAR_db + "' not found in view!", var_db != null);
    assertThat(var_db.getCell(0), is(VAR_db));
    assertThat(var_db.getCell(1), containsString(VAR_VALUE_db));
    assertTrue("Variable '" + VAR_initDb + "' not found in view!", var_initDb != null);
    assertThat(var_initDb.getCell(0), is(VAR_initDb));
    assertThat(var_initDb.getCell(1), containsString(VAR_VALUE_initDb));
    assertTrue("Variable '" + VAR_require + "' not found in view!", var_require != null);
    assertThat(var_require.getCell(0), is(VAR_require));
    assertThat(var_require.getCell(1), containsString(VAR_VALUE_require));
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) EditorWithTitleIsActive(org.eclipse.reddeer.workbench.condition.EditorWithTitleIsActive) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 30 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class NodeJSAppDebugTest method testDebuggerStopsAtBreakpoint.

@Test
public void testDebuggerStopsAtBreakpoint() throws CoreException, IOException {
    ProjectExplorer pe = new ProjectExplorer();
    pe.open();
    pe.getProject(OpenShiftResources.NODEJS_GIT_NAME).getProjectItem("server.js").open();
    new WaitUntil(new EditorWithTitleIsActive("server.js"));
    TextEditor editor = new TextEditor("server.js");
    setLineBreakpoint(editor, BREAKPOINT_LINE);
    triggerDebugSession();
    try {
        new WaitUntil(new EditorWithTitleIsActive("server.js"), TimePeriod.LONG);
        new WaitUntil(new CursorPositionIsOnLine(editor, BREAKPOINT_LINE));
    } catch (WaitTimeoutExpiredException e) {
        Assert.fail("Debugger hasn't stopped on breakpoint");
    }
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) EditorWithTitleIsActive(org.eclipse.reddeer.workbench.condition.EditorWithTitleIsActive) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)41 Test (org.junit.Test)12 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)10 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)8 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)8 File (java.io.File)6 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)6 PropertyDialog (org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog)5 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)5 IOException (java.io.IOException)4 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)4 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)4 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)4 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)3 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)3 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)3 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)3 TextEditor (org.eclipse.reddeer.workbench.impl.editor.TextEditor)3 AfterClass (org.junit.AfterClass)3 Before (org.junit.Before)3