Search in sources :

Example 86 with WaitWhile

use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.

the class OpenShiftResource method delete.

/**
 * Deletes resource via properties view.
 */
public void delete() {
    select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.DELETE_RESOURCE).select();
    new DefaultShell(OpenShiftLabel.Shell.DELETE_RESOURCE);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.DELETE_RESOURCE), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 87 with WaitWhile

use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.

the class SecureStorage method triggerSecureStorageOfPasswordInConnectionDialog.

/**
 * Triggers secure storage of password.
 *
 * @param username
 *            user name
 * @param server
 *            server
 * @param storePassword
 *            store password if value is set to true, remove password if value
 *            is set to false
 * @param serverType
 *            type of a server
 */
private static void triggerSecureStorageOfPasswordInConnectionDialog(String username, String server, boolean storePassword) {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    AbstractOpenShiftConnection connection = explorer.getOpenShiftConnection(username, server);
    connection.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT_CONNECTION).select();
    new DefaultShell(OpenShiftLabel.Shell.EDIT_CONNECTION);
    // Store password if it is not stored
    if (!(new CheckBox(1).isChecked()) && storePassword) {
        new CheckBox(1).click();
        new FinishButton().click();
        TestUtils.acceptSSLCertificate();
        handleSecureStoragePasswordAndHint(SystemProperties.SECURE_STORAGE_PASSWORD);
    // Remove password if it is stored
    } else if (new CheckBox(1).isChecked() && !storePassword) {
        new CheckBox(1).click();
        new FinishButton().click();
    }
    new WaitWhile(new JobIsRunning());
}
Also used : FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) AbstractOpenShiftConnection(org.jboss.tools.openshift.reddeer.view.resources.AbstractOpenShiftConnection) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)

Example 88 with WaitWhile

use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.

the class AbstractOpenShiftExplorerItem method expand.

public void expand() {
    activateOpenShiftExplorerView();
    item.expand();
    // There can be some processing, wait for it
    new WaitWhile(new JobIsRunning(new Matcher[] { new IsEqual<String>("Loading OpenShift resources...") }), TimePeriod.DEFAULT);
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) Matcher(org.hamcrest.Matcher) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) IsEqual(org.hamcrest.core.IsEqual)

Example 89 with WaitWhile

use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.

the class AbstractOpenShiftExplorerItem method refresh.

public void refresh() {
    select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.REFRESH).select();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 90 with WaitWhile

use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.

the class TestUtils method acceptSSLCertificate.

public static void acceptSSLCertificate() {
    try {
        new DefaultShell(OpenShiftLabel.Shell.UNTRUSTED_SSL_CERTIFICATE);
        new YesButton().click();
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.UNTRUSTED_SSL_CERTIFICATE));
    } catch (RedDeerException ex) {
    // no dialog was presented
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Aggregations

WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)209 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)142 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)97 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)84 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)72 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)49 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)45 Test (org.junit.Test)42 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)36 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)36 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)31 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)24 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)22 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)19 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)19 Shell (org.eclipse.reddeer.swt.api.Shell)17 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)17 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)16 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)16