Search in sources :

Example 21 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class DeployDockerImageTest method selectProject.

/**
 * Selects project in OpenShift explorer view.
 * @param projectName
 * @param projectDisplayName
 */
private void selectProject(String projectName) {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.getOpenShift3Connection(openshiftConnectionRequirement.getConnection()).refresh();
    explorer.getOpenShift3Connection(openshiftConnectionRequirement.getConnection()).getProject(projectName).select();
}
Also used : OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)

Example 22 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class DeployDockerImageTest method createProjects.

private static void createProjects() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    OpenShift3Connection connection = explorer.getOpenShift3Connection(openshiftConnectionRequirement.getConnection());
    connection.createNewProject(PROJECT1);
    connection.createNewProject(PROJECT2);
}
Also used : OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShift3Connection(org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)

Example 23 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class DeployDockerImageTest method verifyDeployedHelloWorldDockerImage.

/**
 * Verifies whether an application pod has been created and application is running successfully.
 */
private void verifyDeployedHelloWorldDockerImage(String projectName) {
    new OpenShiftExplorerView().getOpenShift3Connection(openshiftConnectionRequirement.getConnection()).refresh();
    try {
        new WaitUntil(new OpenShiftResourceExists(Resource.POD, new StringContains("hello-openshift"), ResourceState.RUNNING, projectName, openshiftConnectionRequirement.getConnection()), TimePeriod.VERY_LONG);
    } catch (WaitTimeoutExpiredException ex) {
        fail("There should be a running application pod for a deployed docker image, " + "but it does not exist.");
    }
    new OpenShiftExplorerView().getOpenShift3Connection(openshiftConnectionRequirement.getConnection()).refresh();
    new OpenShiftExplorerView().getOpenShift3Connection(openshiftConnectionRequirement.getConnection()).getProject(projectName).getOpenShiftResources(Resource.ROUTE).get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.SHOW_IN_BROWSER).select();
    try {
        // getRouteURL("hello-openshift", projectName),
        new WaitUntil(new BrowserContainsText("Hello OpenShift!"), TimePeriod.VERY_LONG);
    } catch (WaitTimeoutExpiredException ex) {
        fail("Browser does not contain hello world content.");
    }
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) BrowserContainsText(org.jboss.tools.openshift.reddeer.condition.BrowserContainsText) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) StringContains(org.hamcrest.core.StringContains)

Example 24 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class ProjectPropertiesTest method setUp.

@Before
public void setUp() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
    project = connection.getProject(DatastoreOS3.TEST_PROJECT);
    project.select();
    project.openProperties();
    propertiesView = new PropertySheet();
}
Also used : 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) Before(org.junit.Before)

Example 25 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class SecureStorage method triggerSecureStorageOfPasswordInConnectionDialog.

/**
 * Triggers secure storage of password.
 *
 * @param username
 *            user name
 * @param server
 *            server
 * @param storePassword
 *            store password if value is set to true, remove password if value
 *            is set to false
 * @param serverType
 *            type of a server
 */
private static void triggerSecureStorageOfPasswordInConnectionDialog(String username, String server, boolean storePassword) {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    AbstractOpenShiftConnection connection = explorer.getOpenShiftConnection(username, server);
    connection.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT_CONNECTION).select();
    new DefaultShell(OpenShiftLabel.Shell.EDIT_CONNECTION);
    // Store password if it is not stored
    if (!(new CheckBox(1).isChecked()) && storePassword) {
        new CheckBox(1).click();
        new FinishButton().click();
        TestUtils.acceptSSLCertificate();
        handleSecureStoragePasswordAndHint(SystemProperties.SECURE_STORAGE_PASSWORD);
    // Remove password if it is stored
    } else if (new CheckBox(1).isChecked() && !storePassword) {
        new CheckBox(1).click();
        new FinishButton().click();
    }
    new WaitWhile(new JobIsRunning());
}
Also used : 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) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) AbstractOpenShiftConnection(org.jboss.tools.openshift.reddeer.view.resources.AbstractOpenShiftConnection) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)

Aggregations

OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)59 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)22 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)19 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)19 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)19 Test (org.junit.Test)18 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)17 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)17 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)16 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)13 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)11 OpenShiftProject (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject)11 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)10 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)9 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)8 OpenShiftResource (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)7 Before (org.junit.Before)7 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)6 ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)4 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)4