Search in sources :

Example 1 with CTabItem

use of org.eclipse.reddeer.swt.api.CTabItem 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 CTabItem

use of org.eclipse.reddeer.swt.api.CTabItem in project linuxtools by eclipse.

the class DockerTerminal method getPage.

public CTabItem getPage(String pageLabel) {
    CTabFolder tabFolder = new DefaultCTabFolder();
    CTabItem tabItem = tabFolder.getSelection();
    tabItem.activate();
    return tabItem;
}
Also used : CTabFolder(org.eclipse.reddeer.swt.api.CTabFolder) DefaultCTabFolder(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabFolder) DefaultCTabFolder(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabFolder) CTabItem(org.eclipse.reddeer.swt.api.CTabItem)

Example 3 with CTabItem

use of org.eclipse.reddeer.swt.api.CTabItem in project linuxtools by eclipse.

the class EditDockerfile method getPage.

public CTabItem getPage(String pageLabel) {
    CTabFolder tabFolder = new DefaultCTabFolder();
    CTabItem tabItem = tabFolder.getSelection();
    tabItem.activate();
    return tabItem;
}
Also used : CTabFolder(org.eclipse.reddeer.swt.api.CTabFolder) DefaultCTabFolder(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabFolder) DefaultCTabFolder(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabFolder) CTabItem(org.eclipse.reddeer.swt.api.CTabItem)

Example 4 with CTabItem

use of org.eclipse.reddeer.swt.api.CTabItem in project linuxtools by eclipse.

the class ContainerLogTest method cleanDockerTerminal.

private void cleanDockerTerminal() {
    if (!mockitoIsUsed()) {
        DockerTerminal dockerTerminal = new DockerTerminal();
        dockerTerminal.activate();
        CTabItem tabItem = dockerTerminal.getPage(CONTAINER_NAME);
        tabItem.close();
        dockerTerminal.close();
    }
}
Also used : DockerTerminal(org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal) CTabItem(org.eclipse.reddeer.swt.api.CTabItem)

Aggregations

CTabItem (org.eclipse.reddeer.swt.api.CTabItem)4 CTabFolder (org.eclipse.reddeer.swt.api.CTabFolder)3 DefaultCTabFolder (org.eclipse.reddeer.swt.impl.ctab.DefaultCTabFolder)3 File (java.io.File)1 IOException (java.io.IOException)1 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)1 DockerTerminal (org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal)1 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)1 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)1 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)1 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)1 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)1 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)1 DefaultStyledText (org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText)1 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)1 DefaultToolItem (org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem)1 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)1 Test (org.junit.Test)1