Search in sources :

Example 86 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.

the class OpenShift3ConnectionWizard method discover.

/**
 * Overwriting of URL requires user confirmation, Message Dialog is shown. If
 * url is not filled in, no dialog pops up and url is generated automatically.
 * If it is not possible to get proper registry url (ie. adapter is stopped),
 * then Error dialog is thrown.
 */
public void discover() {
    Button discover = getDiscoveryButton();
    discover.click();
    try {
        new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.REGISTRY_URL_NOT_FOUND), TimePeriod.DEFAULT);
        // Error dialog appeared, exception will be thrown
        log.error("Unable to discover a registry URL");
        throw new OpenShiftToolsException(OpenShiftLabel.Shell.REGISTRY_URL_NOT_FOUND);
    } catch (WaitTimeoutExpiredException exc) {
    // Error dialog was not thrown
    }
    try {
        confirmMessageDialog();
    } catch (WaitTimeoutExpiredException exc) {
        // Confirmation dialog did not appear, only spotted reason so far is that
        // it would be replacing the same URL.
        log.info("Discover action did not invoke any dialog");
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) Button(org.eclipse.reddeer.swt.api.Button) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftToolsException(org.jboss.tools.openshift.reddeer.exception.OpenShiftToolsException)

Example 87 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.

the class OpenShift3ConnectionWizard method confirmMessageDialog.

private void confirmMessageDialog() {
    ShellIsAvailable confirm = new ShellIsAvailable(OpenShiftLabel.Shell.OVERWRITE_REGISTRY_URL);
    new WaitUntil(confirm, TimePeriod.MEDIUM);
    DefaultShell dialog = new DefaultShell(OpenShiftLabel.Shell.OVERWRITE_REGISTRY_URL);
    dialog.setFocus();
    new OkButton().click();
    new WaitWhile(confirm, TimePeriod.MEDIUM);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 88 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.

the class OpenShift3ConnectionWizard method finish.

/**
 * Waits and clicks Finish button .
 */
public void finish() {
    new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.LONG);
    new FinishButton().click();
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
    // check for Wizard closing dialog
    try {
        new WaitUntil(new ShellIsAvailable("Wizard closing"), TimePeriod.MEDIUM);
        new OkButton().click();
        new WaitWhile(new ShellIsAvailable("Wizard closing"), TimePeriod.MEDIUM, false);
        new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
        new FinishButton().click();
    } catch (WaitTimeoutExpiredException exc) {
    // dialog not shown, continue
    }
    waitForShellToClose(getShell());
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 89 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.

the class TemplatesCreator method createOpenShiftApplicationBasedOnTemplate.

private void createOpenShiftApplicationBasedOnTemplate(boolean importProject, boolean serverTemplate, String templateName, final String templateLocalPath, List<Label> labels, TemplateParameter... parameters) {
    if (serverTemplate) {
        selectServerTemplate(templateName);
    } else {
        selectLocalTemplate(templateLocalPath);
    }
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT);
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
    if (parameters != null && parameters.length != 0) {
        setTemplateParameters(parameters);
    }
    new NextButton().click();
    new WaitWhile(new ControlIsEnabled(new NextButton()), TimePeriod.LONG);
    if (labels != null && labels.size() != 0) {
        createOpenShiftLabels(labels);
    }
    new FinishButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
    new OkButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    executeImport(importProject);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 90 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.

the class TemplatesCreator method setTemplateParameters.

private void setTemplateParameters(TemplateParameter[] parameters) {
    for (TemplateParameter parameter : parameters) {
        new DefaultTable().select(parameter.getName());
        new WaitUntil(new ControlIsEnabled(new PushButton(OpenShiftLabel.Button.EDIT)));
        new PushButton(OpenShiftLabel.Button.EDIT).click();
        new DefaultShell(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER);
        new DefaultText().setText(parameter.getValue());
        new WaitUntil(new ControlIsEnabled(new OkButton()));
        new OkButton().click();
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER));
        new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    }
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Aggregations

ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)128 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)97 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)84 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)73 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)52 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)47 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)44 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)33 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)32 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)25 Test (org.junit.Test)21 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)19 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)18 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)18 Shell (org.eclipse.reddeer.swt.api.Shell)17 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)14 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)13 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)13 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)10