Search in sources :

Example 56 with PushButton

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();
    }
}
Also used : DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) Table(org.eclipse.reddeer.swt.api.Table) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 57 with PushButton

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();
}
Also used : OpenShift3PreferencePage(org.jboss.tools.openshift.reddeer.preference.page.OpenShift3PreferencePage) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 58 with PushButton

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();
    }
}
Also used : DefaultCLabel(org.eclipse.reddeer.swt.impl.clabel.DefaultCLabel) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) JFaceLayerException(org.eclipse.reddeer.jface.exception.JFaceLayerException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) DefaultCLabel(org.eclipse.reddeer.swt.impl.clabel.DefaultCLabel) WithMnemonicTextMatcher(org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher) WidgetIsFound(org.eclipse.reddeer.core.condition.WidgetIsFound) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 59 with PushButton

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);
}
Also used : DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ProjectExists(org.eclipse.reddeer.eclipse.condition.ProjectExists) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ExternalProjectImportWizardDialog(org.eclipse.reddeer.eclipse.ui.wizards.datatransfer.ExternalProjectImportWizardDialog) BeforeClass(org.junit.BeforeClass)

Example 60 with PushButton

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);
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) CDKServerException(org.jboss.tools.cdk.reddeer.server.exception.CDKServerException) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Aggregations

PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)94 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)49 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)43 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)41 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)38 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)38 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)34 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)28 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)20 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)17 Test (org.junit.Test)16 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)15 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)9 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)8 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)7 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)6 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)6 Button (org.eclipse.reddeer.swt.api.Button)6 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)6 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6