use of org.eclipse.reddeer.swt.condition.ControlIsEnabled 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.ControlIsEnabled 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);
}
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class TemplatesCreator method createOpenShiftLabels.
private void createOpenShiftLabels(List<Label> labels) {
for (Label label : labels) {
new PushButton(OpenShiftLabel.Button.ADD).click();
new DefaultShell(OpenShiftLabel.Shell.RESOURCE_LABEL);
new LabeledText(OpenShiftLabel.TextLabels.LABEL).setText(label.getName());
new LabeledText(OpenShiftLabel.TextLabels.VALUE).setText(label.getValue());
new WaitUntil(new ControlIsEnabled(new OkButton()));
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESOURCE_LABEL));
new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
}
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class DeleteResourcesWizard method deleteResourceByName.
public void deleteResourceByName(String resourceName) {
getResourceByName(resourceName).get(0).select();
new WaitUntil(new ControlIsEnabled(new PushButton(OpenShiftLabel.Button.DELETE)));
delete();
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method addNewCDK3Server.
/**
* Creates new CDK 3.x server adapter via ServersView -> New -> Server
*
* @param serverAdapter server adapter name
* @param hypervisor hypervisor to use
* @param path path to minishift binary file
*/
public static void addNewCDK3Server(String serverAdapter, String hypervisor, String path) {
NewCDKServerWizard dialog = setupFirstNewServerWizardPage(CDK3_SERVER_NAME, serverAdapter);
// set second new server dialog page
NewCDK3ServerWizardPage containerPage = new NewCDK3ServerWizardPage();
containerPage.setCredentials(USERNAME, PASSWORD);
if (hypervisor != null && !hypervisor.isEmpty()) {
// $NON-NLS-1$
log.info("Setting hypervisor to " + hypervisor);
containerPage.setHypervisor(hypervisor);
}
// $NON-NLS-1$
log.info("Setting minishift binary file folder to " + path);
containerPage.setMinishiftBinary(path);
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.DEFAULT);
// $NON-NLS-1$
log.info("Finishing Add new server dialog");
if (!(new FinishButton().isEnabled())) {
// $NON-NLS-1$
log.error("Finish button was not enabled");
}
dialog.finish();
}
Aggregations