Search in sources :

Example 1 with PushButton

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

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

use of org.eclipse.reddeer.swt.impl.button.PushButton 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)

Example 4 with PushButton

use of org.eclipse.reddeer.swt.impl.button.PushButton in project linuxtools by eclipse.

the class SearchDialogTest method testSearchDialog.

@Test
public void testSearchDialog() {
    DockerExplorerView explorer = new DockerExplorerView();
    getConnection().openImageSearchDialog(IMAGE_NAME, null, REGISTRY_URL);
    ImageSearchPage pageOne = new ImageSearchPage(explorer);
    pageOne.searchImage();
    assertFalse("Search result is empty!", pageOne.getSearchResults().isEmpty());
    assertTrue("Search result do not contains image:" + EXPECTED_IMAGE_NAME + "!", pageOne.searchResultsContains(EXPECTED_IMAGE_NAME));
    pageOne.next();
    // new WaitUntil(new ShellIsAvailable("Progress Information"), TimePeriod.DEFAULT);
    AbstractWait.sleep(TimePeriod.getCustom(5));
    ImageTagSelectionPage pageTwo = new ImageTagSelectionPage(pageOne);
    assertFalse("Search tags are empty!", pageTwo.getTags().isEmpty());
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    if (!pageTwo.tagsContains(IMAGE_TAG)) {
        pageTwo.cancel();
        new CancelButton().click();
        fail("Search results do not contain tag: " + IMAGE_TAG + "!");
    }
    pageTwo.selectTag(IMAGE_TAG);
    pageTwo.finish();
    new PushButton("Finish").click();
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Also used : DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) ImageSearchPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageSearchPage) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ImageTagSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageTagSelectionPage) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) Test(org.junit.Test) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)

Example 5 with PushButton

use of org.eclipse.reddeer.swt.impl.button.PushButton 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)

Aggregations

PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)94 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)49 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)43 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)41 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)38 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)38 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)34 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)28 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)20 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)17 Test (org.junit.Test)16 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)15 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)9 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)8 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)7 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)6 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)6 Button (org.eclipse.reddeer.swt.api.Button)6 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)6 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6