Search in sources :

Example 21 with WaitUntil

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

the class ServerAdapterWizardHandlingTest method openNewServerAdapterWizard.

private void openNewServerAdapterWizard() {
    NewServerWizard dialog = new NewServerWizard();
    dialog.open();
    NewServerWizardPage page = new NewServerWizardPage(dialog);
    dialog.open();
    new WaitUntil(new JobIsKilled("Refreshing server adapter list"), TimePeriod.LONG, false);
    page.selectType(OpenShiftLabel.Others.OS3_SERVER_ADAPTER);
    dialog.next();
}
Also used : NewServerWizard(org.eclipse.reddeer.eclipse.wst.server.ui.wizard.NewServerWizard) JobIsKilled(org.eclipse.reddeer.workbench.core.condition.JobIsKilled) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) NewServerWizardPage(org.eclipse.reddeer.eclipse.wst.server.ui.wizard.NewServerWizardPage)

Example 22 with WaitUntil

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

the class OpenShiftUtils method handleCheatSheetCreateServerAdapter.

public static void handleCheatSheetCreateServerAdapter() {
    try {
        new WaitUntil(new ShellIsAvailable(new WithTextMatcher(new RegexMatcher(OpenShiftLabel.Shell.CHEATSHEET + "|" + OpenShiftLabel.Shell.CREATE_SERVER_ADAPTER))), TimePeriod.LONG);
        new NoButton().click();
        new DefaultShell("Create server adapter");
        new NoButton().click();
    } catch (CoreLayerException ex) {
    // Swallow, shells are not opened
    } catch (WaitTimeoutExpiredException e) {
    // Also swallow, shells are not opened
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) NoButton(org.eclipse.reddeer.swt.impl.button.NoButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) RegexMatcher(org.eclipse.reddeer.common.matcher.RegexMatcher) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 23 with WaitUntil

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

the class OpenShiftUtils method openImportApplicationWizardFromOpenshiftView.

public static ImportApplicationWizard openImportApplicationWizardFromOpenshiftView(OpenShiftProject openshiftProject) {
    openshiftProject.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    return new ImportApplicationWizard();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 24 with WaitUntil

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

the class OpenShiftUtils method openServerSettingsWizardFromOpenshiftView.

public static ServerSettingsWizard openServerSettingsWizardFromOpenshiftView(Service openshiftService) {
    openshiftService.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS), TimePeriod.LONG);
    return new ServerSettingsWizard();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ServerSettingsWizard(org.jboss.tools.openshift.reddeer.wizard.server.ServerSettingsWizard) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 25 with WaitUntil

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

the class OpenShiftServiceRequirement method waitForResources.

private void waitForResources(final String serviceName, final String projectName, final IService service) {
    new WaitUntil(new ServicePodsExist(serviceName, projectName, connection), TimePeriod.VERY_LONG);
    new WaitUntil(new ResourceExists(ResourceKind.REPLICATION_CONTROLLER, new BaseMatcher<List<IResource>>() {

        @Override
        public boolean matches(Object item) {
            if (!(item instanceof List)) {
                return false;
            }
            @SuppressWarnings("unchecked") List<IReplicationController> resources = (List<IReplicationController>) item;
            if (resources.isEmpty()) {
                return false;
            }
            return ResourceUtils.getReplicationControllerFor(service, resources) != null;
        }

        @Override
        public void describeTo(Description description) {
        }
    }, projectName, connection), TIMEPERIOD_WAIT_FOR_BUILD);
}
Also used : Description(org.hamcrest.Description) BaseMatcher(org.hamcrest.BaseMatcher) ServicePodsExist(org.jboss.tools.openshift.reddeer.condition.core.ServicePodsExist) List(java.util.List) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) ResourceExists(org.jboss.tools.openshift.reddeer.condition.core.ResourceExists) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) IResource(com.openshift.restclient.model.IResource) IReplicationController(com.openshift.restclient.model.IReplicationController)

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