Search in sources :

Example 1 with NextButton

use of org.eclipse.reddeer.swt.impl.button.NextButton in project jbosstools-hibernate by jbosstools.

the class ProjectConfigurationFactory method addFurtherJPAConfiguration.

private static void addFurtherJPAConfiguration(String jpaVersion, boolean addedJavaFacet) {
    DefaultHyperlink hyperlink = new DefaultHyperlink();
    hyperlink.activate();
    Shell s = new DefaultShell("Modify Faceted Project");
    if (addedJavaFacet) {
        new NextButton().click();
    }
    DefaultGroup group = new DefaultGroup("Platform");
    new DefaultCombo(group).setSelection("Hibernate (JPA " + jpaVersion + ")");
    new LabeledCombo("Type:").setSelection("Disable Library Configuration");
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(s));
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) Shell(org.eclipse.reddeer.swt.api.Shell) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) DefaultHyperlink(org.eclipse.reddeer.uiforms.impl.hyperlink.DefaultHyperlink) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultGroup(org.eclipse.reddeer.swt.impl.group.DefaultGroup)

Example 2 with NextButton

use of org.eclipse.reddeer.swt.impl.button.NextButton in project jbosstools-hibernate by jbosstools.

the class PersistenceXMLFileTest method prepare.

private void prepare() {
    importProject(prj, null);
    ProjectExplorer pe = new ProjectExplorer();
    pe.open();
    PropertyDialog pd = pe.getProject(prj).openProperties();
    FacetsPropertyPage fp = new FacetsPropertyPage(pd);
    pd.select(fp);
    List<TreeItem> facets = fp.getSelectedFacets();
    boolean javaFacet = false;
    boolean jpaFacet = false;
    for (TreeItem facet : facets) {
        if (facet.getText().equals("Java")) {
            javaFacet = true;
        } else if (facet.getText().equals("JPA")) {
            jpaFacet = true;
        }
    }
    if (!javaFacet) {
        fp.selectFacet("Java");
        new DefaultHyperlink(pd).activate();
        Shell s = new DefaultShell("Modify Faceted Project");
        new OkButton(s).click();
        new WaitWhile(new ShellIsAvailable(s));
    }
    if (!jpaFacet) {
        fp.selectFacet("JPA");
        new DefaultHyperlink(pd).activate();
        Shell s = new DefaultShell("Modify Faceted Project");
        new NextButton(s).click();
        JpaFacetInstallPage installPage = new JpaFacetInstallPage(s);
        installPage.setPlatform("Hibernate (JPA 2.1)");
        installPage.setJpaImplementation("Disable Library Configuration");
        new OkButton(s).click();
        new WaitWhile(new ShellIsAvailable(s));
    }
    pd.ok();
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultHyperlink(org.eclipse.reddeer.uiforms.impl.hyperlink.DefaultHyperlink) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertyDialog(org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) FacetsPropertyPage(org.eclipse.reddeer.eclipse.wst.common.project.facet.ui.FacetsPropertyPage) JpaFacetInstallPage(org.jboss.tools.hibernate.reddeer.wizard.JpaFacetInstallPage)

Example 3 with NextButton

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

the class ServerAdapterWizardHandlingTest method next.

private void next() {
    new NextButton().click();
    TestUtils.acceptSSLCertificate();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitUntil(new ControlIsEnabled(new BackButton()));
}
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) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 4 with NextButton

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

the class CDKServerWizardAbstractTest method assertServerType.

protected void assertServerType(final String serverType) {
    NewCDKServerWizard wizard = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
    try {
        TreeItem item = new DefaultTreeItem(new String[] { SERVER_TYPE_GROUP }).getItem(serverType);
        item.select();
        assertTrue(item.getText().equalsIgnoreCase(serverType));
        new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
    } catch (CoreLayerException coreExp) {
        log.error(coreExp.getMessage());
        fail("Server type " + serverType + " was not found in New Server Wizard");
    }
    assertEquals(new LabeledText("Server's host name:").getText(), "localhost");
    assertEquals(new LabeledText("Server name:").getText(), getServerAdapter());
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.MEDIUM, false);
    assertTrue("Dialog button Next is not enabled!", wizard.isNextEnabled());
    try {
        new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
        new CancelButton().click();
    } catch (WaitTimeoutExpiredException exc) {
        exc.printStackTrace();
        log.error("Dialog could not be canceled because there were unfinished jobs running after timeout" + "\n\rTrying to cancel dialog manually");
        new DefaultShell("New Server").close();
    }
}
Also used : NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 5 with NextButton

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

the class BuilderImageApplicationWizardHandlingTest method nextToBuildConfigurationWizardPage.

/**
 ************
 *	  NAVIGATATION
 **************
 */
public static void nextToBuildConfigurationWizardPage() {
    // List<TreeItem> templates = new DefaultTree().getAllItems();
    // for (TreeItem item : templates) {
    // if (item.getText().contains(BUILDER_IMAGE)) {
    // item.select();
    // break;
    // }
    // }
    new DefaultTreeItem(BUILDER_IMAGE).select();
    new WaitUntil(new ControlIsEnabled(new NextButton()));
    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) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)28 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)17 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)16 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)14 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)14 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)13 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)11 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)10 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)9 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)9 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)6 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)6 Test (org.junit.Test)5 DefaultCombo (org.eclipse.reddeer.swt.impl.combo.DefaultCombo)4 WorkbenchShell (org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell)4 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)3 LabeledCombo (org.eclipse.reddeer.swt.impl.combo.LabeledCombo)3 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)2 ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)2 Shell (org.eclipse.reddeer.swt.api.Shell)2