Search in sources :

Example 16 with WorkbenchPreferenceDialog

use of org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog 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 17 with WorkbenchPreferenceDialog

use of org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog in project jbosstools-openshift by jbosstools.

the class CDKServerAdapterAbstractTest method deleteCertificates.

/**
 * Deletes all Openshift 3 SSL certificates that were accepted from
 * Preferences -> JBossTools -> OpenShift 3 -> SSL Certificates
 */
public static void deleteCertificates() {
    WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
    dialog.open();
    OpenShift3SSLCertificatePreferencePage preferencePage = new OpenShift3SSLCertificatePreferencePage(dialog);
    dialog.select(preferencePage);
    preferencePage.deleteAll();
    preferencePage.apply();
    dialog.ok();
}
Also used : WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) OpenShift3SSLCertificatePreferencePage(org.jboss.tools.cdk.reddeer.preferences.OpenShift3SSLCertificatePreferencePage)

Example 18 with WorkbenchPreferenceDialog

use of org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog in project jbosstools-openshift by jbosstools.

the class GetOpenShiftIOTokenTest method checkPluginInSecureStorage.

private void checkPluginInSecureStorage() {
    WorkbenchPreferenceDialog preferences = new WorkbenchPreferenceDialog();
    preferences.open();
    StoragePreferencePage storagePreferencePage = new StoragePreferencePage(preferences);
    preferences.select(storagePreferencePage);
    storagePreferencePage.selectContentTab();
    DefaultTreeItem account = new DefaultTreeItem(new DefaultTree(storagePreferencePage, 1), "[Default Secure Storage]", "org.jboss.tools.openshift.io.core", "accounts", "OpenShift.io", DatastoreOS3.OPENSHIFT_IO_USERNAME);
    account.select();
    assertNotNull("Account does not exists in secure storage", account);
    preferences.ok();
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) StoragePreferencePage(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage)

Example 19 with WorkbenchPreferenceDialog

use of org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog in project jbosstools-openshift by jbosstools.

the class GetOpenShiftIOTokenTest method checkAccountInProperties.

private void checkAccountInProperties() {
    WorkbenchPreferenceDialog preferences = new WorkbenchPreferenceDialog();
    preferences.open();
    OpenShifIOPreferencePage page = new OpenShifIOPreferencePage(preferences);
    preferences.select(page);
    assertTrue("Account is not configured!", page.existsOpenShiftIOAccount());
    preferences.ok();
}
Also used : WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) OpenShifIOPreferencePage(org.jboss.tools.openshift.reddeer.preference.page.OpenShifIOPreferencePage)

Example 20 with WorkbenchPreferenceDialog

use of org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog 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();
}
Also used : WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) RadioButton(org.eclipse.reddeer.swt.impl.button.RadioButton) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Aggregations

WorkbenchPreferenceDialog (org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog)20 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)6 StoragePreferencePage (org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage)5 OpenShift3PreferencePage (org.jboss.tools.openshift.reddeer.preference.page.OpenShift3PreferencePage)4 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)3 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)3 PasswordProvider (org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider)3 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)3 RegistryAccountsPreferencePage (org.eclipse.linuxtools.docker.reddeer.preferences.RegistryAccountsPreferencePage)2 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)2 WidgetIsFound (org.eclipse.reddeer.core.condition.WidgetIsFound)2 WithMnemonicTextMatcher (org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher)2 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)2 DefaultTree (org.eclipse.reddeer.swt.impl.tree.DefaultTree)2 OpenShift3SSLCertificatePreferencePage (org.jboss.tools.cdk.reddeer.preferences.OpenShift3SSLCertificatePreferencePage)2 OpenShifIOPreferencePage (org.jboss.tools.openshift.reddeer.preference.page.OpenShifIOPreferencePage)2 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)1 DockerComposePreferencePage (org.eclipse.linuxtools.docker.reddeer.preferences.DockerComposePreferencePage)1 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)1 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)1