Search in sources :

Example 1 with ImportApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard in project jbosstools-openshift by jbosstools.

the class ImportApplicationWizardTest method testImportOpenShift3AppViaOpenshiftView.

@Test
public void testImportOpenShift3AppViaOpenshiftView() {
    ImportApplicationWizard importWizard = OpenShiftUtils.openImportApplicationWizardFromOpenshiftView(project);
    importWizard.finish();
    assertProjectExistsInProjectView(OpenShiftResources.NODEJS_GIT_NAME);
}
Also used : ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) Test(org.junit.Test)

Example 2 with ImportApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard in project jbosstools-openshift by jbosstools.

the class ImportApplicationWizardTest method testImportOpenShift3AppWizardGitAPI.

@Test
public void testImportOpenShift3AppWizardGitAPI() {
    ImportApplicationWizard importWizard = OpenShiftUtils.openImportApplicationWizardFromOpenshiftView(project);
    String gitUrl = getGitUrlFromWizard();
    importWizard.cancel();
    assertTrue("Git URL error. Retrieved git URL: '" + gitUrl + "'", gitUrl != null && gitUrl.startsWith("https://github.com"));
}
Also used : ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) Test(org.junit.Test)

Example 3 with ImportApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard in project jbosstools-openshift by jbosstools.

the class OpenShiftUtils method openImportApplicationWizardFromOpenshiftView.

public static ImportApplicationWizard openImportApplicationWizardFromOpenshiftView(OpenShiftProject openshiftProject) {
    openshiftProject.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    return new ImportApplicationWizard();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 4 with ImportApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard in project jbosstools-openshift by jbosstools.

the class ImportApplicationWizardGitTest method testNotGitRepo.

@Test
public void testNotGitRepo() {
    assertTrue("Failed to create test project non git folder!", projectFolder.mkdir());
    service.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    ImportApplicationWizard importWizard = new ImportApplicationWizard();
    assertProjectExistsErrorInWizard(importWizard);
    CheckBox useExistingRepositoryCheckBox = new CheckBox(new DefaultGroup("Clone destination"), "Do not clone - use existing repository");
    assertFalse("Empty non git folder should not be able to choose!", useExistingRepositoryCheckBox.isEnabled());
    importWizard.cancel();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) DefaultGroup(org.eclipse.reddeer.swt.impl.group.DefaultGroup) ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) Test(org.junit.Test)

Example 5 with ImportApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard in project jbosstools-openshift by jbosstools.

the class ImportApplicationWizardGitTest method testNotExistingBranch.

@Test(expected = OpenshiftTestInFailureException.class)
public void testNotExistingBranch() {
    Git repo = createRepo();
    setRemote(repo, getOriginURL());
    performCommit(repo);
    renameMaster(repo);
    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);
    try {
        assertGitRemoteErrorInWizzard(importWizard);
    } catch (AssertionError err) {
        importWizard.cancel();
        throw new OpenshiftTestInFailureException("https://issues.jboss.org/browse/JBIDE-24646", err);
    }
    importWizard.cancel();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OpenshiftTestInFailureException(org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException) Git(org.eclipse.jgit.api.Git) 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)

Aggregations

ImportApplicationWizard (org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard)11 Test (org.junit.Test)8 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)7 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)7 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)6 GitCloningWizardPage (org.jboss.tools.openshift.reddeer.wizard.importapp.GitCloningWizardPage)4 Git (org.eclipse.jgit.api.Git)2 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)2 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)2 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)1 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 TreeItemRegexMatcher (org.eclipse.reddeer.core.matcher.TreeItemRegexMatcher)1 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)1 DefaultGroup (org.eclipse.reddeer.swt.impl.group.DefaultGroup)1 DefaultTree (org.eclipse.reddeer.swt.impl.tree.DefaultTree)1 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)1 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)1 ServerSettingsWizard (org.jboss.tools.openshift.reddeer.wizard.server.ServerSettingsWizard)1 ServerSettingsWizardPage (org.jboss.tools.openshift.reddeer.wizard.server.ServerSettingsWizardPage)1 OpenshiftTestInFailureException (org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException)1