Search in sources :

Example 11 with Shell

use of org.eclipse.reddeer.swt.api.Shell in project linuxtools by eclipse.

the class DockerImage method remove.

/**
 * * Removes docker image.
 */
public void remove() {
    select();
    new ContextMenu().getItem("Remove").select();
    Shell confirm = new DefaultShell("Confirm Remove Image");
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(confirm));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 12 with Shell

use of org.eclipse.reddeer.swt.api.Shell in project jbosstools-openshift by jbosstools.

the class OpenNewConnectionWizardTest method verifyNewConnectionWizardIsOpened.

private void verifyNewConnectionWizardIsOpened() {
    Shell connectionShell = new DefaultShell(OpenShiftLabel.Shell.NEW_CONNECTION);
    new DefaultCombo(OpenShiftLabel.TextLabels.NEW_CONNECTION);
    new CancelButton().click();
    new WaitWhile(new ShellIsAvailable(connectionShell));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton)

Example 13 with Shell

use of org.eclipse.reddeer.swt.api.Shell in project jbosstools-hibernate by jbosstools.

the class HibernateRedDeerTest method importMavenProject.

public static void importMavenProject(String prjName) {
    try {
        Path sourceFolder = new File("resources/prj/" + prjName).toPath();
        File dir = new File("target/" + prjName);
        if (dir.exists()) {
            deleteDir(dir);
        }
        Path destFolder = dir.toPath();
        Files.walkFileTree(sourceFolder, new SimpleFileVisitor<Path>() {

            @Override
            public FileVisitResult preVisitDirectory(final Path dir, final BasicFileAttributes attrs) throws IOException {
                Files.createDirectories(destFolder.resolve(sourceFolder.relativize(dir)));
                return FileVisitResult.CONTINUE;
            }

            @Override
            public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
                Files.copy(file, destFolder.resolve(sourceFolder.relativize(file)));
                return FileVisitResult.CONTINUE;
            }
        });
        MavenImportWizard wizard = new MavenImportWizard();
        wizard.open();
        wizard.getWizardPage().setRootDirectory("target/" + prjName);
        wizard.getWizardPage().refresh();
        wizard.getWizardPage().waitUntilProjectIsLoaded(TimePeriod.LONG);
        Shell shell = new DefaultShell("Import Maven Projects");
        new PushButton("Finish").click();
        new WaitWhile(new ShellIsAvailable(shell), TimePeriod.DEFAULT);
        new WaitUntil(new JobIsRunning(), TimePeriod.DEFAULT, false);
        new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    } catch (IOException e) {
        fail("Unable to find pom " + prjName);
    }
// TODO check error log for errors
}
Also used : Path(java.nio.file.Path) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) MavenImportWizard(org.eclipse.reddeer.eclipse.m2e.core.ui.wizard.MavenImportWizard) FileVisitResult(java.nio.file.FileVisitResult) IOException(java.io.IOException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) File(java.io.File) BasicFileAttributes(java.nio.file.attribute.BasicFileAttributes)

Example 14 with Shell

use of org.eclipse.reddeer.swt.api.Shell in project jbosstools-hibernate by jbosstools.

the class CriteriaEditor method runCriteria.

/**
 * Executes criteria
 */
public void runCriteria() {
    new DefaultToolItem("Run criteria").click();
    try {
        Shell s = new DefaultShell("Open Session factory");
        new YesButton(s).click();
        new WaitWhile(new ShellIsAvailable(s));
    } catch (RedDeerException e) {
        log.warn("Open Session factory question dialog was expected");
    } finally {
        new WaitWhile(new JobIsRunning());
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Example 15 with Shell

use of org.eclipse.reddeer.swt.api.Shell in project jbosstools-hibernate by jbosstools.

the class KnownConfigurationsView method deleteConsoleConfiguration.

/**
 * Deletes hibernate console configuration
 * @param console hibernate console configuration name
 */
public void deleteConsoleConfiguration(String console) {
    new DefaultTreeItem(new DefaultTree(this), console).select();
    new ContextMenuItem("Delete Configuration").select();
    Shell deleteShell = new DefaultShell("Delete console configuration");
    new OkButton(deleteShell).click();
    new WaitWhile(new ShellIsAvailable(deleteShell));
    new WaitWhile(new JobIsRunning());
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) EditConfigurationShell(org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Aggregations

WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)17 Shell (org.eclipse.reddeer.swt.api.Shell)17 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)17 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)17 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)7 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)7 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)7 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)6 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)5 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)5 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)4 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)4 WorkbenchShell (org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell)4 DataSourceExplorerView (org.eclipse.reddeer.eclipse.datatools.connectivity.ui.dse.views.DataSourceExplorerView)3 DefaultCombo (org.eclipse.reddeer.swt.impl.combo.DefaultCombo)3 DefaultToolItem (org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem)3 DefaultHyperlink (org.eclipse.reddeer.uiforms.impl.hyperlink.DefaultHyperlink)3 WidgetIsFound (org.eclipse.reddeer.core.condition.WidgetIsFound)2 WithMnemonicTextMatcher (org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher)2 PropertyDialog (org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog)2