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
}
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();
}
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();
}
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");
}
}
Aggregations