Search in sources :

Example 1 with RegexMatcher

use of org.eclipse.reddeer.common.matcher.RegexMatcher in project linuxtools by eclipse.

the class ComposeTest method runDockerCompose.

private void runDockerCompose(String project, String projectFile) {
    PackageExplorerPart pe = new PackageExplorerPart();
    pe.open();
    pe.getProject(project).getProjectItem(projectFile).select();
    @SuppressWarnings("unchecked") ContextMenuItem contextMenu = new ContextMenuItem(new WithTextMatcher("Run As"), new RegexMatcher(".*Docker Compose"));
    contextMenu.select();
    new OkButton().click();
    try {
        new DefaultShell("Docker Compose");
        new PushButton("Apply and Close").click();
        fail("Docker Compose has not been found! Is it installed and the path is correct?");
    } catch (CoreLayerException ex) {
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    new WaitWhile(new ConsoleHasNoChange());
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) RegexMatcher(org.eclipse.reddeer.common.matcher.RegexMatcher) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 2 with RegexMatcher

use of org.eclipse.reddeer.common.matcher.RegexMatcher in project linuxtools by eclipse.

the class AbstractView method openViaMenu.

private void openViaMenu() {
    WithTextMatchers m = new WithTextMatchers(new RegexMatcher[] { new RegexMatcher("Window.*"), new RegexMatcher("Show View.*"), new RegexMatcher("Other...*") });
    new ShellMenu().getItem(m.getMatchers()).select();
    new DefaultShell(SHOW_VIEW);
    new DefaultTreeItem(path).select();
    new PushButton("Open").click();
    new WaitWhile(new ShellIsAvailable(SHOW_VIEW));
    new WaitUntil(new ViewCTabIsAvailable());
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) WithTextMatchers(org.eclipse.reddeer.core.matcher.WithTextMatchers) RegexMatcher(org.eclipse.reddeer.common.matcher.RegexMatcher) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ShellMenu(org.eclipse.reddeer.swt.impl.menu.ShellMenu)

Example 3 with RegexMatcher

use of org.eclipse.reddeer.common.matcher.RegexMatcher in project jbosstools-openshift by jbosstools.

the class OpenShiftUtils method handleCheatSheetCreateServerAdapter.

public static void handleCheatSheetCreateServerAdapter() {
    try {
        new WaitUntil(new ShellIsAvailable(new WithTextMatcher(new RegexMatcher(OpenShiftLabel.Shell.CHEATSHEET + "|" + OpenShiftLabel.Shell.CREATE_SERVER_ADAPTER))), TimePeriod.LONG);
        new NoButton().click();
        new DefaultShell("Create server adapter");
        new NoButton().click();
    } catch (CoreLayerException ex) {
    // Swallow, shells are not opened
    } catch (WaitTimeoutExpiredException e) {
    // Also swallow, shells are not opened
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) NoButton(org.eclipse.reddeer.swt.impl.button.NoButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) RegexMatcher(org.eclipse.reddeer.common.matcher.RegexMatcher) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Aggregations

RegexMatcher (org.eclipse.reddeer.common.matcher.RegexMatcher)3 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)3 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)2 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)2 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)2 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)2 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)2 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)2 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 WithTextMatchers (org.eclipse.reddeer.core.matcher.WithTextMatchers)1 ConsoleHasNoChange (org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)1 PackageExplorerPart (org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart)1 NoButton (org.eclipse.reddeer.swt.impl.button.NoButton)1 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)1 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)1 ShellMenu (org.eclipse.reddeer.swt.impl.menu.ShellMenu)1 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)1 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)1