Search in sources :

Example 21 with LabeledCombo

use of org.eclipse.reddeer.swt.impl.combo.LabeledCombo in project jbosstools-openshift by jbosstools.

the class DeployDockerImageTest method assertDockerImageIsProcessedCorrectlyWhenUsedFromOpenShiftExplorer.

/**
 * Selects project in OpenShift explorer view, open Deploy Image to OpenShift wizard
 * from its context menu and assert that there are correct values.
 * @param projectName
 * @param projectDisplayName
 */
private void assertDockerImageIsProcessedCorrectlyWhenUsedFromOpenShiftExplorer(String projectName) {
    selectProject(projectName);
    new ContextMenuItem(OpenShiftLabel.ContextMenu.DEPLOY_DOCKER_IMAGE).select();
    new DefaultShell(OpenShiftLabel.Shell.DEPLOY_IMAGE_TO_OPENSHIFT);
    assertFalse("No project has been preselected.", new LabeledCombo("OpenShift Project: ").getSelection().equals(""));
    assertTrue("Wrong project has been preselected.", new LabeledCombo("OpenShift Project: ").getSelection().equals(projectName));
    closeWizard();
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell)

Example 22 with LabeledCombo

use of org.eclipse.reddeer.swt.impl.combo.LabeledCombo in project jbosstools-openshift by jbosstools.

the class ConnectionWizardHandlingTest method testUserAndPassCachingAfterSwitchingAuthProtocol.

@Test
public void testUserAndPassCachingAfterSwitchingAuthProtocol() {
    new LabeledCombo(OpenShiftLabel.TextLabels.SERVER_TYPE).setSelection(OpenShiftLabel.Others.OPENSHIFT3);
    String username = "randomuser";
    switchToBasic();
    new LabeledText(OpenShiftLabel.TextLabels.USERNAME).setText(username);
    new LabeledText(OpenShiftLabel.TextLabels.PASSWORD).setText("openshiftv3");
    switchToOAuth();
    switchToBasic();
    assertTrue("Username text field does not cache user name after switching authentication protocol.", username.equals(new LabeledText(OpenShiftLabel.TextLabels.USERNAME).getText()));
    assertFalse("Password text field does not cache password after switching authentication protocol.", new LabeledText(OpenShiftLabel.TextLabels.PASSWORD).getText().isEmpty());
}
Also used : LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 23 with LabeledCombo

use of org.eclipse.reddeer.swt.impl.combo.LabeledCombo in project jbosstools-openshift by jbosstools.

the class ConnectionWizardHandlingTest method testTokenCachingAfterSwitchingAuthProtocol.

@Test
public void testTokenCachingAfterSwitchingAuthProtocol() {
    new LabeledCombo(OpenShiftLabel.TextLabels.SERVER_TYPE).setSelection(OpenShiftLabel.Others.OPENSHIFT3);
    String token = "r4nd0mT0k3n";
    switchToOAuth();
    new LabeledText(OpenShiftLabel.TextLabels.TOKEN).setText(token);
    switchToBasic();
    switchToOAuth();
    assertTrue("Token text field does not cache token after switching authentication protocol.", token.equals(new LabeledText(OpenShiftLabel.TextLabels.TOKEN).getText()));
}
Also used : LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 24 with LabeledCombo

use of org.eclipse.reddeer.swt.impl.combo.LabeledCombo 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);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 25 with LabeledCombo

use of org.eclipse.reddeer.swt.impl.combo.LabeledCombo in project jbosstools-hibernate by jbosstools.

the class JpaXmlEditor method setHibernateDialect.

/**
 * Sets hibernate dialect on hibernate tab
 * @param dialect hibernate dialect
 */
public void setHibernateDialect(String dialect) {
    activateHibernateTab();
    new LabeledCombo(this, "Database dialect:").setSelection(dialect);
}
Also used : LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo)

Aggregations

LabeledCombo (org.eclipse.reddeer.swt.impl.combo.LabeledCombo)26 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)11 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)10 Test (org.junit.Test)10 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)8 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)7 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)6 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)6 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)5 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)5 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)4 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)4 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)3 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)3 DefaultCombo (org.eclipse.reddeer.swt.impl.combo.DefaultCombo)3 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)3 WorkbenchShell (org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell)3 InternalBrowser (org.eclipse.reddeer.swt.impl.browser.InternalBrowser)2 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)2