Search in sources :

Example 1 with NewOpenShift3ApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard in project jbosstools-openshift by jbosstools.

the class CreateApplicationFromTemplateTest method createApplicationFromLocalWorkspaceTemplate.

@Test
public void createApplicationFromLocalWorkspaceTemplate() {
    new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer(DatastoreOS3.PROJECT1_DISPLAYED_NAME);
    new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
    new PushButton(OpenShiftLabel.Button.BROWSE_WORKSPACE).click();
    new DefaultShell(OpenShiftLabel.Shell.SELECT_OPENSHIFT_TEMPLATE);
    new DefaultTreeItem(TESTS_PROJECT, "eap64-basic-s2i.json").select();
    new OkButton().click();
    new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    assertTrue("Template from workspace is not correctly shown in text field containing its path", new LabeledText(OpenShiftLabel.TextLabels.SELECT_LOCAL_TEMPLATE).getText().equals("${workspace_loc:" + File.separator + TESTS_PROJECT + File.separator + "eap64-basic-s2i.json}"));
    new WaitUntil(new ControlIsEnabled(new CancelButton()));
    // TODO: Remove comment once JBIDE-24492 is resolved
    // assertTrue("Defined resource button should be enabled",
    // new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).isEnabled());
    completeApplicationCreationAndVerify(helloworldProject);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem) NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test) TemplateParametersTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.TemplateParametersTest)

Example 2 with NewOpenShift3ApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard in project jbosstools-openshift by jbosstools.

the class CreateApplicationOnBuilderImageTest method testCreateApplicationBasedOnBuilderImage.

@Test
public void testCreateApplicationBasedOnBuilderImage() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer();
    BuilderImageApplicationWizardHandlingTest.nextToBuildConfigurationWizardPage();
    applicationName = new LabeledText("Name: ").getText();
    new WaitUntil(new ControlIsEnabled(new FinishButton()));
    new FinishButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY));
    CreateApplicationFromTemplateTest.importApplicationAndVerify(projectName);
    OpenShiftProject project = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject();
    project.refresh();
    new WaitWhile(new JobIsRunning(), TimePeriod.getCustom(120));
    new WaitUntil(new OpenShiftResourceExists(Resource.BUILD_CONFIG, connectionReq.getConnection()), TimePeriod.LONG, false);
    List<OpenShiftResource> buildConfig = project.getOpenShiftResources(Resource.BUILD_CONFIG);
    assertTrue("There should be precisely 1 build config for created application, but there is following amount" + " of build configs: " + buildConfig.size(), buildConfig.size() == 1);
    List<OpenShiftResource> imageStream = project.getOpenShiftResources(Resource.IMAGE_STREAM);
    assertTrue("There should be precisely 1 image stream for created application, but there is following amount" + " of image streams: " + imageStream.size(), imageStream.size() == 1);
    List<OpenShiftResource> routes = project.getOpenShiftResources(Resource.ROUTE);
    assertTrue("There should be precisely 1 route for created application, but there is following amount" + " of routes:" + routes.size(), routes.size() == 1);
    assertTrue("Generated (default) route should contain application name, but it's not contained.", routes.get(0).getName().equals(applicationName));
    List<OpenShiftResource> services = project.getOpenShiftResources(Resource.SERVICE);
    assertTrue("There should be precisely 1 service for created application, but there is following amount" + " of services: " + services.size(), services.size() == 1);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OpenShiftProject(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test) BuilderImageApplicationWizardHandlingTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.BuilderImageApplicationWizardHandlingTest)

Example 3 with NewOpenShift3ApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard in project jbosstools-openshift by jbosstools.

the class CreateApplicationFromTemplateTest method testCreateApplicationFromServerTemplate.

@Test
public void testCreateApplicationFromServerTemplate() {
    new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer(DatastoreOS3.PROJECT1_DISPLAYED_NAME);
    OpenShiftUtils.selectEAPTemplate();
    completeApplicationCreationAndVerify(kitchensinkProject);
}
Also used : NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test) TemplateParametersTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.TemplateParametersTest)

Example 4 with NewOpenShift3ApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard in project jbosstools-openshift by jbosstools.

the class TemplateParametersTest method openTemplateParametersWizardPage.

@Before
public void openTemplateParametersWizardPage() {
    OpenShift3NativeProjectUtils.getOrCreateProject(DatastoreOS3.PROJECT1, DatastoreOS3.PROJECT1_DISPLAYED_NAME, StringUtils.EMPTY, connectionReq.getConnection());
    new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer();
    OpenShiftUtils.selectEAPTemplate();
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT);
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
}
Also used : NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) Before(org.junit.Before)

Example 5 with NewOpenShift3ApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard in project jbosstools-openshift by jbosstools.

the class LabelsTest method getToLabelsWizardPage.

@Before
public void getToLabelsWizardPage() {
    OpenShift3NativeProjectUtils.getOrCreateProject(DatastoreOS3.PROJECT1, DatastoreOS3.PROJECT1_DISPLAYED_NAME, StringUtils.EMPTY, connectionReq.getConnection());
    new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer();
    OpenShiftUtils.selectEAPTemplate();
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT);
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
    new NextButton().click();
    new WaitWhile(new ControlIsEnabled(new NextButton()), TimePeriod.LONG);
}
Also used : NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) Before(org.junit.Before)

Aggregations

NewOpenShift3ApplicationWizard (org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard)14 Test (org.junit.Test)10 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)7 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)4 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)4 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)4 TemplateParametersTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.TemplateParametersTest)4 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)3 DefaultTabItem (org.eclipse.reddeer.swt.impl.tab.DefaultTabItem)3 BuilderImageApplicationWizardHandlingTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.BuilderImageApplicationWizardHandlingTest)3 Before (org.junit.Before)3 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)2 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)2 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)2 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)2 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)2 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)2 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)2 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)2 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)1