Search in sources :

Example 21 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.

the class ImportApplicationWizardGitTest method testNoRepoRemote.

@Test
public void testNoRepoRemote() {
    createRepo();
    service.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    ImportApplicationWizard importWizard = new ImportApplicationWizard();
    assertProjectExistsErrorInWizard(importWizard);
    GitCloningWizardPage gitCloningWizardPage = new GitCloningWizardPage();
    gitCloningWizardPage.useExistingRepository(true);
    assertGitRemoteErrorInWizzard(importWizard);
    importWizard.cancel();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) GitCloningWizardPage(org.jboss.tools.openshift.reddeer.wizard.importapp.GitCloningWizardPage) ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) Test(org.junit.Test)

Example 22 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.

the class CreateServerAdapterTest method testCreateOpenShift3ServerAdapterViaServersView.

@Test
public void testCreateOpenShift3ServerAdapterViaServersView() {
    ServersView2 serversView = new ServersView2();
    serversView.open();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_SERVER).select();
    new DefaultShell(OpenShiftLabel.Shell.ADAPTER);
    new DefaultTreeItem(OpenShiftLabel.Others.OS3_SERVER_ADAPTER).select();
    next();
    next();
    setAdapterDetailsAndCreateAdapterAndVerifyExistence();
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ServersView2(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 23 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.

the class DeploymentTest method testDeploymentOfApplicationCreatedFromTemplate.

@Test
public void testDeploymentOfApplicationCreatedFromTemplate() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, "eap-app-1", ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.DEFAULT, false);
    try {
        new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, "eap-app-1", ResourceState.COMPLETE, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.getCustom(600), true);
    } catch (WaitTimeoutExpiredException ex) {
        fail("There should be a successful build of an application, but there is not.");
    }
    try {
        new WaitUntil(new AmountOfResourcesExists(Resource.POD, 2, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.getCustom(60), true);
    } catch (WaitTimeoutExpiredException ex) {
        fail("There should be precisely 2 pods. One of the build and one of an running application.");
    }
    explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getOpenShiftResources(Resource.ROUTE).get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.SHOW_IN_WEB_BROWSER).select();
    try {
        new WaitUntil(new BrowserContainsText("Hello World!"), TimePeriod.VERY_LONG);
        new BrowserEditor("helloworld").close();
    } catch (WaitTimeoutExpiredException ex) {
        fail("Application was not deployed successfully because it is not shown in web browser properly.\n" + ex.getMessage());
    }
}
Also used : AmountOfResourcesExists(org.jboss.tools.openshift.reddeer.condition.AmountOfResourcesExists) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) BrowserContainsText(org.jboss.tools.openshift.reddeer.condition.BrowserContainsText) BrowserEditor(org.eclipse.reddeer.eclipse.ui.browser.BrowserEditor) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 24 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem 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 25 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.

the class CDKServer method operateServerState.

@Override
protected void operateServerState(String menuItem, final ServerState resultState) {
    ServerState actualState = this.getLabel().getState();
    MultipleWaitConditionHandler waitConditions = new MultipleWaitConditionHandler(waitConditionMatrix, " one of given wait condition is fulfilled");
    TimePeriod timeout = TimePeriod.VERY_LONG;
    if (menuItem == "Restart") {
        timeout = TimePeriod.getCustom(480);
    }
    log.debug("Operate server's state from: + '" + actualState + "' to '" + menuItem + "'");
    select();
    new ContextMenuItem(menuItem).select();
    // waiting until servers's state has changed from initial state into something else,
    // ie. stopped -> starting or started -> stopping
    new WaitWhile(new ServerHasState(this, actualState), TimePeriod.DEFAULT);
    // we might expect that after the state is changed it should not go back into initial state
    // or that problem dialog appears
    // later on, we might get "Multiple problems have occurred" dialog
    waitForProblemDialog(waitConditions, menuItem, TimePeriod.DEFAULT);
    checkInitialStateChange(actualState);
    // decide if we wait for SSL acceptance dialog
    if ((actualState == ServerState.STOPPING || actualState == ServerState.STOPPED) && !getCertificatedAccepted()) {
        new WaitUntil(waitConditions, TimePeriod.getCustom(1020));
    }
    new WaitUntil(new ServerHasState(this, resultState), timeout);
    waitForProblemDialog(waitConditions, menuItem, TimePeriod.DEFAULT);
    new WaitWhile(new SystemJobIsRunning(new JobMatcher("Inspecting CDK environment")), TimePeriod.DEFAULT);
    log.debug("Operate server's state finished, the result server's state is: '" + getLabel().getState() + "'");
}
Also used : SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ServerHasState(org.eclipse.reddeer.eclipse.condition.ServerHasState) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) JobMatcher(org.jboss.tools.cdk.reddeer.core.matcher.JobMatcher) TimePeriod(org.eclipse.reddeer.common.wait.TimePeriod) ServerState(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersViewEnums.ServerState) MultipleWaitConditionHandler(org.jboss.tools.cdk.reddeer.core.condition.MultipleWaitConditionHandler) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)73 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)36 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)36 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)33 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)29 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)29 Test (org.junit.Test)26 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)19 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)17 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)15 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)11 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)11 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)9 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)8 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)8 KnownConfigurationsView (org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView)7 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)7 ImportApplicationWizard (org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard)6 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)5 EditConfigurationShell (org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell)5