Search in sources :

Example 1 with DefaultLink

use of org.eclipse.reddeer.swt.impl.link.DefaultLink in project jbosstools-hibernate by jbosstools.

the class NewConfigurationWizardPage method getValuesFromConnection.

public SelectConnectionProfileDialog getValuesFromConnection() {
    Link link = new DefaultLink(referencedComposite, "Get values from Connection");
    link.click();
    return new SelectConnectionProfileDialog();
}
Also used : DefaultLink(org.eclipse.reddeer.swt.impl.link.DefaultLink) DefaultLink(org.eclipse.reddeer.swt.impl.link.DefaultLink) Link(org.eclipse.reddeer.swt.api.Link)

Example 2 with DefaultLink

use of org.eclipse.reddeer.swt.impl.link.DefaultLink in project jbosstools-openshift by jbosstools.

the class OpenNewConnectionWizardTest method shouldOpenConnectionWizardViaLinkTest.

@Test
public void shouldOpenConnectionWizardViaLinkTest() {
    // given
    ConnectionUtils.clearAll();
    explorer.open();
    // when
    new DefaultLink(OpenShiftLabel.TextLabels.CREATE_CONNECTION).click();
    // then
    verifyNewConnectionWizardIsOpened();
}
Also used : DefaultLink(org.eclipse.reddeer.swt.impl.link.DefaultLink) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 3 with DefaultLink

use of org.eclipse.reddeer.swt.impl.link.DefaultLink 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 4 with DefaultLink

use of org.eclipse.reddeer.swt.impl.link.DefaultLink in project jbosstools-hibernate by jbosstools.

the class ProjectConfigurationFactory method convertProjectToFacetsForm.

/**
 * Convert project to facet form
 * @param prj given project name
 */
public static void convertProjectToFacetsForm(String prj) {
    ProjectExplorer pe = new ProjectExplorer();
    pe.open();
    PropertyDialog pd = pe.getProject(prj).openProperties();
    pd.select("Project Facets");
    // convert to faceted form
    new DefaultTreeItem("Project Facets").select();
    new DefaultLink("Convert to faceted form...").click();
    new WaitWhile(new JobIsRunning());
    new WaitUntil(new WidgetIsFound(Button.class, new WithStyleMatcher(SWT.PUSH), new WithMnemonicTextMatcher("Apply")), TimePeriod.LONG);
    PushButton apply = new PushButton("Apply");
    new WaitUntil(new ControlIsEnabled(apply));
    apply.click();
    pd.ok();
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) WithStyleMatcher(org.eclipse.reddeer.core.matcher.WithStyleMatcher) DefaultLink(org.eclipse.reddeer.swt.impl.link.DefaultLink) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertyDialog(org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog) WithMnemonicTextMatcher(org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher) WidgetIsFound(org.eclipse.reddeer.core.condition.WidgetIsFound) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) Button(org.eclipse.swt.widgets.Button) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Aggregations

DefaultLink (org.eclipse.reddeer.swt.impl.link.DefaultLink)4 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)2 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)2 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)2 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)2 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)2 WidgetIsFound (org.eclipse.reddeer.core.condition.WidgetIsFound)1 WithMnemonicTextMatcher (org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher)1 WithStyleMatcher (org.eclipse.reddeer.core.matcher.WithStyleMatcher)1 PropertyDialog (org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog)1 ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)1 Link (org.eclipse.reddeer.swt.api.Link)1 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)1 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)1 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)1 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)1 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)1 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)1 DefaultText (org.eclipse.reddeer.swt.impl.text.DefaultText)1 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)1