Search in sources :

Example 11 with WaitTimeoutExpiredException

use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.

the class NodeJSAppDebugTest method getVariable.

/**
 * getVariable from Variables view.
 *
 * @param variable
 *            name
 * @return TreeItem
 */
protected TreeItem getVariable(String name) {
    WorkbenchView variables = new WorkbenchView("Variables");
    variables.activate();
    DefaultTree variablesTree = new DefaultTree();
    TreeItem var = null;
    try {
        new WaitUntil(new TreeContainsItem(variablesTree, new WithTextMatcher(name), false));
    } catch (WaitTimeoutExpiredException e) {
        // not found
        return null;
    }
    List<TreeItem> vars = variablesTree.getItems();
    for (TreeItem i : vars) {
        if (i.getText().equals(name)) {
            var = i;
        }
    }
    return var;
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) WorkbenchView(org.eclipse.reddeer.workbench.impl.view.WorkbenchView) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 12 with WaitTimeoutExpiredException

use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.

the class DisableSecureStorageRequirement method setSecureStorageMasterPasswords.

private void setSecureStorageMasterPasswords(boolean checked) {
    WorkbenchPreferenceDialog preferenceDialog = new WorkbenchPreferenceDialog();
    StoragePreferencePage storagePage = new StoragePreferencePage(preferenceDialog);
    preferenceDialog.open();
    preferenceDialog.select(storagePage);
    try {
        new WaitUntil(new WidgetIsFound(org.eclipse.swt.custom.CLabel.class, new WithMnemonicTextMatcher("Secure Storage")), TimePeriod.DEFAULT);
        log.info("Getting master password providers");
        List<PasswordProvider> items = storagePage.getMasterPasswordProviders();
        for (PasswordProvider item : items) {
            log.info("Uncheking table item: " + item.getDescription());
            item.setEnabled(checked);
        }
        new WaitUntil(new JobIsRunning(), TimePeriod.DEFAULT, false);
        storagePage.apply();
    } catch (WaitTimeoutExpiredException exc) {
        log.error("Secure Storage preferences page has timed out");
        log.error(exc.getMessage());
    } finally {
        preferenceDialog.ok();
    }
}
Also used : WithMnemonicTextMatcher(org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher) WidgetIsFound(org.eclipse.reddeer.core.condition.WidgetIsFound) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PasswordProvider(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider) StoragePreferencePage(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage)

Example 13 with WaitTimeoutExpiredException

use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.

the class NewCDKServerWizard method cancel.

@Override
public void cancel() {
    try {
        // wait for job to start
        new WaitUntil(new JobIsRunning(), TimePeriod.MEDIUM);
        // job has started - try to kill it
        new WaitUntil(new JobIsKilled("Refreshing server adapter list"), TimePeriod.LONG, false);
    } catch (WaitTimeoutExpiredException exc) {
    // do nothing because job did not start
    }
    super.cancel();
}
Also used : WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsKilled(org.eclipse.reddeer.workbench.core.condition.JobIsKilled) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 14 with WaitTimeoutExpiredException

use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.

the class MinishiftServerEditor method openLaunchConfigurationFromLink.

public void openLaunchConfigurationFromLink() {
    log.info("Activate launch configuration via link");
    getLaunchConfigurationHyperLink().activate();
    ShellIsAvailable launch = new ShellIsAvailable("Edit Configuration");
    try {
        new WaitUntil(launch, TimePeriod.DEFAULT);
    } catch (WaitTimeoutExpiredException exc) {
        log.error("WaitTimeoutExpiredException occured while waiting for Edit Configuration dialog");
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 15 with WaitTimeoutExpiredException

use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.

the class CDKServerEditorAbstractTest method errorDialogAppeared.

private void errorDialogAppeared() {
    try {
        new WaitUntil(new ShellIsAvailable(new DefaultShell(getServerAdapter())), TimePeriod.MEDIUM);
        log.info("Error Message Dialog appeared as expected");
    } catch (WaitTimeoutExpiredException exc) {
        log.error(exc.getMessage());
        fail("Error Message Dialog did not appear while trying to save editor");
    }
    new OkButton().click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)46 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)34 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)23 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)18 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)17 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)15 Test (org.junit.Test)12 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)10 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)10 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)8 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)7 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)7 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)6 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)6 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)6 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)5 OpenShiftResource (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)5 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)4 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)4