Search in sources :

Example 81 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project linuxtools by eclipse.

the class RunDockerImageLaunchConfiguration method searchImage.

public void searchImage(String imageName, String tag) {
    selectTab(MAIN_TAB_LABEL);
    new PushButton("Search...");
    ImageSearchPage pageOne = new ImageSearchPage(new DefaultCTabItem(MAIN_TAB_LABEL));
    pageOne.searchImage(imageName);
    pageOne.next();
    new WaitWhile(new ShellIsActive("Progress Information"), TimePeriod.DEFAULT);
    ImageTagSelectionPage pageTwo = new ImageTagSelectionPage(pageOne);
    assertFalse("Search tags are empty!", pageTwo.getTags().isEmpty());
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
    assertTrue("Search results do not contains tag:" + tag + "!", pageTwo.tagsContains(tag));
    pageTwo.selectTag(tag);
    pageTwo.finish();
    new DefaultShell("Pull Image");
    new PushButton("Finish").click();
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Also used : ImageSearchPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageSearchPage) ShellIsActive(org.eclipse.reddeer.swt.condition.ShellIsActive) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ImageTagSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageTagSelectionPage) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) DefaultCTabItem(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabItem)

Example 82 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project linuxtools by eclipse.

the class DockerConnection method pullImage.

public void pullImage(String imageName, String imageTag, String dockerRegister) {
    if (getImage(imageName, imageTag) == null) {
        refreshImages();
        treeViewerHandler.getTreeItem(item, "Images").select();
        new ContextMenu().getItem("Pull...").select();
        new WaitUntil(new ShellIsAvailable("Pull Image"), TimePeriod.DEFAULT);
        Shell pullShell = new DefaultShell("Pull Image");
        // select register
        if (dockerRegister != null) {
            Combo combo = new DefaultCombo();
            combo.setSelection(dockerRegister);
        }
        new LabeledText(IMAGE_NAME_LABEL_DIALOG).setFocus();
        new LabeledText(IMAGE_NAME_LABEL_DIALOG).setText(imageTag == null ? imageName : imageName + ":" + imageTag);
        new WaitUntil(new ControlIsEnabled(new FinishButton()));
        new FinishButton(pullShell).click();
        new WaitWhile(new ShellIsAvailable(pullShell));
        new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    }
}
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) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu) Combo(org.eclipse.reddeer.swt.api.Combo) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 83 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project linuxtools by eclipse.

the class DockerConnection method removeConnection.

public void removeConnection() {
    select();
    new DefaultToolItem("Remove Connection").click();
    new WaitWhile(new JobIsRunning());
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 84 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning 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 85 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project linuxtools by eclipse.

the class BrowserContentsCheck method checkBrowserForErrorPage.

/**
 * Checks browser, if page is accessible and address is correct.
 *
 * @param browserView
 * @param url
 */
public static void checkBrowserForErrorPage(WebBrowserView browserView, String url) {
    // Try to refresh page if it is not loaded.
    if (browserView.getText().contains("Unable") || browserView.getText().contains("404")) {
        if (url == null) {
            browserView.refreshPage();
        } else {
            browserView.openPageURL(url);
        }
    }
    new WaitWhile(new JobIsRunning());
    evaluateBrowserPage(browserView.getText());
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Aggregations

JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)154 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)142 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)62 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)52 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)46 Test (org.junit.Test)36 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)31 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)29 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)28 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)23 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)19 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)18 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)18 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)17 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)16 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)14 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)14 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)13 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)12 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)10