Search in sources :

Example 1 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText in project linuxtools by eclipse.

the class AbstractDockerBotTest method setSecureStorage.

public static void setSecureStorage(String password) {
    try {
        new DefaultShell("Secure Storage Password");
        new LabeledText("Password:").setText(password);
        new LabeledText("Confirm password:").setText(password);
        new PushButton("OK").click();
        new DefaultShell("Secure Storage - Password Hint Needed");
        new PushButton("NO").click();
    } catch (CoreLayerException ex) {
    // swallowing intentionally
    } catch (SWTLayerException e) {
        try {
            new DefaultShell("Secure Storage");
            new LabeledText("Password:").setText(password);
            new LabeledText("Confirm password:").setText(password);
            new PushButton("OK").click();
        } catch (SWTLayerException ex) {
        // Secure storage password is set
        } catch (CoreLayerException ex) {
            // Confirm password
            new PushButton("OK").click();
        }
    }
}
Also used : DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) SWTLayerException(org.eclipse.reddeer.swt.exception.SWTLayerException) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 2 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText 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 3 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText in project linuxtools by eclipse.

the class ImageRunResourceVolumesVariablesPage method addDataVolumeNoExternalMount.

public void addDataVolumeNoExternalMount(String containerPath) {
    new PushButton(0, new WithTextMatcher("Add...")).click();
    new LabeledText("Container path:").setText(containerPath);
    new RadioButton("No external mount").click();
    new OkButton().click();
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) RadioButton(org.eclipse.reddeer.swt.impl.button.RadioButton) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 4 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText in project linuxtools by eclipse.

the class ImageRunResourceVolumesVariablesPage method addDataVolumeToHost.

public void addDataVolumeToHost(String containerPath, String path, boolean readOnly) {
    new PushButton(0, new WithTextMatcher("Add...")).click();
    new LabeledText("Container path:").setText(containerPath);
    new RadioButton("Mount a host directory or host file").click();
    new LabeledText("Path:").setText(path);
    new CheckBox("Read-only access").toggle(readOnly);
    ;
    new OkButton().click();
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) RadioButton(org.eclipse.reddeer.swt.impl.button.RadioButton) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 5 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText in project linuxtools by eclipse.

the class ImageRunSelectionPage method addExposedPort.

public void addExposedPort(String containerPort, String hostAddress, String hostPort) {
    new PushButton(0, new WithTextMatcher("Add...")).click();
    new DefaultShell("Exposing a Container Port");
    new LabeledText("Container port:").setText(containerPort);
    new LabeledText("Host address:").setText(hostAddress);
    new LabeledText("Host port:").setText(hostPort);
    new OkButton().click();
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Aggregations

LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)93 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)34 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)32 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)30 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)30 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)30 Test (org.junit.Test)29 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)25 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)23 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)19 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)18 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)14 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)11 LabeledCombo (org.eclipse.reddeer.swt.impl.combo.LabeledCombo)11 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)10 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)9 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)9 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)8 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)8 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)8