Search in sources :

Example 11 with WorkbenchPreferenceDialog

use of org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog in project linuxtools by eclipse.

the class AbstractImageBotTest method setUpRegister.

protected void setUpRegister(String serverAddress, String email, String userName, String password) {
    WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
    RegistryAccountsPreferencePage page = new RegistryAccountsPreferencePage(dialog);
    dialog.open();
    dialog.select(page);
    page.removeRegistry(serverAddress);
    page.addRegistry(serverAddress, email, userName, password);
    try {
        new DefaultShell("New Registry Account").setFocus();
    } catch (CoreLayerException e) {
        new DefaultShell("Preferences").setFocus();
    }
    new PushButton("Apply and Close").click();
}
Also used : DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) RegistryAccountsPreferencePage(org.eclipse.linuxtools.docker.reddeer.preferences.RegistryAccountsPreferencePage)

Example 12 with WorkbenchPreferenceDialog

use of org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog in project linuxtools by eclipse.

the class ComposeTest method testCompose.

@Test
public void testCompose() {
    // Set up Docker Compose location
    PreferenceDialog dialog = new WorkbenchPreferenceDialog();
    DockerComposePreferencePage composePreference = new DockerComposePreferencePage(dialog);
    dialog.open();
    dialog.select(composePreference);
    composePreference.setPathToDockerCompose(this.dockerComposePath);
    composePreference.apply();
    new PushButton("Apply and Close").click();
    // Build Image
    DockerImagesTab imagesTab = openDockerImagesTab();
    buildImage(IMAGE_NAME, PATH_TEST_COMPOSE, imagesTab);
    assertConsoleSuccess();
    // Import resource folder
    importProject(PATH_TEST_COMPOSE);
    // Run Docker Compose
    runDockerCompose(PROJECT_TEST_COMPOSE, FILE_DOCKER_COMPOSE);
    // Check if application is running
    WebBrowserView browserView = new WebBrowserView();
    browserView.open();
    // Skip browser contents check, if mockito is used
    if (!mockitoIsUsed()) {
        browserView.openPageURL(URL);
        BrowserContentsCheck.checkBrowserForErrorPage(browserView, URL);
    }
}
Also used : WebBrowserView(org.eclipse.reddeer.eclipse.ui.browser.WebBrowserView) PreferenceDialog(org.eclipse.reddeer.jface.preference.PreferenceDialog) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) DockerComposePreferencePage(org.eclipse.linuxtools.docker.reddeer.preferences.DockerComposePreferencePage) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest) Test(org.junit.Test)

Example 13 with WorkbenchPreferenceDialog

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

the class OpenShiftCommandLineToolsRequirement method openDialogAndSelectPage.

private void openDialogAndSelectPage() {
    dialog = new WorkbenchPreferenceDialog();
    page = new OpenShift3PreferencePage(dialog);
    dialog.open();
    dialog.select(page);
}
Also used : OpenShift3PreferencePage(org.jboss.tools.openshift.reddeer.preference.page.OpenShift3PreferencePage) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog)

Example 14 with WorkbenchPreferenceDialog

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

the class SecureStorage method verifySecureStorageOfPassword.

/**
 * Verifies whether state of password storage for specified user is in correct
 * state.
 *
 * @param username
 * @param server
 *            URL of OpenShift server without https prefix
 * @param shouldExist
 *            if true, password should be present in secure storage, if false,
 *            there should be no password in secure storage for specified
 *            connection
 * @param serverType
 *            OpenShift v2 or v3 server
 */
public static void verifySecureStorageOfPassword(String username, String server, boolean shouldExist) {
    WorkbenchPreferenceDialog workbenchPreferenceDialog = new WorkbenchPreferenceDialog();
    StoragePreferencePage secureStoragePreferencePage = new StoragePreferencePage(workbenchPreferenceDialog);
    new WorkbenchShell().setFocus();
    workbenchPreferenceDialog.open();
    new WorkbenchPreferenceDialog().select(secureStoragePreferencePage);
    secureStoragePreferencePage.selectContentTab();
    boolean exists = secureStoragePreferencePage.passwordExists("[Default Secure Storage]", getPluginId(), server, username);
    workbenchPreferenceDialog.ok();
    assertTrue(shouldExist ? "Password wasn't present in secure storage while it should." : "Password was present in secure storage but it shouldn't.", shouldExist == exists);
}
Also used : WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) StoragePreferencePage(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage)

Example 15 with WorkbenchPreferenceDialog

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

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