Search in sources :

Example 41 with FinishButton

use of org.eclipse.reddeer.swt.impl.button.FinishButton in project jbosstools-openshift by jbosstools.

the class MinishiftServerWizardTest method testNewMinishiftServerWizard.

@Test
public void testNewMinishiftServerWizard() {
    NewCDKServerWizard dialog = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
    NewServerWizardPage page = new NewServerWizardPage(dialog);
    page.selectType(SERVER_TYPE_GROUP, MINISHIFT_SERVER_NAME);
    page.setName(getServerAdapter());
    dialog.next();
    NewMinishiftServerWizardPage containerPage = new NewMinishiftServerWizardPage();
    checkWizardPagewidget("Minishift Binary: ", MINISHIFT_SERVER_NAME);
    assertTrue(containerPage.getMinishiftProfile().getText().contains("minishift"));
    // checking of minishift binary validation
    // test that existing folder cannot be run
    containerPage.setMinishiftBinary(EXISTING_PATH);
    assertSameMessage(dialog, CANNOT_RUN_PROGRAM);
    containerPage.setMinishiftBinary(NON_EXECUTABLE_FILE);
    assertSameMessage(dialog, NOT_EXECUTABLE);
    containerPage.setMinishiftBinary(NON_EXISTING_PATH);
    assertSameMessage(dialog, DOES_NOT_EXIST);
    containerPage.setMinishiftBinary(EXECUTABLE_FILE);
    assertSameMessage(dialog, CHECK_MINISHIFT_VERSION);
    // check compatibility of cdk version with server adapter
    containerPage.setMinishiftBinary(MOCK_CDK311);
    assertSameMessage(dialog, NOT_COMPATIBLE);
    // check compatibility of cdk version with server adapter
    containerPage.setMinishiftBinary(MOCK_CDK320);
    assertSameMessage(dialog, NOT_COMPATIBLE);
    // check compatibility of cdk version with server adapter
    containerPage.setMinishiftBinary(MOCK_MINISHIFT131);
    assertSameMessage(dialog, NOT_COMPATIBLE);
    // Positive test of proper minishift binary
    containerPage.setMinishiftBinary(MINISHIFT_PATH);
    assertDiffMessage(dialog, CHECK_MINISHIFT_VERSION);
    new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.MEDIUM, false);
    assertTrue("Expected Finish button is not enabled", dialog.isFinishEnabled());
    dialog.cancel();
}
Also used : NewMinishiftServerWizardPage(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewMinishiftServerWizardPage) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) NewServerWizardPage(org.eclipse.reddeer.eclipse.wst.server.ui.wizard.NewServerWizardPage) Test(org.junit.Test)

Example 42 with FinishButton

use of org.eclipse.reddeer.swt.impl.button.FinishButton in project jbosstools-openshift by jbosstools.

the class CreateServerAdapterTest method testCreateOpenShift3ServerAdapterViaOpenShiftExplorerView.

@Test
public void testCreateOpenShift3ServerAdapterViaOpenShiftExplorerView() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.getOpenShift3Connection(connectionReq.getConnection()).refresh();
    explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getServicesWithName("eap-app").get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
    new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
    assertTrue("Service should be preselected for new OpenShift 3 server adapter", new DefaultTreeItem(projectReq.getProjectName(), "eap-app deploymentConfig=eap-app").isSelected());
    assertTrue("Eclipse project should be preselected automatically for new server adapter", new LabeledText("Eclipse Project: ").getText().equals(PROJECT_NAME));
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(""));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false);
    assertTrue("OpenShift 3 server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, "eap-app", "Service").test());
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) 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) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ServerAdapterExists(org.jboss.tools.openshift.reddeer.condition.ServerAdapterExists) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 43 with FinishButton

use of org.eclipse.reddeer.swt.impl.button.FinishButton in project jbosstools-openshift by jbosstools.

the class CDKServerEditorAbstractTest method addCDKServer.

public void addCDKServer() {
    NewCDKServerWizard dialog = CDKTestUtils.openNewServerWizardDialog();
    try {
        setupServerWizardPage(dialog);
        new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.MEDIUM, false);
        dialog.finish(TimePeriod.MEDIUM);
    } catch (RedDeerException coreExc) {
        new CancelButton().click();
        throw new CDKServerException("Exception occured in CDK server wizard, wizard was canceled", coreExc);
    }
}
Also used : RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) CDKServerException(org.jboss.tools.cdk.reddeer.server.exception.CDKServerException) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 44 with FinishButton

use of org.eclipse.reddeer.swt.impl.button.FinishButton in project jbosstools-openshift by jbosstools.

the class CDK32ServerWizardTest method testNewCDK32ServerWizard.

@Test
public void testNewCDK32ServerWizard() {
    NewCDKServerWizard dialog = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
    NewServerWizardPage page = new NewServerWizardPage(dialog);
    page.selectType(SERVER_TYPE_GROUP, CDK32_SERVER_NAME);
    page.setName(getServerAdapter());
    dialog.next();
    NewCDK32ServerWizardPage containerPage = new NewCDK32ServerWizardPage();
    checkWizardPagewidget("Minishift Binary: ", CDK32_SERVER_NAME);
    // just check that default domain is choosen correctly
    assertTrue(containerPage.getDomain().equalsIgnoreCase(CREDENTIALS_DOMAIN));
    assertTrue(containerPage.getMinishiftProfile().getText().equals("minishift"));
    // needs to activate validator
    containerPage.setMinishiftBinary(EXISTING_PATH);
    // first the credentials are checked
    assertSameMessage(dialog, NO_USER);
    containerPage.setCredentials(USERNAME, PASSWORD);
    assertDiffMessage(dialog, NO_USER);
    // checking of minishift binary validation
    // test that existing folder cannot be run
    containerPage.setMinishiftBinary(EXISTING_PATH);
    assertSameMessage(dialog, CANNOT_RUN_PROGRAM);
    containerPage.setMinishiftBinary(NON_EXECUTABLE_FILE);
    assertSameMessage(dialog, NOT_EXECUTABLE);
    containerPage.setMinishiftBinary(NON_EXISTING_PATH);
    assertSameMessage(dialog, DOES_NOT_EXIST);
    containerPage.setMinishiftBinary(EXECUTABLE_FILE);
    assertSameMessage(dialog, CHECK_MINISHIFT_VERSION);
    // check compatibility of cdk version with server adapter
    containerPage.setMinishiftBinary(MOCK_CDK311);
    assertSameMessage(dialog, NOT_COMPATIBLE);
    // Positive test of proper minishift binary
    containerPage.setMinishiftBinary(CDK32_MINISHIFT);
    assertDiffMessage(dialog, CHECK_MINISHIFT_VERSION);
    new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.MEDIUM, false);
    assertTrue("Expected Finish button is not enabled", dialog.isFinishEnabled());
    dialog.cancel();
}
Also used : NewCDK32ServerWizardPage(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK32ServerWizardPage) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) NewServerWizardPage(org.eclipse.reddeer.eclipse.wst.server.ui.wizard.NewServerWizardPage) Test(org.junit.Test)

Example 45 with FinishButton

use of org.eclipse.reddeer.swt.impl.button.FinishButton in project jbosstools-openshift by jbosstools.

the class CreateApplicationFromTemplateTest method importTestsProject.

@BeforeClass
public static void importTestsProject() {
    new ExternalProjectImportWizardDialog().open();
    new DefaultCombo().setText(TESTS_PROJECT_LOCATION);
    new PushButton("Refresh").click();
    new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.LONG);
    new FinishButton().click();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitUntil(new ProjectExists(TESTS_PROJECT), TimePeriod.LONG);
}
Also used : DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ProjectExists(org.eclipse.reddeer.eclipse.condition.ProjectExists) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ExternalProjectImportWizardDialog(org.eclipse.reddeer.eclipse.ui.wizards.datatransfer.ExternalProjectImportWizardDialog) BeforeClass(org.junit.BeforeClass)

Aggregations

FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)59 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)36 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)32 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)31 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)30 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)28 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)24 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)23 Test (org.junit.Test)14 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)13 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)11 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)9 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)8 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)8 NewCDKServerWizard (org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard)8 DefaultCombo (org.eclipse.reddeer.swt.impl.combo.DefaultCombo)7 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)6 LabeledCombo (org.eclipse.reddeer.swt.impl.combo.LabeledCombo)6 ContextMenu (org.eclipse.reddeer.swt.impl.menu.ContextMenu)6 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)6