Search in sources :

Example 1 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project linuxtools by eclipse.

the class EditDockerFileTest method testEditDockerFile.

@Test
public void testEditDockerFile() {
    getConnection();
    DockerImagesTab imageTab = openDockerImagesTab();
    try {
        String dockerFilePath = new File(EDIT_DOCKERFILE_FOLDER).getCanonicalPath();
        getConnection();
        imageTab.activate();
        new DefaultToolItem("Build Image").click();
        new WaitUntil(new ShellIsAvailable("Build a Docker Image"));
        new LabeledText("Image Name:").setText(IMAGE_NAME);
        new LabeledText("Directory:").setText(dockerFilePath);
        new PushButton("Edit Dockerfile").click();
        new WaitUntil(new ShellIsAvailable("Dockerfile Editor"), TimePeriod.LONG);
        DefaultStyledText defaultStyledText = new DefaultStyledText();
        String editorText = defaultStyledText.getText();
        assertTrue("Editor is empty!", StringUtils.isNotEmpty(editorText));
        defaultStyledText.setText(BUILD_IMAGE);
        CTabFolder tabFolder = new DefaultCTabFolder();
        CTabItem tabItem = tabFolder.getSelection();
        KeyboardFactory.getKeyboard().invokeKeyCombination(SWT.CTRL, 'S');
        tabItem.close();
        new DefaultShell("Build a Docker Image").setFocus();
        new FinishButton().click();
        new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    } catch (IOException ex) {
        fail("Resource file not found!");
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) CTabFolder(org.eclipse.reddeer.swt.api.CTabFolder) DefaultCTabFolder(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabFolder) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) IOException(java.io.IOException) CTabItem(org.eclipse.reddeer.swt.api.CTabItem) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultStyledText(org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText) DefaultCTabFolder(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabFolder) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) File(java.io.File) Test(org.junit.Test)

Example 2 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project linuxtools by eclipse.

the class NewDockerConnectionPage method finish.

public void finish() {
    new WaitUntil(new ShellIsAvailable(NEW_DOCKER_CONNECTION_SHELL));
    new WaitUntil(new ControlIsEnabled(new FinishButton()));
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(NEW_DOCKER_CONNECTION_SHELL), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 3 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable 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 4 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project linuxtools by eclipse.

the class DockerImagesTab method buildImage.

public void buildImage(String name, String directory) {
    activate();
    new DefaultToolItem("Build Image").click();
    new WaitUntil(new ShellIsAvailable("Build a Docker Image"));
    new LabeledText("Image Name:").setText(name);
    new LabeledText("Directory:").setText(directory);
    new FinishButton().click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 5 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project linuxtools by eclipse.

the class RunDockerImageLaunchConfiguration method open.

/**
 * Opens Run configuration dialog
 */
public void open() {
    DockerPerspective p = new DockerPerspective();
    p.open();
    new ShellMenu().getItem("Run", "Run Configurations...").select();
    new WaitUntil(new ShellIsAvailable("Run Configurations"));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DockerPerspective(org.eclipse.linuxtools.docker.reddeer.perspective.DockerPerspective) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ShellMenu(org.eclipse.reddeer.swt.impl.menu.ShellMenu)

Aggregations

ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)128 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)97 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)84 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)73 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)52 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)47 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)44 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)33 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)32 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)25 Test (org.junit.Test)21 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)19 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)18 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)18 Shell (org.eclipse.reddeer.swt.api.Shell)17 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)14 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)13 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)13 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)10