Search in sources :

Example 61 with ContextMenuItem

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

the class RemoveConnectionTest method testRemoveConnection.

@Test
public void testRemoveConnection() {
    explorer.open();
    explorer.getOpenShift3Connection(connectionReq.getConnection()).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.DELETE_CONNECTION).select();
    new DefaultShell(OpenShiftLabel.Shell.REMOVE_CONNECTION);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_CONNECTION), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    assertFalse("Connection is still presented in OpenShift explorer", explorer.connectionExists(connectionReq.getConnection().getUsername(), DatastoreOS3.SERVER));
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) 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 62 with ContextMenuItem

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

the class ConnectionPropertiesTest method testConnectionProperties.

@Test
public void testConnectionProperties() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
    connection.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.PROPERTIES).select();
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.activate();
    assertEquals("Property host is not valid. Was '" + propertiesView.getProperty(PROPERTY_HOST).getPropertyValue() + "' but was expected '" + DatastoreOS3.SERVER + "'", DatastoreOS3.SERVER, propertiesView.getProperty(PROPERTY_HOST).getPropertyValue());
    if (DatastoreOS3.AUTH_METHOD.equals(AuthenticationMethod.BASIC)) {
        assertEquals("Property user name is not valid. Was '" + propertiesView.getProperty(PROPERTY_USERNAME).getPropertyValue() + "' but was expected '" + DatastoreOS3.USERNAME + "'", DatastoreOS3.USERNAME, propertiesView.getProperty(PROPERTY_USERNAME).getPropertyValue());
    } else {
        assertEquals("Property user name is not valid. Was '" + propertiesView.getProperty(PROPERTY_USERNAME).getPropertyValue() + "' but was expected '" + connectionReq.getConnection().getUsername() + "'", connectionReq.getConnection().getUsername(), propertiesView.getProperty(PROPERTY_USERNAME).getPropertyValue());
    }
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShift3Connection(org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 63 with ContextMenuItem

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

the class DeployDockerImageTest method testDeployDockerImageFromOpenShiftExplorer.

@Test
public void testDeployDockerImageFromOpenShiftExplorer() {
    selectProject(PROJECT2);
    new ContextMenuItem(OpenShiftLabel.ContextMenu.DEPLOY_DOCKER_IMAGE).select();
    new DefaultShell(OpenShiftLabel.Shell.DEPLOY_IMAGE_TO_OPENSHIFT);
    new LabeledText(OpenShiftLabel.TextLabels.IMAGE_NAME).setText(HELLO_OS_DOCKER_IMAGE + ":" + TAG);
    proceedThroughDeployImageToOpenShiftWizard();
    verifyDeployedHelloWorldDockerImage(PROJECT2);
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 64 with ContextMenuItem

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

the class DeployDockerImageTest method assertDockerImageIsProcessedCorrectlyWhenUsedFromOpenShiftExplorer.

/**
 * Selects project in OpenShift explorer view, open Deploy Image to OpenShift wizard
 * from its context menu and assert that there are correct values.
 * @param projectName
 * @param projectDisplayName
 */
private void assertDockerImageIsProcessedCorrectlyWhenUsedFromOpenShiftExplorer(String projectName) {
    selectProject(projectName);
    new ContextMenuItem(OpenShiftLabel.ContextMenu.DEPLOY_DOCKER_IMAGE).select();
    new DefaultShell(OpenShiftLabel.Shell.DEPLOY_IMAGE_TO_OPENSHIFT);
    assertFalse("No project has been preselected.", new LabeledCombo("OpenShift Project: ").getSelection().equals(""));
    assertTrue("Wrong project has been preselected.", new LabeledCombo("OpenShift Project: ").getSelection().equals(projectName));
    closeWizard();
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell)

Example 65 with ContextMenuItem

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

the class OpenShift3Connection method editConnection.

public OpenShift3ConnectionWizard editConnection() {
    activateOpenShiftExplorerView();
    new ContextMenuItem(getTreeItem(), OpenShiftLabel.ContextMenu.EDIT_CONNECTION).select();
    return new OpenShift3ConnectionWizard(OpenShiftLabel.Shell.EDIT_CONNECTION);
}
Also used : OpenShift3ConnectionWizard(org.jboss.tools.openshift.reddeer.wizard.v3.OpenShift3ConnectionWizard) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)

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