Search in sources :

Example 21 with NextButton

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

the class CreateApplicationFromTemplateTest method completeWizardAndVerify.

private void completeWizardAndVerify() {
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT);
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
    String srcRepoRef = new DefaultTable().getItem(TemplateParametersTest.SOURCE_REPOSITORY_REF).getText(1);
    srcRepoURI = new DefaultTable().getItem(TemplateParametersTest.SOURCE_REPOSITORY_URL).getText(1);
    String contextDir = new DefaultTable().getItem(TemplateParametersTest.CONTEXT_DIR).getText(1);
    applicationName = new DefaultTable().getItem(TemplateParametersTest.APPLICATION_NAME).getText(1);
    new NextButton().click();
    new WaitWhile(new ControlIsEnabled(new NextButton()), TimePeriod.LONG);
    new FinishButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
    assertTrue(TemplateParametersTest.SOURCE_REPOSITORY_REF + " is not same as the one shown in " + "New OpenShift Application wizard.", new DefaultTable().getItem(TemplateParametersTest.SOURCE_REPOSITORY_REF).getText(1).equals(srcRepoRef));
    assertTrue(TemplateParametersTest.SOURCE_REPOSITORY_URL.split(" ")[0] + " is not same as the one shown in " + "New OpenShift Application wizard.", new DefaultTable().getItem(TemplateParametersTest.SOURCE_REPOSITORY_URL.split(" ")[0]).getText(1).equals(srcRepoURI));
    assertTrue(TemplateParametersTest.CONTEXT_DIR + " is not same as the one shown in New OpenShift" + " Application wizard.", new DefaultTable().getItem(TemplateParametersTest.CONTEXT_DIR).getText(1).equals(contextDir));
    assertTrue(TemplateParametersTest.APPLICATION_NAME.split(" ")[0] + " is not same as the one shown in " + "New OpenShift Application wizard.", new DefaultTable().getItem(TemplateParametersTest.APPLICATION_NAME.split(" ")[0]).getText(1).equals(applicationName));
    assertFalse(TemplateParametersTest.GENERIC_SECRET.split(" ")[0] + " should be generated and non-empty.", new DefaultTable().getItem(TemplateParametersTest.GENERIC_SECRET.split(" ")[0]).getText(1).isEmpty());
    assertFalse(TemplateParametersTest.GITHUB_SECRET.split(" ")[0] + " should be generated and non-empty.", new DefaultTable().getItem(TemplateParametersTest.GITHUB_SECRET.split(" ")[0]).getText(1).isEmpty());
    new DefaultLink("Click here to display the webhooks available to automatically trigger builds.").click();
    new DefaultShell(OpenShiftLabel.Shell.WEBHOOK_TRIGGERS);
    genericWebhookURL = new DefaultText(0).getText();
    githubWebhookURL = new DefaultText(1).getText();
    assertFalse("Generic webhook URL should not be empty.", genericWebhookURL.isEmpty());
    assertFalse("GitHub webhook URL should not be empty.", githubWebhookURL.isEmpty());
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.WEBHOOK_TRIGGERS));
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
    new OkButton().click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultLink(org.eclipse.reddeer.swt.impl.link.DefaultLink) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 22 with NextButton

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

the class CreateApplicationOnBuilderImageTest method validateJBIDE22704.

private void validateJBIDE22704() {
    BuilderImageApplicationWizardHandlingTest.nextToBuildConfigurationWizardPage();
    applicationName = new LabeledText("Name: ").getText();
    assertNotNull(applicationName);
    assertTrue(applicationName.length() > 0);
    String gitUrl = new LabeledText("Git Repository URL:").getText();
    assertNotNull(gitUrl);
    if (gitUrl.length() < 1) {
        new CancelButton().click();
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD));
        throw new OpenshiftTestInFailureException("JBIDE-23704 should be fixed now.");
    }
    new WaitUntil(new ControlIsEnabled(new NextButton()));
    /*
		 * switch to the Deployment page
		 */
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()));
    int numberofEnvironmentVariables = new DefaultTable().rowCount();
    assertTrue(numberofEnvironmentVariables > 0);
    /*
		 * switch to the Routing page
		 */
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()));
    int numberOfServicePorts = new DefaultTable().rowCount();
    assertTrue(numberOfServicePorts > 0);
    new CancelButton().click();
    new WaitWhile(new JobIsRunning(), TimePeriod.getCustom(120));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OpenshiftTestInFailureException(org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 23 with NextButton

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

the class TemplatesCreator method createOpenShiftApplicationBasedOnTemplate.

private void createOpenShiftApplicationBasedOnTemplate(boolean importProject, boolean serverTemplate, String templateName, final String templateLocalPath, List<Label> labels, TemplateParameter... parameters) {
    if (serverTemplate) {
        selectServerTemplate(templateName);
    } else {
        selectLocalTemplate(templateLocalPath);
    }
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT);
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
    if (parameters != null && parameters.length != 0) {
        setTemplateParameters(parameters);
    }
    new NextButton().click();
    new WaitWhile(new ControlIsEnabled(new NextButton()), TimePeriod.LONG);
    if (labels != null && labels.size() != 0) {
        createOpenShiftLabels(labels);
    }
    new FinishButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
    new OkButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    executeImport(importProject);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 24 with NextButton

use of org.eclipse.reddeer.swt.impl.button.NextButton 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 25 with NextButton

use of org.eclipse.reddeer.swt.impl.button.NextButton 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)

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