Search in sources :

Example 56 with FinishButton

use of org.eclipse.reddeer.swt.impl.button.FinishButton 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 57 with FinishButton

use of org.eclipse.reddeer.swt.impl.button.FinishButton in project jbosstools-openshift by jbosstools.

the class ImportApplicationWizard method finish.

public void finish() {
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 58 with FinishButton

use of org.eclipse.reddeer.swt.impl.button.FinishButton in project jbosstools-openshift by jbosstools.

the class ImportApplicationWizard method finishAndOverrideExisting.

public void finishAndOverrideExisting() {
    new FinishButton().click();
    new DefaultShell("Overwrite project(s) ?");
    new YesButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Example 59 with FinishButton

use of org.eclipse.reddeer.swt.impl.button.FinishButton 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

FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)59 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)36 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)32 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)31 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)30 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)28 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)24 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)23 Test (org.junit.Test)14 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)13 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)11 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)9 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)8 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)8 NewCDKServerWizard (org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard)8 DefaultCombo (org.eclipse.reddeer.swt.impl.combo.DefaultCombo)7 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)6 LabeledCombo (org.eclipse.reddeer.swt.impl.combo.LabeledCombo)6 ContextMenu (org.eclipse.reddeer.swt.impl.menu.ContextMenu)6 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)6