Search in sources :

Example 91 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText 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 92 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText 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 93 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText in project jbosstools-openshift by jbosstools.

the class OpenShift3Connection method createNewProject.

/**
 * Creates a new OpenShift project for a connection.
 *
 * @param projectName project name
 * @param displayedName displayed name
 * @return OpenShift Project
 */
public OpenShiftProject createNewProject(String projectName, String displayedName) {
    select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_OS_PROJECT).select();
    new DefaultShell(OpenShiftLabel.Shell.CREATE_OS_PROJECT);
    new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText(projectName);
    if (displayedName != null) {
        new LabeledText(OpenShiftLabel.TextLabels.PROJECT_DISPLAYED_NAME).setText(displayedName);
    }
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
    if (displayedName == null) {
        return getProject(projectName);
    } else {
        return getProject(displayedName);
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText)

Aggregations

LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)93 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)34 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)32 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)30 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)30 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)30 Test (org.junit.Test)29 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)25 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)23 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)19 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)18 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)14 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)11 LabeledCombo (org.eclipse.reddeer.swt.impl.combo.LabeledCombo)11 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)10 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)9 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)9 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)8 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)8 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)8