Search in sources :

Example 51 with FinishButton

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

the class CDKServerAdapterAbstractTest method addNewCDK3Server.

/**
 * Creates new CDK 3.x server adapter via ServersView -> New -> Server
 *
 * @param serverAdapter server adapter name
 * @param hypervisor hypervisor to use
 * @param path path to minishift binary file
 */
public static void addNewCDK3Server(String serverAdapter, String hypervisor, String path) {
    NewCDKServerWizard dialog = setupFirstNewServerWizardPage(CDK3_SERVER_NAME, serverAdapter);
    // set second new server dialog page
    NewCDK3ServerWizardPage containerPage = new NewCDK3ServerWizardPage();
    containerPage.setCredentials(USERNAME, PASSWORD);
    if (hypervisor != null && !hypervisor.isEmpty()) {
        // $NON-NLS-1$
        log.info("Setting hypervisor to " + hypervisor);
        containerPage.setHypervisor(hypervisor);
    }
    // $NON-NLS-1$
    log.info("Setting minishift binary file folder to " + path);
    containerPage.setMinishiftBinary(path);
    new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.DEFAULT);
    // $NON-NLS-1$
    log.info("Finishing Add new server dialog");
    if (!(new FinishButton().isEnabled())) {
        // $NON-NLS-1$
        log.error("Finish button was not enabled");
    }
    dialog.finish();
}
Also used : FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) NewCDK3ServerWizardPage(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK3ServerWizardPage) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 52 with FinishButton

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

the class CDKServerAdapterAbstractTest method addNewCDKServer.

/**
 * Creates new CDK 2.x server adapter via ServersView -> New -> Server
 *
 * @param serverAdapter server adapter name
 * @param path path to vagrantfile
 */
public static void addNewCDKServer(String serverAdapter, String path) {
    NewCDKServerWizard dialog = setupFirstNewServerWizardPage(CDK_SERVER_NAME, serverAdapter);
    // set second new server dialog page
    NewCDKServerWizardPage containerPage = new NewCDKServerWizardPage();
    containerPage.setCredentials(USERNAME, PASSWORD);
    // set cdk 2.x fields
    // $NON-NLS-1$
    log.info("Setting vagrant file folder");
    containerPage.setFolder(path);
    new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.MEDIUM);
    // $NON-NLS-1$
    log.info("Finishing Add new server dialog");
    if (!(new FinishButton().isEnabled())) {
        // $NON-NLS-1$
        log.error("Finish button was not enabled");
    }
    dialog.finish();
}
Also used : FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) NewCDKServerWizardPage(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizardPage) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 53 with FinishButton

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

the class BuilderImageApplicationWizardHandlingTest method validateGitRepoURL.

private void validateGitRepoURL(String url) {
    new LabeledText(OpenShiftLabel.TextLabels.GIT_REPO_URL).setText(url);
    assertFalse("Next button should be disabled if git repo URL is invalid", new NextButton().isEnabled());
    assertFalse("Finish button should be disabled if git repo URL is invalid", new FinishButton().isEnabled());
}
Also used : NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText)

Example 54 with FinishButton

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

the class BuilderImageApplicationWizardHandlingTest method selectBuilderImageAndAssertButtonsAvailability.

private void selectBuilderImageAndAssertButtonsAvailability() {
    new DefaultTreeItem(BUILDER_IMAGE).select();
    assertTrue("Next button should be enabled if EAP builder image is selected.", new NextButton().isEnabled());
    assertFalse("Finish button should be disabled on first wizard page for builder images.", new FinishButton().isEnabled());
}
Also used : NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)

Example 55 with FinishButton

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

the class BuilderImageApplicationWizardHandlingTest method setDefaultValuesAndAssert.

private void setDefaultValuesAndAssert(String defaultRepo, String defaultRef, String defaultContextDir) {
    new LabeledText(OpenShiftLabel.TextLabels.GIT_REPO_URL).setText(defaultRepo);
    new LabeledText(OpenShiftLabel.TextLabels.GIT_REF).setText(defaultRef);
    new LabeledText(OpenShiftLabel.TextLabels.CONTEXT_DIR).setText(defaultContextDir);
    assertTrue("Next button should be enabled after setting git values to default.", new NextButton().isEnabled());
    assertTrue("Finish button should be enabled after setting git values to default.", new FinishButton().isEnabled());
}
Also used : NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText)

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