Search in sources :

Example 6 with WaitWhile

use of org.eclipse.reddeer.common.wait.WaitWhile 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 7 with WaitWhile

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

the class ImageTagTest method before.

@Before
public void before() {
    deleteAllConnections();
    getConnection();
    pullImage(IMAGE_NAME);
    getConnection().refresh();
    new WaitWhile(new JobIsRunning());
    assertTrue("Image has not been deployed!", imageIsDeployed(IMAGE_NAME));
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) Before(org.junit.Before)

Example 8 with WaitWhile

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

the class PullImageTest method testPullImageWithTag.

@Test
public void testPullImageWithTag() {
    clearConsole();
    pullImage(IMAGE_ALPINE, IMAGE_ALPINE_TAG, null);
    new WaitWhile(new JobIsRunning());
    assertTrue("Image has not been deployed!", imageIsDeployed(IMAGE_ALPINE_33));
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) Test(org.junit.Test)

Example 9 with WaitWhile

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

the class PullImageTest method testPullImageWithoutTag.

@Test
public void testPullImageWithoutTag() {
    clearConsole();
    pullImage(IMAGE_BUSYBOX);
    new WaitWhile(new JobIsRunning());
    assertTrue("Image has not been deployed!", imageIsDeployed(IMAGE_BUSYBOX_LATEST));
    assertTrue("Multiple tags of the same image has been deployed, not only latest tag!", deployedImagesCount(IMAGE_BUSYBOX) == 1);
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) Test(org.junit.Test)

Example 10 with WaitWhile

use of org.eclipse.reddeer.common.wait.WaitWhile 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)

Aggregations

WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)209 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)142 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)97 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)84 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)72 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)49 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)45 Test (org.junit.Test)42 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)36 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)36 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)31 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)24 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)22 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)19 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)19 Shell (org.eclipse.reddeer.swt.api.Shell)17 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)17 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)16 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)16