Search in sources :

Example 71 with WaitUntil

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

the class OpenShift3NativeProjectUtils method createProject.

public static IProject createProject(String name, String displayName, String description, Connection connection) {
    assertTrue(StringUtils.isNotBlank(name));
    assertNotNull(displayName);
    assertNotNull(description);
    assertNotNull(connection);
    IProjectRequest request = connection.getResourceFactory().stub(ResourceKind.PROJECT_REQUEST, name);
    request.setDisplayName(StringUtils.isEmpty(displayName) ? name : displayName);
    request.setDescription(StringUtils.isEmpty(description) ? name : description);
    CreateProjectWaitCondition createProjectWaitCondition = new CreateProjectWaitCondition(connection, request);
    new WaitUntil(createProjectWaitCondition, TimePeriod.VERY_LONG);
    IProject createdProject = createProjectWaitCondition.getProject();
    /**
     * WORKAROUND: explorer wont get notified of the the new project and
     * therefore wont display it unless a manual refresh is done on the
     * connection. https://issues.jboss.org/browse/JBIDE-23513 remove
     * this wait once WatchManager is watching projects and notifies the
     * ui.
     *
     * @see WatchManager#KINDS
     */
    new WaitUntil(new OpenShiftProjectExists(createdProject.getDisplayName(), connection));
    return createdProject;
}
Also used : OpenShiftProjectExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftProjectExists) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) IProjectRequest(com.openshift.restclient.model.project.IProjectRequest) IProject(com.openshift.restclient.model.IProject)

Example 72 with WaitUntil

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

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

use of org.eclipse.reddeer.common.wait.WaitUntil 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)

Example 75 with WaitUntil

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

the class ScalingTest method scaleTo0ShouldWarn.

@Test
public void scaleTo0ShouldWarn() {
    int pods = requiredService.getReplicationController().getCurrentReplicaCount();
    new WaitUntil(new PodsAreDeployed(project, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER, pods), TimePeriod.LONG);
    OpenShiftResource replicationController = project.getOpenShiftResource(Resource.DEPLOYMENT, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER);
    replicationController.select();
    scaleTo(0);
    new DefaultShell(OpenShiftLabel.Shell.STOP_ALL_DEPLOYMENTS).setFocus();
    new YesButton().click();
    assertPodAmountDesiredEqualsCurrent(0, project);
}
Also used : DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) PodsAreDeployed(org.jboss.tools.openshift.reddeer.condition.PodsAreDeployed) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)178 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)74 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)73 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)63 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)59 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)54 Test (org.junit.Test)44 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)40 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)36 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)36 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)34 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)30 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)25 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)22 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)20 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)18 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)18 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)15 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)13 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)12