Search in sources :

Example 11 with NextButton

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

the class BuilderImageApplicationWizardHandlingTest method next.

private static void next() {
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()));
}
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) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 12 with NextButton

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

the class BuilderImageApplicationWizardHandlingTest method validateValidResourceName.

private void validateValidResourceName(String name) {
    new LabeledText(OpenShiftLabel.TextLabels.BUILDER_RESOURCE_NAME).setText(name);
    assertTrue("Next button should be enabled if resource name is valid '" + name + "'", new NextButton().isEnabled());
    assertTrue("Finish button should be enabled if resource name is valid '" + name + "'", 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 13 with NextButton

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

the class DeployDockerImageTest method proceedThroughDeployImageToOpenShiftWizard.

/**
 * Proceeds through the image if the first wizard page has correct details -
 * connection, project and image name.
 */
private void proceedThroughDeployImageToOpenShiftWizard() {
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT, false);
    assertTrue("Next button should be enabled if all details are set correctly", new NextButton().isEnabled());
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
    new NextButton().click();
    if (!new CheckBox("Add Route").isChecked()) {
        new CheckBox("Add Route").click();
    }
    new FinishButton().click();
    new ShellWithButton("Deploy Image to OpenShift", "OK");
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable("Deploy Image to OpenShift"), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) ShellWithButton(org.jboss.tools.openshift.reddeer.widget.ShellWithButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 14 with NextButton

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

the class BuilderImageApplicationWizardHandlingTest method testGitFieldsValidationOnBuildConfigurationWizardPage.

@Test
public void testGitFieldsValidationOnBuildConfigurationWizardPage() {
    nextToBuildConfigurationWizardPage();
    LabeledText gitRepo = new LabeledText(OpenShiftLabel.TextLabels.GIT_REPO_URL);
    LabeledText gitReference = new LabeledText(OpenShiftLabel.TextLabels.GIT_REF);
    LabeledText contextDirectory = new LabeledText(OpenShiftLabel.TextLabels.CONTEXT_DIR);
    String defaultRepo = gitRepo.getText();
    String defaultRef = gitReference.getText();
    String defaultContextDir = contextDirectory.getText();
    validateGitRepoURL("invalid");
    validateGitRepoURL("");
    setDefaultValuesAndAssert(defaultRepo, defaultRef, defaultContextDir);
    gitReference.setText("");
    contextDirectory.setText("");
    assertTrue("Next button should be enabled if ref and context dir are empty.", new NextButton().isEnabled());
    assertTrue("Finish button should be enabled if ref and context dir are empty.", new FinishButton().isEnabled());
    setDefaultValuesAndAssert(defaultRepo, defaultRef, defaultContextDir);
    validateGitReference("invalid reference");
    validateGitReference("invalidad*reference");
    validateGitReference("invalid:reference");
    validateGitReference("@");
    validateGitReference("invalid\reference");
    setDefaultValuesAndAssert(defaultRepo, defaultRef, defaultContextDir);
}
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) Test(org.junit.Test)

Example 15 with NextButton

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

the class BuilderImageApplicationWizardHandlingTest method validateGitReference.

private void validateGitReference(String ref) {
    new LabeledText(OpenShiftLabel.TextLabels.GIT_REF).setText(ref);
    assertFalse("Next button should be disabled if git reference is invalid", new NextButton().isEnabled());
    assertFalse("Finish button should be disabled if git reference 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)

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