Search in sources :

Example 41 with PushButton

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

the class RunDockerImageLaunchConfiguration method deleteRunConfiguration.

public void deleteRunConfiguration(String configuratioName) {
    selectConfiguration(configuratioName);
    new DefaultToolItem(DELETE_LAUNCH_CONFIGURATION_LABEL).click();
    Shell deleteShell = new DefaultShell("Confirm Launch Configuration Deletion");
    WidgetIsFound deleteButton = new WidgetIsFound(org.eclipse.swt.widgets.Button.class, deleteShell.getSWTWidget(), new WithMnemonicTextMatcher("Delete"));
    Button button;
    if (deleteButton.test()) {
        // photon changed button text
        button = new PushButton(deleteShell, "Delete");
    } else {
        button = new YesButton(deleteShell);
    }
    button.click();
    new WaitWhile(new ShellIsAvailable(deleteShell));
    new WaitUntil(new ShellIsAvailable("Run Configurations"));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) WithMnemonicTextMatcher(org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WidgetIsFound(org.eclipse.reddeer.core.condition.WidgetIsFound) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton) RadioButton(org.eclipse.reddeer.swt.impl.button.RadioButton) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) Button(org.eclipse.reddeer.swt.api.Button) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 42 with PushButton

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

the class RunDockerImageLaunchConfiguration method editValueInTable.

private void editValueInTable(String tabName, String shellName, String oldValueName, String newValueName, String newValue) {
    selectTab(tabName);
    if (selectItemInTable(oldValueName)) {
        new PushButton("Edit...");
        new WaitWhile(new ShellIsAvailable(shellName));
        new LabeledText("Name:").setText(newValueName);
        new LabeledText("Value:").setText(newValue);
        new OkButton().click();
    } else {
        throw new EclipseLayerException("There is no " + oldValueName + " in table on tab " + tabName);
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) EclipseLayerException(org.eclipse.reddeer.eclipse.exception.EclipseLayerException) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 43 with PushButton

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

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

the class DockerConnection method openImageSearchDialog.

public void openImageSearchDialog(String imageName, String imageTag, String dockerRegister) {
    refreshImages();
    treeViewerHandler.getTreeItem(item, "Images").select();
    new ContextMenu().getItem("Pull...").select();
    new WaitUntil(new ShellIsAvailable("Pull Image"), TimePeriod.DEFAULT);
    // 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 PushButton("Search...").click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu) Combo(org.eclipse.reddeer.swt.api.Combo) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 45 with PushButton

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

the class AbstractImageBotTest method setUpRegister.

protected void setUpRegister(String serverAddress, String email, String userName, String password) {
    WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
    RegistryAccountsPreferencePage page = new RegistryAccountsPreferencePage(dialog);
    dialog.open();
    dialog.select(page);
    page.removeRegistry(serverAddress);
    page.addRegistry(serverAddress, email, userName, password);
    try {
        new DefaultShell("New Registry Account").setFocus();
    } catch (CoreLayerException e) {
        new DefaultShell("Preferences").setFocus();
    }
    new PushButton("Apply and Close").click();
}
Also used : DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) RegistryAccountsPreferencePage(org.eclipse.linuxtools.docker.reddeer.preferences.RegistryAccountsPreferencePage)

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