Search in sources :

Example 31 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.

the class DebuggingEAPAppTest method rebuildProject.

private static void rebuildProject() {
    PackageExplorerPart pexplorer = new PackageExplorerPart();
    pexplorer.open();
    pexplorer.getProject(PROJECT_NAME).select();
    new ContextMenuItem("Maven", "Update Project...").select();
    new WaitUntil(new ShellIsAvailable("Update Maven Project"), TimePeriod.LONG);
    new CheckBox("Force Update of Snapshots/Releases").toggle(true);
    new PushButton("OK").click();
    new WaitWhile(new ShellIsAvailable("Update Maven Project"), TimePeriod.DEFAULT);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 32 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.

the class CreateApplicationOnBuilderImageTest method testCreateApplicationBasedOnBuilderImage.

@Test
public void testCreateApplicationBasedOnBuilderImage() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer();
    BuilderImageApplicationWizardHandlingTest.nextToBuildConfigurationWizardPage();
    applicationName = new LabeledText("Name: ").getText();
    new WaitUntil(new ControlIsEnabled(new FinishButton()));
    new FinishButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY));
    CreateApplicationFromTemplateTest.importApplicationAndVerify(projectName);
    OpenShiftProject project = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject();
    project.refresh();
    new WaitWhile(new JobIsRunning(), TimePeriod.getCustom(120));
    new WaitUntil(new OpenShiftResourceExists(Resource.BUILD_CONFIG, connectionReq.getConnection()), TimePeriod.LONG, false);
    List<OpenShiftResource> buildConfig = project.getOpenShiftResources(Resource.BUILD_CONFIG);
    assertTrue("There should be precisely 1 build config for created application, but there is following amount" + " of build configs: " + buildConfig.size(), buildConfig.size() == 1);
    List<OpenShiftResource> imageStream = project.getOpenShiftResources(Resource.IMAGE_STREAM);
    assertTrue("There should be precisely 1 image stream for created application, but there is following amount" + " of image streams: " + imageStream.size(), imageStream.size() == 1);
    List<OpenShiftResource> routes = project.getOpenShiftResources(Resource.ROUTE);
    assertTrue("There should be precisely 1 route for created application, but there is following amount" + " of routes:" + routes.size(), routes.size() == 1);
    assertTrue("Generated (default) route should contain application name, but it's not contained.", routes.get(0).getName().equals(applicationName));
    List<OpenShiftResource> services = project.getOpenShiftResources(Resource.SERVICE);
    assertTrue("There should be precisely 1 service for created application, but there is following amount" + " of services: " + services.size(), services.size() == 1);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OpenShiftProject(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard) 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) BuilderImageApplicationWizardHandlingTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.BuilderImageApplicationWizardHandlingTest)

Example 33 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.

the class AbstractOpenShiftWizardPageTest method setUp.

@Before
public void setUp() {
    this.wizard = new OpenShiftEventTestWizard();
    Shell shell = new WorkbenchShell().getSWTWidget();
    Display.asyncExec(new Runnable() {

        @Override
        public void run() {
            org.eclipse.jface.wizard.WizardDialog dialog = new org.eclipse.jface.wizard.WizardDialog(shell, wizard);
            dialog.create();
            dialog.open();
        }
    });
    new WaitUntil(new ShellIsAvailable(OpenShiftEventTestWizard.TITLE));
    wizardBot = new WizardDialog();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) Shell(org.eclipse.swt.widgets.Shell) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) WizardDialog(org.eclipse.reddeer.jface.wizard.WizardDialog) Before(org.junit.Before)

Example 34 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.

the class MinishiftServerEditor method openLaunchConfigurationFromLink.

public void openLaunchConfigurationFromLink() {
    log.info("Activate launch configuration via link");
    getLaunchConfigurationHyperLink().activate();
    ShellIsAvailable launch = new ShellIsAvailable("Edit Configuration");
    try {
        new WaitUntil(launch, TimePeriod.DEFAULT);
    } catch (WaitTimeoutExpiredException exc) {
        log.error("WaitTimeoutExpiredException occured while waiting for Edit Configuration dialog");
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 35 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.

the class CDKServerEditorAbstractTest method errorDialogAppeared.

private void errorDialogAppeared() {
    try {
        new WaitUntil(new ShellIsAvailable(new DefaultShell(getServerAdapter())), TimePeriod.MEDIUM);
        log.info("Error Message Dialog appeared as expected");
    } catch (WaitTimeoutExpiredException exc) {
        log.error(exc.getMessage());
        fail("Error Message Dialog did not appear while trying to save editor");
    }
    new OkButton().click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)128 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)97 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)84 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)73 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)52 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)47 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)44 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)33 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)32 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)25 Test (org.junit.Test)21 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)19 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)18 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)18 Shell (org.eclipse.reddeer.swt.api.Shell)17 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)14 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)13 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)13 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)10