Search in sources :

Example 51 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled 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 52 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.

the class AbstractOpenShiftApplicationWizard method back.

/**
 * Waits and clicks Back button.
 */
public void back() {
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
    new BackButton().click();
}
Also used : ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 53 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-hibernate by jbosstools.

the class JpaFacetInstallPage method setConnectionProfile.

/**
 * Sets connection profile for JPA
 * @param profileName given connection profile
 */
public void setConnectionProfile(String profileName) {
    DefaultGroup group = new DefaultGroup(referencedComposite, "Connection");
    new WaitUntil(new ControlIsEnabled(new DefaultCombo(group)));
    new DefaultCombo(group).setSelection(profileName);
    PushButton apply = new PushButton(referencedComposite, "Apply");
    apply.click();
    new WaitWhile(new JobIsRunning());
    new WaitWhile(new ShellIsAvailable("Progress Information"), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultGroup(org.eclipse.reddeer.swt.impl.group.DefaultGroup) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 54 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-hibernate by jbosstools.

the class ProjectConfigurationFactory method convertProjectToFacetsForm.

/**
 * Convert project to facet form
 * @param prj given project name
 */
public static void convertProjectToFacetsForm(String prj) {
    ProjectExplorer pe = new ProjectExplorer();
    pe.open();
    PropertyDialog pd = pe.getProject(prj).openProperties();
    pd.select("Project Facets");
    // convert to faceted form
    new DefaultTreeItem("Project Facets").select();
    new DefaultLink("Convert to faceted form...").click();
    new WaitWhile(new JobIsRunning());
    new WaitUntil(new WidgetIsFound(Button.class, new WithStyleMatcher(SWT.PUSH), new WithMnemonicTextMatcher("Apply")), TimePeriod.LONG);
    PushButton apply = new PushButton("Apply");
    new WaitUntil(new ControlIsEnabled(apply));
    apply.click();
    pd.ok();
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) WithStyleMatcher(org.eclipse.reddeer.core.matcher.WithStyleMatcher) DefaultLink(org.eclipse.reddeer.swt.impl.link.DefaultLink) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertyDialog(org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog) WithMnemonicTextMatcher(org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher) WidgetIsFound(org.eclipse.reddeer.core.condition.WidgetIsFound) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) Button(org.eclipse.swt.widgets.Button) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Aggregations

WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)54 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)54 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)31 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)25 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)25 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)24 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)19 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)18 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)17 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)17 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)14 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)14 Test (org.junit.Test)13 NewCDKServerWizard (org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard)9 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)8 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)8 DefaultCombo (org.eclipse.reddeer.swt.impl.combo.DefaultCombo)7 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)7 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)6 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)6