use of org.eclipse.reddeer.swt.impl.button.OkButton in project linuxtools by eclipse.
the class RegistryAccountsPreferencePage method addRegistry.
public void addRegistry(String serverAddress, String email, String userName, String password) {
new PushButton("Add").click();
new LabeledText(SERVER_ADDRESS).setText(serverAddress);
new LabeledText(USERNAME).setText(userName);
new LabeledText(EMAIL).setText(email);
new LabeledText(PASSWORD).setText(password);
new OkButton().click();
}
use of org.eclipse.reddeer.swt.impl.button.OkButton in project jbosstools-openshift by jbosstools.
the class HandleCustomTemplateTest method createTemplateFromJson.
private void createTemplateFromJson() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.open();
explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject().select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_RESOURCE).select();
new DefaultShell(OpenShiftLabel.Shell.NEW_RESOURCE);
new LabeledText(OpenShiftLabel.TextLabels.RESOURCE_LOCATION).setText(System.getProperty("user.dir") + File.separator + "resources" + File.separator + "hello-world-template.json");
new FinishButton().click();
new DefaultShell(OpenShiftLabel.Shell.CREATE_RESOURCE_SUMMARY);
assertTrue("Template is not listed in created resources summary", new DefaultTree().getAllItems().size() == 1);
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_RESOURCE));
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
List<OpenShiftResource> templates = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject().getOpenShiftResources(Resource.TEMPLATE);
assertTrue("There should be precisely 1 created template for the project.", templates.size() > 0);
String templateName = templates.get(0).getName();
assertTrue("Template name '" + templateName + "' does not match required name " + "helloworld-sample.", templateName.equals("helloworld-sample"));
}
use of org.eclipse.reddeer.swt.impl.button.OkButton in project jbosstools-openshift by jbosstools.
the class EditResourceLimitsTest method incrementLimits.
private void incrementLimits(int index, String defaultSuffix) {
new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT_RESOURCE_LIMITS).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.EDIT_RESOURCE_LIMITS));
new DefaultShell(OpenShiftLabel.Shell.EDIT_RESOURCE_LIMITS).setFocus();
Text text = new DefaultText(index);
String value = text.getText();
long val = 0L;
try {
val = Long.parseLong(value);
} catch (NumberFormatException e) {
}
text.setText(Long.toString(++val));
Combo combo = new DefaultCombo(index);
value = combo.getSelection();
if (StringUtils.isEmpty(value)) {
combo.setSelection(defaultSuffix);
}
new WaitUntil(new ControlIsEnabled(new OkButton()));
new OkButton().click();
}
use of org.eclipse.reddeer.swt.impl.button.OkButton in project jbosstools-openshift by jbosstools.
the class OSExplorerResourceTest method testDeploymentConfigVisibleAfterServiceDeletion.
/**
* Test if deployment config is visible in OS Explorer, when there is no service.
*/
@Test(expected = OpenshiftTestInFailureException.class)
public void testDeploymentConfigVisibleAfterServiceDeletion() {
this.project.expand();
Service service = this.project.getService(OpenShiftResources.EAP_SERVICE);
assertTrue("Service does not exist!", service != null);
service.select();
new ContextMenuItem("Delete").select();
new DefaultShell("Delete OpenShift Resource");
new OkButton().click();
// assert service is deleted
List<OpenShiftResource> resources = this.project.getOpenShiftResources(Resource.SERVICE);
assertTrue("Service not deleted!", resources.isEmpty());
try {
this.project.getTreeItem().getItem("eap-app selector: deploymentConfig=eap-app");
} catch (CoreLayerException e) {
// TODO: do not throw after JBIDE-24217 is fixed
throw new OpenshiftTestInFailureException("JBIDE-24217");
// TODO: uncomment after JBIDE-24217 is fixed
// fail("Deployment config not visible!");
}
}
use of org.eclipse.reddeer.swt.impl.button.OkButton in project jbosstools-openshift by jbosstools.
the class EditResourcesTest method testIncorrectResourceContent.
@Test
public void testIncorrectResourceContent() {
TextEditor editor = getBuildConfigTextEditor();
String text = editor.getText();
if (buildConfig == null) {
buildConfig = text;
}
editor.setText(text.replace("\"namespace\" : \"" + DatastoreOS3.PROJECT1 + "\"", "\"namespace\" : \"" + DatastoreOS3.PROJECT1 + "\"wtf"));
try {
editor.save();
} catch (CoreLayerException ex) {
// ok
}
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
assertTrue("Editor should be dirty, it should not be able to save incorrect content", editor.isDirty());
try {
new DefaultShell("Problem Occurred");
new OkButton().click();
} catch (RedDeerException ex) {
// sometimes it occures, sometimes not
}
}
Aggregations