Search in sources :

Example 1 with ButtonWithTextIsAvailable

use of org.jboss.tools.openshift.reddeer.condition.ButtonWithTextIsAvailable 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)

Aggregations

WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)1 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)1 ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)1 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)1 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)1 TreeHasChildren (org.eclipse.reddeer.swt.condition.TreeHasChildren)1 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)1 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)1 ShellMenuItem (org.eclipse.reddeer.swt.impl.menu.ShellMenuItem)1 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)1 DefaultTree (org.eclipse.reddeer.swt.impl.tree.DefaultTree)1 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)1 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)1 ButtonWithTextIsAvailable (org.jboss.tools.openshift.reddeer.condition.ButtonWithTextIsAvailable)1 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)1 Test (org.junit.Test)1