Search in sources :

Example 91 with ShellIsAvailable

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

the class TemplatesCreator method executeImport.

private void executeImport(boolean importProject) {
    new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
    if (!importProject) {
        new CancelButton().click();
    } else {
        new FinishButton().click();
        try {
            new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.CHEATSHEET), TimePeriod.LONG);
            new DefaultShell(OpenShiftLabel.Shell.CHEATSHEET);
            new CheckBox(0).click();
            new NoButton().click();
            new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CHEATSHEET));
        } catch (WaitTimeoutExpiredException ex) {
        // do nothing if cheat sheet is not provided
        }
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
        new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) NoButton(org.eclipse.reddeer.swt.impl.button.NoButton) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 92 with ShellIsAvailable

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

the class TemplatesCreator method createOpenShiftLabels.

private void createOpenShiftLabels(List<Label> labels) {
    for (Label label : labels) {
        new PushButton(OpenShiftLabel.Button.ADD).click();
        new DefaultShell(OpenShiftLabel.Shell.RESOURCE_LABEL);
        new LabeledText(OpenShiftLabel.TextLabels.LABEL).setText(label.getName());
        new LabeledText(OpenShiftLabel.TextLabels.VALUE).setText(label.getValue());
        new WaitUntil(new ControlIsEnabled(new OkButton()));
        new OkButton().click();
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESOURCE_LABEL));
        new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    }
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) OpenShiftLabel(org.jboss.tools.openshift.reddeer.utils.OpenShiftLabel) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 93 with ShellIsAvailable

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

the class NewOpenShift3ApplicationWizard method openWizardFromExplorer.

/**
 * Opens a new OpenShift 3 application wizard from OpenShift Explorer view with the given project pre-selected.
 * If the project is null, a generated project is used.
 */
public void openWizardFromExplorer(String project) {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.reopen();
    selectExplorerProject(project, explorer);
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_OS3_APPLICATION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)

Example 94 with ShellIsAvailable

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

the class EnvironmentVariableWizardPage method resetEnvironmentVariable.

/**
 * Resets environment variable to its default state.
 *
 * @param changedVar
 * @param originalVar
 * @return true if variable was reset successfully, false otherwise
 */
public boolean resetEnvironmentVariable(EnvVar changedVar, EnvVar defaultVar) {
    DefaultTable table = new DefaultTable();
    table.getItem(changedVar.getName()).select();
    new PushButton(OpenShiftLabel.Button.RESET).click();
    new DefaultShell(OpenShiftLabel.Shell.RESET_ENV_VAR);
    new YesButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESET_ENV_VAR));
    return table.containsItem(defaultVar.getName(), 0) && table.containsItem(defaultVar.getValue(), 1);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Example 95 with ShellIsAvailable

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

the class EnvironmentVariableWizardPage method resetAllVariables.

/**
 * Resets all edited environment variables and check whether default variables passed as argument are
 * displayed in the table.
 *
 * @param envVars environment variables to verify that were changed to default state
 * @return true if variables were reset successfully, false otherwise
 */
public boolean resetAllVariables(EnvVar... envVars) {
    DefaultTable table = new DefaultTable();
    new PushButton(OpenShiftLabel.Button.RESET_ALL).click();
    new DefaultShell(OpenShiftLabel.Shell.RESET_ENV_VAR);
    new YesButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESET_ENV_VAR));
    // If any of environment variables passed as argument were not reset, return false
    if (envVars != null && envVars.length > 0) {
        for (EnvVar envVar : envVars) {
            if (!(table.containsItem(envVar.getName(), 0) && (table.containsItem(envVar.getValue(), 1)))) {
                return false;
            }
        }
    }
    return true;
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

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