Search in sources :

Example 21 with ControlIsEnabled

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

the class ResourceLabelsWizardPage method editLabel.

/**
 * Changes resource label to have a new name and value.
 * @param name current name of resource label
 * @param newName new name of resource label
 * @param newValue new value of resource label
 * @return true if resource label was successfully modified, false otherwise
 */
public boolean editLabel(String name, String newName, String newValue) {
    new DefaultTable().select(name);
    new PushButton(OpenShiftLabel.Button.EDIT).click();
    new DefaultShell(OpenShiftLabel.Shell.RESOURCE_LABEL);
    new LabeledText(OpenShiftLabel.TextLabels.LABEL).setText(newName);
    new LabeledText(OpenShiftLabel.TextLabels.VALUE).setText(newValue);
    new WaitUntil(new ControlIsEnabled(new OkButton()));
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESOURCE_LABEL));
    return new DefaultTable().containsItem(newName, 0) && new DefaultTable().containsItem(newValue, 1);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 22 with ControlIsEnabled

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

the class ResourceLabelsWizardPage method createLabel.

/**
 * Creates a new resource label with specified name and value.
 *
 * @param name name of label
 * @param value value of label
 * @return true if label was created successfully, false otherwise
 */
public boolean createLabel(String name, String value) {
    new PushButton(OpenShiftLabel.Button.ADD).click();
    new DefaultShell(OpenShiftLabel.Shell.RESOURCE_LABEL);
    new LabeledText(OpenShiftLabel.TextLabels.LABEL).setText(name);
    new LabeledText(OpenShiftLabel.TextLabels.VALUE).setText(value);
    new WaitUntil(new ControlIsEnabled(new OkButton()));
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESOURCE_LABEL));
    return new DefaultTable().containsItem(name, 0) && new DefaultTable().containsItem(value, 1);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 23 with ControlIsEnabled

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

the class AbstractOpenShiftApplicationWizard method cancel.

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

Example 24 with ControlIsEnabled

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

the class AbstractOpenShiftApplicationWizard method signToOpenShiftAndClickNext.

private void signToOpenShiftAndClickNext() {
    new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    selectConnection(username, server, new DefaultCombo(0));
    new NextButton().click();
    processUntrustedSSLCertificate();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
}
Also used : DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 25 with ControlIsEnabled

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

the class AbstractOpenShiftApplicationWizard method next.

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

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