Search in sources :

Example 21 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class CreateApplicationFromTemplateTest method importApplicationAndVerify.

public static void importApplicationAndVerify(String projectName) {
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
    try {
        new CheckBox(new WithTextMatcher(new StringStartsWith("Do not clone"))).toggle(true);
    } catch (CoreLayerException ex) {
    // git directory is not in use
    } catch (WaitTimeoutExpiredException ex) {
    // swallow, checkbox is disabled
    }
    new FinishButton().click();
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    OpenShiftUtils.handleCheatSheetCreateServerAdapter();
    new WaitUntil(new ProjectExists(projectName, new ProjectExplorer()), TimePeriod.LONG, false);
    assertTrue("Project Explorer should contain imported project " + projectName, projectExplorer.containsProject(projectName));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) StringStartsWith(org.hamcrest.core.StringStartsWith) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ProjectExists(org.eclipse.reddeer.eclipse.condition.ProjectExists) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 22 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class EditResourcesTest method tearDown.

public static void tearDown() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.reopen();
    OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
    connection.getProject().delete();
    try {
        new WaitWhile(new OpenShiftProjectExists(connectionReq.getConnection()));
    } catch (WaitTimeoutExpiredException ex) {
        connection.refresh();
        new WaitWhile(new OpenShiftProjectExists(connectionReq.getConnection()), TimePeriod.getCustom(5));
    }
    connection.createNewProject();
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    if (projectExplorer.containsProject(PROJECT_NAME)) {
        projectExplorer.getProject(PROJECT_NAME).delete(true);
    }
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) OpenShiftProjectExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftProjectExists) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShift3Connection(org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)

Example 23 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class ImportApplicationTest method testImportOpenShiftApplicationViaOpenShiftExplorer.

@Test
public void testImportOpenShiftApplicationViaOpenShiftExplorer() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    new WaitUntil(new OpenShiftResourceExists(Resource.BUILD_CONFIG, (Matcher<String>) null, ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.LONG);
    explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getOpenShiftResources(Resource.BUILD_CONFIG).get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
    new CheckBox("Use default clone destination").toggle(false);
    File gitRepo = new File(GIT_REPO_DIRECTORY);
    new LabeledText("Git Clone Location:").setText(gitRepo.getAbsolutePath());
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION), TimePeriod.VERY_LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    assertTrue("There should be imported kitchen sink project, but there is not", projectExplorer.containsProject(PROJECT_NAME));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) Matcher(org.hamcrest.Matcher) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) File(java.io.File) 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 ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class ImportApplicationTest method testImportOpenShiftApplicationViaShellMenu.

@Test
public void testImportOpenShiftApplicationViaShellMenu() {
    new ShellMenuItem("File", "Import...").select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.IMPORT);
    new DefaultTreeItem("OpenShift", "Existing OpenShift Application").select();
    new NextButton().click();
    new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
    TestUtils.acceptSSLCertificate();
    new NextButton().click();
    TestUtils.acceptSSLCertificate();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitUntil(new ButtonWithTextIsAvailable("Refresh"), TimePeriod.VERY_LONG);
    new WaitUntil(new TreeHasChildren(new DefaultTree()), TimePeriod.DEFAULT);
    new DefaultTreeItem(projectReq.getProjectName() + " " + projectReq.getProjectName()).getItems().get(0).select();
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT);
    new NextButton().click();
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION), TimePeriod.VERY_LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    assertTrue("There should be imported " + PROJECT_NAME + "project, but there is not", projectExplorer.containsProject(PROJECT_NAME));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) TreeHasChildren(org.eclipse.reddeer.swt.condition.TreeHasChildren) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) ShellMenuItem(org.eclipse.reddeer.swt.impl.menu.ShellMenuItem) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) ButtonWithTextIsAvailable(org.jboss.tools.openshift.reddeer.condition.ButtonWithTextIsAvailable) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 25 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class ImportApplicationTest method cleanGitFolder.

@Before
public void cleanGitFolder() {
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    if (projectExplorer.containsProject(PROJECT_NAME)) {
        projectExplorer.getProject(PROJECT_NAME).delete(true);
    }
    try {
        TestUtils.delete(new File(GIT_REPO_DIRECTORY));
    } catch (IOException e) {
        throw new RuntimeException("Deletion of git repo was unsuccessfull.", e);
    }
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) IOException(java.io.IOException) File(java.io.File) Before(org.junit.Before)

Aggregations

ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)41 Test (org.junit.Test)12 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)10 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)8 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)8 File (java.io.File)6 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)6 PropertyDialog (org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog)5 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)5 IOException (java.io.IOException)4 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)4 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)4 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)4 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)3 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)3 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)3 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)3 TextEditor (org.eclipse.reddeer.workbench.impl.editor.TextEditor)3 AfterClass (org.junit.AfterClass)3 Before (org.junit.Before)3