Search in sources :

Example 11 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project linuxtools by eclipse.

the class DockerContainer method remove.

public void remove() {
    select();
    boolean removeEnabled = new ContextMenu().getItem("Remove").isEnabled();
    if (!removeEnabled) {
        new ContextMenu().getItem("Stop").select();
        new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
        item.select();
    }
    new ContextMenu().getItem("Remove").select();
    new WaitUntil(new ShellIsAvailable("Confirm Remove Container"), TimePeriod.DEFAULT);
    new PushButton("OK").click();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 12 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-hibernate by jbosstools.

the class LaunchConfigurationsDialog method run.

/**
 * Executes configuration
 */
public void run() {
    new PushButton(this, "Run").click();
    new WaitWhile(new ShellIsAvailable(this));
    new WaitUntil(new JobIsRunning());
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 13 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-hibernate by jbosstools.

the class KnownConfigurationsView method getConsoleConfigurations.

public List<TreeItem> getConsoleConfigurations() {
    Tree tree = null;
    try {
        tree = new DefaultTree(this);
    } catch (RedDeerException e) {
        return null;
    }
    new WaitUntil(new ConfigrationsAreLoaded(tree));
    return tree.getItems();
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) Tree(org.eclipse.reddeer.swt.api.Tree) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) ConfigrationsAreLoaded(org.jboss.tools.hibernate.reddeer.condition.ConfigrationsAreLoaded) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 14 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-hibernate by jbosstools.

the class CodeGenerationConfigurationTest method checkGeneratedEntities.

private void checkGeneratedEntities(String src) {
    PackageExplorerPart pe = new PackageExplorerPart();
    pe.open();
    try {
        new WaitUntil(new EntityIsGenerated(prj, src, "org.gen", "Actor.java"));
        pe.getProject(prj).getProjectItem(src, "org.gen", "Actor.java").open();
    } catch (RedDeerException e) {
        fail("Entities not generated, possible cause https://issues.jboss.org/browse/JBIDE-19217");
    }
    new DefaultEditor("Actor.java");
}
Also used : RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) EntityIsGenerated(org.jboss.tools.hibernate.reddeer.condition.EntityIsGenerated) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) DefaultEditor(org.eclipse.reddeer.workbench.impl.editor.DefaultEditor)

Example 15 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-hibernate by jbosstools.

the class ProjectImporter method importProjectWithoutErrors.

/**
 * Import porject and requires no errors in problems log
 * @param pluginId plug-in id of project where project resources are located
 * @param projectName project name to import
 */
public static void importProjectWithoutErrors(String pluginId, String projectName, Map<String, String> libraryPathMap) {
    importProject(pluginId, projectName);
    if (libraryPathMap != null) {
        Map<String, String> fullPathJars = new HashMap<>();
        for (String jar : libraryPathMap.keySet()) {
            if (libraryPathMap.get(jar) == null) {
                fullPathJars.put(jar, LIB_DIR);
            } else {
                fullPathJars.put(jar, LIB_DIR + libraryPathMap.get(jar));
            }
        }
        ProjectHelper.addLibrariesIntoProject(projectName, fullPathJars);
    }
    new WaitUntil(new JobIsRunning(), TimePeriod.SHORT, false);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    ProblemsView problemsView = new ProblemsView();
    problemsView.open();
    new WaitWhile(new JobIsRunning());
    List<Problem> problems = problemsView.getProblems(ProblemType.ERROR);
    for (Problem p : problems) {
        log.error("Unexpected " + problems.size() + " problem(s):");
        log.dump("Problem: " + p.toString());
    }
    assertTrue("No problems after import are expected", problems.size() == 0);
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) HashMap(java.util.HashMap) Problem(org.eclipse.reddeer.eclipse.ui.problems.Problem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ProblemsView(org.eclipse.reddeer.eclipse.ui.views.markers.ProblemsView)

Aggregations

WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)178 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)74 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)73 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)63 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)59 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)54 Test (org.junit.Test)44 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)40 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)36 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)36 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)34 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)30 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)25 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)22 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)20 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)18 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)18 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)15 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)13 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)12