Search in sources :

Example 51 with ContextMenuItem

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

the class PortForwardingTest method openPortForwardingDialog.

private void openPortForwardingDialog() {
    OpenShift3Connection openShift3Connection = new OpenShiftExplorerView().getOpenShift3Connection(connectionReq.getConnection());
    ApplicationPodIsRunning applicationPodIsRunning = new ApplicationPodIsRunning(openShift3Connection.getProject(projectReq.getProjectName()));
    new WaitUntil(applicationPodIsRunning, TimePeriod.LONG);
    openShift3Connection.getProject(projectReq.getProjectName()).getOpenShiftResource(Resource.POD, applicationPodIsRunning.getApplicationPodName()).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.PORT_FORWARD).select();
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_PORT_FORWARDING);
}
Also used : ApplicationPodIsRunning(org.jboss.tools.openshift.reddeer.condition.ApplicationPodIsRunning) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShift3Connection(org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)

Example 52 with ContextMenuItem

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

the class CreateServerAdapterTest method testCreateOpenShift3ServerAdapterViaOpenShiftExplorerView.

@Test
public void testCreateOpenShift3ServerAdapterViaOpenShiftExplorerView() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.getOpenShift3Connection(connectionReq.getConnection()).refresh();
    explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getServicesWithName("eap-app").get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
    new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
    assertTrue("Service should be preselected for new OpenShift 3 server adapter", new DefaultTreeItem(projectReq.getProjectName(), "eap-app deploymentConfig=eap-app").isSelected());
    assertTrue("Eclipse project should be preselected automatically for new server adapter", new LabeledText("Eclipse Project: ").getText().equals(PROJECT_NAME));
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(""));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false);
    assertTrue("OpenShift 3 server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, "eap-app", "Service").test());
}
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) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ServerAdapterExists(org.jboss.tools.openshift.reddeer.condition.ServerAdapterExists) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 53 with ContextMenuItem

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

the class NodeJSAppDebugTest method setUp.

@Before
public void setUp() {
    TestUtils.setUpOcBinary();
    TestUtils.cleanupGitFolder(OpenShiftResources.NODEJS_GIT_NAME);
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    this.connection = explorer.getOpenShift3Connection(requiredConnection.getConnection());
    this.project = connection.getProject(requiredProject.getProjectName());
    this.project.expand();
    // import application
    this.project.getService(OpenShiftResources.NODEJS_SERVICE).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    // setup server adapter
    explorer.activate();
    this.project.getService(OpenShiftResources.NODEJS_SERVICE).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
    new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(""), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    assertTrue("OpenShift 3 server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, OpenShiftResources.NODEJS_SERVICE, "Service").test());
    // restart in debug
    this.adapter = new ServerAdapter(Version.OPENSHIFT3, OpenShiftResources.NODEJS_SERVICE, "Service");
    this.adapter.select();
    new ContextMenuItem("Restart in Debug").select();
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ServerAdapter(org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter) 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) ServerAdapterExists(org.jboss.tools.openshift.reddeer.condition.ServerAdapterExists) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) Before(org.junit.Before)

Example 54 with ContextMenuItem

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

the class DebuggingEAPAppTest method restartServerInDebug.

private static void restartServerInDebug(ServerAdapter serverAdapter) {
    serverAdapter.select();
    new ContextMenuItem("Restart in Debug").select();
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    waitForserverAdapterToBeInRightState();
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 55 with ContextMenuItem

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

the class DebuggingEAPAppTest method setNewVariableValue.

// TODO this should be replaced once
// https://github.com/jboss-reddeer/reddeer/issues/1668 is fixed.
private void setNewVariableValue(String newValue, final String... variablePath) {
    new WaitWhile(new JobIsRunning());
    LaunchView debugView = new LaunchView();
    debugView.open();
    ensureCorrectFrameIsSelected(debugView);
    VariablesView variablesView = new VariablesView();
    variablesView.open();
    new WaitUntil(new AbstractWaitCondition() {

        @Override
        public boolean test() {
            try {
                TreeItem variable = new DefaultTreeItem(variablePath);
                variable.select();
                return variable.isSelected();
            } catch (Exception e) {
                return false;
            }
        }

        @Override
        public String description() {
            return "Variable is not selected";
        }
    }, TimePeriod.LONG);
    try {
        new ContextMenuItem("Change Value...").select();
    } catch (CoreLayerException e) {
        throw e;
    }
    new DefaultShell("Change Object Value");
    new DefaultStyledText().setText(newValue);
    new OkButton().click();
    new WaitWhile(new JobIsRunning());
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) CaptureScreenshotException(org.eclipse.reddeer.junit.screenshot.CaptureScreenshotException) IOException(java.io.IOException) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultStyledText(org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText) LaunchView(org.eclipse.reddeer.eclipse.debug.ui.views.launch.LaunchView) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractWaitCondition(org.eclipse.reddeer.common.condition.AbstractWaitCondition) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) VariablesView(org.eclipse.reddeer.eclipse.debug.ui.views.variables.VariablesView)

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