use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-openshift by jbosstools.
the class CreateNewConnectionTest method invalidRegistryURLShouldReportErrorMessage.
@Test
@RunIf(conditionClass = ConnectionCredentialsExists.class)
public void invalidRegistryURLShouldReportErrorMessage() {
openConnectionWizardAndSetDefaultServer();
new LabeledCombo(OpenShiftLabel.TextLabels.PROTOCOL).setSelection(AuthenticationMethod.BASIC.toString());
new LabeledText(OpenShiftLabel.TextLabels.USERNAME).setText(DatastoreOS3.USERNAME);
new LabeledText(OpenShiftLabel.TextLabels.PASSWORD).setText(DatastoreOS3.PASSWORD);
new PushButton(OpenShiftLabel.Button.ADVANCED_OPEN).click();
new LabeledText(OpenShiftLabel.TextLabels.IMAGE_REGISTRY_URL).setText("invalidURL");
new WaitUntil(new ControlIsEnabled(new CancelButton()), TimePeriod.DEFAULT);
new WaitUntil(new ControlIsEnabled(new DefaultText(" Please provide a valid image registry (HTTP/S) URL.")), TimePeriod.DEFAULT);
new CancelButton().click();
}
use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-openshift by jbosstools.
the class OpenShift3SSLCertificatePreferencePage method deleteAll.
public void deleteAll() {
log.info("Deleting all accepted Untrusted SSL Certificates used by Opneshift 3 tooling");
DefaultTable table = new DefaultTable();
List<TableItem> tableItems = table.getItems();
if (tableItems.isEmpty()) {
return;
}
for (TableItem item : tableItems) {
item.select();
new PushButton("Delete").click();
}
}
use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-openshift by jbosstools.
the class ShellWithButton method lookForShellWithButton.
private static org.eclipse.swt.widgets.Shell lookForShellWithButton(final String title, final String buttonLabel) {
Matcher<String> titleMatcher = new WithTextMatcher(title);
Matcher<String> buttonMatcher = new BaseMatcher<String>() {
@Override
public boolean matches(Object obj) {
if (obj instanceof Control) {
final Control control = (Control) obj;
ReferencedComposite ref = new ReferencedComposite() {
@Override
public Control getControl() {
return control;
}
};
try {
new PushButton(ref, buttonLabel);
return true;
} catch (CoreLayerException e) {
// ok, this control doesn't contain the button
}
}
return false;
}
@Override
public void describeTo(Description description) {
description.appendText("containing button '" + buttonLabel + "'");
}
};
@SuppressWarnings("unchecked") Matcher<String> matcher = new AndMatcher(titleMatcher, buttonMatcher);
return ShellLookup.getInstance().getShell(matcher);
}
use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-openshift by jbosstools.
the class OpenShiftExplorerView method connectToOpenShift.
public void connectToOpenShift(String server, String username, String password, boolean storePassword, boolean useDefaultServer, AuthenticationMethod authMethod, boolean certificateShown) {
new DefaultShell(OpenShiftLabel.Shell.NEW_CONNECTION);
if (new CheckBox(0).isChecked() != useDefaultServer) {
new CheckBox(0).click();
}
if (!useDefaultServer) {
new LabeledCombo(OpenShiftLabel.TextLabels.SERVER).setText(server);
}
new LabeledCombo(OpenShiftLabel.TextLabels.PROTOCOL).setSelection(authMethod.toString());
if (AuthenticationMethod.OAUTH.equals(authMethod)) {
new LabeledText(OpenShiftLabel.TextLabels.TOKEN).setText(password);
}
if (AuthenticationMethod.BASIC.equals(authMethod)) {
new LabeledText(OpenShiftLabel.TextLabels.USERNAME).setText(username);
new LabeledText(OpenShiftLabel.TextLabels.PASSWORD).setText(password);
if (new CheckBox(OpenShiftLabel.TextLabels.STORE_PASSWORD).isChecked() != storePassword) {
new CheckBox(OpenShiftLabel.TextLabels.STORE_PASSWORD).click();
}
}
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.DEFAULT);
new FinishButton().click();
if (certificateShown) {
try {
new DefaultShell(OpenShiftLabel.Shell.UNTRUSTED_SSL_CERTIFICATE);
new PushButton("Yes").click();
} catch (RedDeerException ex) {
fail("Aceptance of SSL certificate failed.");
}
}
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_CONNECTION), TimePeriod.LONG);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-openshift by jbosstools.
the class TestUtils method setVisualEditorToUseHTML5.
public static void setVisualEditorToUseHTML5() {
WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
dialog.open();
dialog.select("JBoss Tools", "Web", "Editors", "Visual Page Editor");
RadioButton button = new RadioButton("HTML5 (use WebKit)");
if (button.isEnabled() && !button.isSelected()) {
button.click();
}
CheckBox checkBox = new CheckBox("Do not show Browser Engine dialog");
if (checkBox.isEnabled() && !checkBox.isChecked()) {
checkBox.click();
}
new PushButton("Apply").click();
dialog.ok();
}
Aggregations