Search in sources :

Example 1 with DefaultToolItem

use of org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem 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 DefaultToolItem

use of org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem in project linuxtools by eclipse.

the class DockerContainersTab method refresh.

public void refresh() {
    this.activate();
    new DefaultToolItem("Refresh (F5)").click();
}
Also used : DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem)

Example 3 with DefaultToolItem

use of org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem 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 4 with DefaultToolItem

use of org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem in project linuxtools by eclipse.

the class DockerImagesTab method refresh.

public void refresh() {
    activate();
    new DefaultToolItem("Refresh (F5)").click();
}
Also used : DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem)

Example 5 with DefaultToolItem

use of org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem in project linuxtools by eclipse.

the class RunDockerImageLaunchConfiguration method createNewConfiguration.

/**
 * Creates new Docker launch configuration
 */
public void createNewConfiguration(String configurationName) {
    new DefaultTreeItem("Run Docker Image").select();
    new DefaultToolItem("New launch configuration").click();
    setName(configurationName);
}
Also used : DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem)

Aggregations

DefaultToolItem (org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem)20 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)9 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)9 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)8 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)8 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)6 WorkbenchShell (org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell)5 InternalBrowser (org.eclipse.reddeer.swt.impl.browser.InternalBrowser)4 Test (org.junit.Test)4 Shell (org.eclipse.reddeer.swt.api.Shell)3 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)3 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)3 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)3 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)2 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)2 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)2 CentralIsLoaded (org.jboss.tools.openshift.reddeer.condition.CentralIsLoaded)2 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)2 File (java.io.File)1 IOException (java.io.IOException)1