Search in sources :

Example 91 with WaitWhile

use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.

the class Service method createServerAdapter.

/**
 * Creates server adapter for this service with default values.
 */
public void createServerAdapter() {
    select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
    new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS));
    new WaitUntil(new JobIsKilled("Refreshing server adapter list"), TimePeriod.LONG, false);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_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) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsKilled(org.eclipse.reddeer.workbench.core.condition.JobIsKilled) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 92 with WaitWhile

use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.

the class AbstractOpenShiftConnection method remove.

/**
 * Removes connection from OpenShift explorer view.
 */
public void remove() {
    item.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.DELETE_CONNECTION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_CONNECTION));
    new DefaultShell(OpenShiftLabel.Shell.REMOVE_CONNECTION);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_CONNECTION));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 93 with WaitWhile

use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.

the class PortForwardingTest method closePortForwardingShell.

@After
public void closePortForwardingShell() {
    PushButton stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
    if (stopAllButton.isEnabled()) {
        stopAllButton.click();
        new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false);
    }
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_PORT_FORWARDING).close();
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) After(org.junit.After)

Example 94 with WaitWhile

use of org.eclipse.reddeer.common.wait.WaitWhile 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 95 with WaitWhile

use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.

the class PortForwardingTest method testPortForwardingButtonsAccessibility.

@Test
public void testPortForwardingButtonsAccessibility() {
    openPortForwardingDialog();
    PushButton startAllButton = new PushButton(OpenShiftLabel.Button.START_ALL);
    PushButton stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
    OkButton okButton = new OkButton();
    assertTrue("Button Start All should be enabled at this point.", startAllButton.isEnabled());
    assertFalse("Button Stop All should be disabled at this point.", stopAllButton.isEnabled());
    startAllButton.click();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitUntil(new ControlIsEnabled(okButton));
    try {
        new WaitWhile(new ControlIsEnabled(startAllButton), TimePeriod.getCustom(5));
    } catch (WaitTimeoutExpiredException ex) {
        fail("Button Start All should be disabled at this point.");
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitWhile(new ControlIsEnabled(okButton), false);
    stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
    assertTrue("Button Stop All should be enabled at this point.", stopAllButton.isEnabled());
    stopAllButton.click();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_PORT_FORWARDING);
    new WaitUntil(new ControlIsEnabled(okButton));
    try {
        new WaitUntil(new ControlIsEnabled(startAllButton), TimePeriod.getCustom(5));
    } catch (WaitTimeoutExpiredException ex) {
        fail("Button Start All should be enabled at this point.");
    }
    assertFalse("Button Stop All should be disabled at this point.", stopAllButton.isEnabled());
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)209 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)142 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)97 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)84 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)72 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)49 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)45 Test (org.junit.Test)42 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)36 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)36 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)31 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)24 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)22 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)19 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)19 Shell (org.eclipse.reddeer.swt.api.Shell)17 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)17 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)16 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)16