use of org.eclipse.reddeer.swt.condition.ShellIsAvailable 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");
}
}
use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.
the class OpenShift3ConnectionWizard method confirmMessageDialog.
private void confirmMessageDialog() {
ShellIsAvailable confirm = new ShellIsAvailable(OpenShiftLabel.Shell.OVERWRITE_REGISTRY_URL);
new WaitUntil(confirm, TimePeriod.MEDIUM);
DefaultShell dialog = new DefaultShell(OpenShiftLabel.Shell.OVERWRITE_REGISTRY_URL);
dialog.setFocus();
new OkButton().click();
new WaitWhile(confirm, TimePeriod.MEDIUM);
}
use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.
the class OpenShift3ConnectionWizard method finish.
/**
* Waits and clicks Finish button .
*/
public void finish() {
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.LONG);
new FinishButton().click();
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
// check for Wizard closing dialog
try {
new WaitUntil(new ShellIsAvailable("Wizard closing"), TimePeriod.MEDIUM);
new OkButton().click();
new WaitWhile(new ShellIsAvailable("Wizard closing"), TimePeriod.MEDIUM, false);
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
new FinishButton().click();
} catch (WaitTimeoutExpiredException exc) {
// dialog not shown, continue
}
waitForShellToClose(getShell());
}
use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.
the class TemplatesCreator method createOpenShiftApplicationBasedOnTemplate.
private void createOpenShiftApplicationBasedOnTemplate(boolean importProject, boolean serverTemplate, String templateName, final String templateLocalPath, List<Label> labels, TemplateParameter... parameters) {
if (serverTemplate) {
selectServerTemplate(templateName);
} else {
selectLocalTemplate(templateLocalPath);
}
new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT);
new NextButton().click();
new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
if (parameters != null && parameters.length != 0) {
setTemplateParameters(parameters);
}
new NextButton().click();
new WaitWhile(new ControlIsEnabled(new NextButton()), TimePeriod.LONG);
if (labels != null && labels.size() != 0) {
createOpenShiftLabels(labels);
}
new FinishButton().click();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
new OkButton().click();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
executeImport(importProject);
}
use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.
the class TemplatesCreator method setTemplateParameters.
private void setTemplateParameters(TemplateParameter[] parameters) {
for (TemplateParameter parameter : parameters) {
new DefaultTable().select(parameter.getName());
new WaitUntil(new ControlIsEnabled(new PushButton(OpenShiftLabel.Button.EDIT)));
new PushButton(OpenShiftLabel.Button.EDIT).click();
new DefaultShell(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER);
new DefaultText().setText(parameter.getValue());
new WaitUntil(new ControlIsEnabled(new OkButton()));
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER));
new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
}
}
Aggregations