Search in sources :

Example 6 with DefaultTable

use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project jbosstools-openshift by jbosstools.

the class PortForwardingTest method testFreePortsForPortForwarding.

@Test
public void testFreePortsForPortForwarding() {
    openPortForwardingDialog();
    CheckBox checkBox = new CheckBox(OpenShiftLabel.TextLabels.FIND_FREE_PORTS);
    Table table = new DefaultTable();
    assertTrue("Default port should be used for ping on first opening of Port forwarding dialog.", table.getItem("ping").getText(1).equals("8888"));
    assertTrue("Default port should be used for http on first opening of Port forwarding dialog.", table.getItem("http").getText(1).equals("8080"));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    checkBox.click();
    assertFalse("Free port port should be used for ping at this point.", table.getItem("ping").getText(1).equals("8888"));
    assertFalse("Free port should be used for http at this point.", table.getItem("http").getText(1).equals("8080"));
    checkBox.click();
    assertTrue("Default port should be used for ping at this point.", table.getItem("ping").getText(1).equals("8888"));
    assertTrue("Default port should be used for http at this point.", table.getItem("http").getText(1).equals("8080"));
}
Also used : DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) Table(org.eclipse.reddeer.swt.api.Table) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 7 with DefaultTable

use of org.eclipse.reddeer.swt.impl.table.DefaultTable 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 8 with DefaultTable

use of org.eclipse.reddeer.swt.impl.table.DefaultTable 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 9 with DefaultTable

use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project jbosstools-openshift by jbosstools.

the class EnvironmentVariableWizardPage method removeEnvironmentVariable.

/**
 * Removes environment.
 *
 * @param envVar environment variable to remove
 * @return true if variable was removed successfully, false otherwise
 */
public boolean removeEnvironmentVariable(EnvVar envVar) {
    DefaultTable table = new DefaultTable();
    table.select(envVar.getName());
    new PushButton(OpenShiftLabel.Button.REMOVE_BASIC).click();
    new DefaultShell(OpenShiftLabel.Shell.REMOVE_ENV_VAR);
    new YesButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_ENV_VAR));
    return !(table.containsItem(envVar.getName(), 0) && table.containsItem(envVar.getValue(), 1));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Example 10 with DefaultTable

use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project linuxtools by eclipse.

the class NewDockerConnectionPage method search.

public void search(String connectionName) {
    new PushButton("Search...").click();
    new WaitUntil(new ShellIsAvailable("Docker Connection Selection"));
    Table table = new DefaultTable();
    table.getItem(connectionName).select();
    new OkButton().click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) Table(org.eclipse.reddeer.swt.api.Table) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)28 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)20 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)18 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)17 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)16 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)11 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)10 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)8 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)7 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)6 Test (org.junit.Test)6 Table (org.eclipse.reddeer.swt.api.Table)5 TableItem (org.eclipse.reddeer.swt.api.TableItem)5 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)4 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)3 DefaultText (org.eclipse.reddeer.swt.impl.text.DefaultText)3 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)3 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)3 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)2 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)2