Search in sources :

Example 96 with WaitWhile

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

the class TriggerBuildTest method testCloneExistingBuild.

@Test
public void testCloneExistingBuild() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.reopen();
    new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, (Matcher<String>) null, ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.getCustom(240), true);
    List<OpenShiftResource> builds = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getOpenShiftResources(Resource.BUILD);
    builds.get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.CLONE_BUILD).select();
    int oldAmountOfBuilds = builds.size();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    try {
        new WaitUntil(new AmountOfResourcesExists(Resource.BUILD, oldAmountOfBuilds + 1, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.LONG);
    } catch (WaitTimeoutExpiredException ex) {
        fail("New build was not triggered altough it should be.");
    }
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) AmountOfResourcesExists(org.jboss.tools.openshift.reddeer.condition.AmountOfResourcesExists) Matcher(org.hamcrest.Matcher) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) 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)

Example 97 with WaitWhile

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

the class ScalingTest method scaleTo.

private void scaleTo(int amountOfPods) {
    new ContextMenuItem(OpenShiftLabel.ContextMenu.SCALE_TO).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.SCALE_DEPLOYMENTS));
    new DefaultShell(OpenShiftLabel.Shell.SCALE_DEPLOYMENTS).setFocus();
    new WaitWhile(new ControlIsEnabled(new OkButton()));
    new DefaultSpinner().setValue(amountOfPods);
    new WaitUntil(new ControlIsEnabled(new OkButton()));
    new OkButton().click();
}
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) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultSpinner(org.eclipse.reddeer.swt.impl.spinner.DefaultSpinner) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 98 with WaitWhile

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

the class EditResourcesTest method tearDown.

public static void tearDown() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.reopen();
    OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
    connection.getProject().delete();
    try {
        new WaitWhile(new OpenShiftProjectExists(connectionReq.getConnection()));
    } catch (WaitTimeoutExpiredException ex) {
        connection.refresh();
        new WaitWhile(new OpenShiftProjectExists(connectionReq.getConnection()), TimePeriod.getCustom(5));
    }
    connection.createNewProject();
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    if (projectExplorer.containsProject(PROJECT_NAME)) {
        projectExplorer.getProject(PROJECT_NAME).delete(true);
    }
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) OpenShiftProjectExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftProjectExists) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShift3Connection(org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)

Example 99 with WaitWhile

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

the class EditResourcesTest method testEditBuildConfigAndCheckChangesInExplorer.

@Test
public void testEditBuildConfigAndCheckChangesInExplorer() {
    TextEditor editor = getBuildConfigTextEditor();
    String text = editor.getText();
    if (buildConfig == null) {
        buildConfig = text;
    }
    editor.setText(text.replace(originalRepo, customRepo));
    editor.close(true);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    assertTrue("Changes from updating of a build config should be shown " + "in Properties view, but it is not.", getBuildConfig().getPropertyValue("Source", "URI").equals(customRepo));
}
Also used : TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) 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 100 with WaitWhile

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

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