use of org.eclipse.reddeer.swt.impl.button.PushButton in project linuxtools by eclipse.
the class RegistryAccountsPreferencePage method removeAllRegistries.
public void removeAllRegistries() {
Table table = new DefaultTable();
for (int i = 0; i < table.rowCount(); i++) {
table.select(0);
new PushButton("Remove").click();
}
}
use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-openshift by jbosstools.
the class CDKTestUtils method setOCToPreferences.
public static void setOCToPreferences(String ocPath) {
WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
OpenShift3PreferencePage page = new OpenShift3PreferencePage(dialog);
dialog.open();
dialog.select(page);
page.setOCLocation(ocPath);
try {
new WaitUntil(new ControlIsEnabled(new PushButton("Apply")), TimePeriod.DEFAULT);
} catch (WaitTimeoutExpiredException exc) {
fail("WaitTimeoutExpiredException occured while processing oc binary on path " + ocPath);
}
page.apply();
dialog.cancel();
}
use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-openshift by jbosstools.
the class CDKTestUtils method removeAccessRedHatCredentials.
// removes access redhat com credentials used for first cdk run
public static void removeAccessRedHatCredentials(String domain, String username) {
WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
dialog.open();
// $NON-NLS-1$ //$NON-NLS-2$
dialog.select("JBoss Tools", "Credentials");
try {
new WaitUntil(new WidgetIsFound(org.eclipse.swt.custom.CLabel.class, new WithMnemonicTextMatcher("Credentials")), // $NON-NLS-1$
TimePeriod.MEDIUM);
// $NON-NLS-1$
new DefaultCLabel("Credentials");
DefaultTree tree = new DefaultTree(1);
TreeItem item = TreeViewerHandler.getInstance().getTreeItem(tree, new String[] { domain, username });
item.select();
// $NON-NLS-1$
new PushButton(new WithTextMatcher("Remove User")).click();
new WaitUntil(new JobIsRunning(), TimePeriod.MEDIUM, false);
} catch (WaitTimeoutExpiredException exc) {
// $NON-NLS-1$
log.error("JBoss Tools - Credentials preferences page has timed out");
exc.printStackTrace();
} catch (JFaceLayerException exc) {
// $NON-NLS-1$
log.error("JBoss Tools - Credentials does not contain required username to be deleted");
exc.printStackTrace();
} finally {
dialog.ok();
}
}
use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-openshift by jbosstools.
the class CreateApplicationFromTemplateTest method importTestsProject.
@BeforeClass
public static void importTestsProject() {
new ExternalProjectImportWizardDialog().open();
new DefaultCombo().setText(TESTS_PROJECT_LOCATION);
new PushButton("Refresh").click();
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.LONG);
new FinishButton().click();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitUntil(new ProjectExists(TESTS_PROJECT), TimePeriod.LONG);
}
use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-openshift by jbosstools.
the class CDKServer method confirmSSLCertificateDialog.
/**
* Methods waits for SSL Certificate dialog shell to appear and then confirms dialog,
* it might happen that certificate is already in place and no dialog is shown,
* then WaitTimeoutExpiredException is logged but not raised
*/
private void confirmSSLCertificateDialog(Shell shell) {
try {
DefaultShell certificateDialog = new DefaultShell(shell);
certificateDialog.setFocus();
log.info("SSL Certificate Dialog appeared during " + getLabel().getState().toString());
new PushButton(certificateDialog, "Yes").click();
new WaitWhile(new ShellIsAvailable(certificateDialog));
setCertificateAccepted(true);
} catch (WaitTimeoutExpiredException ex) {
String message = "WaitTimeoutExpiredException occured when handling Certificate dialog. " + "Dialog has not been shown";
log.error(message);
throw new CDKServerException(message, ex);
}
}
Aggregations