Search in sources :

Example 6 with Button

use of org.eclipse.reddeer.swt.api.Button in project jbosstools-openshift by jbosstools.

the class NewServerContainerWizardPage method setCredentials.

public void setCredentials(String username, String password) {
    log.info("Setting Red Hat Access credentials");
    getAddButton().click();
    CredentialsWizardPage credentialsPage = new CredentialsWizardPage();
    credentialsPage.setUsername(username);
    credentialsPage.setPassword(password);
    Button ok = new OkButton();
    if (ok.isEnabled()) {
        ok.click();
    } else {
        String text = credentialsPage.getDescriptionText().getText();
        if (text.length() > 0) {
            log.info("Adding new credential failed to add new user " + username);
            log.info("There is an error while setting Red Hat Credentials: \r\n" + text);
        }
        if (text.contains("already exists for domain access.redhat.com")) {
            credentialsPage.cancelAddingUser();
            return;
        }
        throw new CoreLayerException("Setting the credentials was not successful, " + "OK button is not enabled, error: \n\r" + text);
    }
// here might be placed code for disposal of secure storage
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) Button(org.eclipse.reddeer.swt.api.Button) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 7 with Button

use of org.eclipse.reddeer.swt.api.Button in project jbosstools-openshift by jbosstools.

the class CDKLaunchConfigurationDialog method ok.

public void ok() {
    logger.info("Pressing OK button...");
    Button ok = new PushButton(this, "OK");
    ok.click();
}
Also used : PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) Button(org.eclipse.reddeer.swt.api.Button) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 8 with Button

use of org.eclipse.reddeer.swt.api.Button in project jbosstools-openshift by jbosstools.

the class CDKLaunchConfigurationDialog method cancel.

public void cancel() {
    logger.info("Pressing cancel button...");
    Button cancel = new PushButton(this, "Cancel");
    cancel.click();
}
Also used : PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) Button(org.eclipse.reddeer.swt.api.Button) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 9 with Button

use of org.eclipse.reddeer.swt.api.Button 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)

Aggregations

Button (org.eclipse.reddeer.swt.api.Button)9 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)8 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)4 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)3 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)3 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)2 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)2 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)2 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)2 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)2 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)1 WidgetIsFound (org.eclipse.reddeer.core.condition.WidgetIsFound)1 WithMnemonicTextMatcher (org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher)1 Shell (org.eclipse.reddeer.swt.api.Shell)1 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)1 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)1 DefaultToolItem (org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem)1 OpenShiftToolsException (org.jboss.tools.openshift.reddeer.exception.OpenShiftToolsException)1