Search in sources :

Example 21 with PushButton

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

the class AuthenticationTokenRetrival method retrieveToken.

/**
 * Represents action of clicking on retrieve new token link, wait for browser to
 * appear, log in and obtain new token.
 *
 * @return token string
 */
public String retrieveToken() {
    EmulatedLinkStyledText linkText = new EmulatedLinkStyledText(OpenShiftLabel.TextLabels.RETRIEVE_TOKEN);
    linkText.click(linkText.getPositionOfText(OpenShiftLabel.TextLabels.LINK_RETRIEVE) + 3);
    new WaitUntil(new ShellIsActive(new WithTextMatcher("Unnamed")), TimePeriod.MEDIUM, false);
    DefaultShell browser = new DefaultShell();
    InternalBrowser internalBrowser = new InternalBrowser(browser);
    login(internalBrowser);
    new WaitUntil(new LoginPageIsLoaded(() -> internalBrowser.getText().contains(PAGETITLE_API_TOKEN)));
    String token = getTokenFromBrowser(internalBrowser);
    // close browser shell
    new PushButton(OpenShiftLabel.Button.CLOSE).click();
    return token;
}
Also used : ShellIsActive(org.eclipse.reddeer.swt.condition.ShellIsActive) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) InternalBrowser(org.eclipse.reddeer.swt.impl.browser.InternalBrowser) LoginPageIsLoaded(org.jboss.tools.openshift.reddeer.condition.LoginPageIsLoaded) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 22 with PushButton

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

the class DebuggingEAPAppTest method rebuildProject.

private static void rebuildProject() {
    PackageExplorerPart pexplorer = new PackageExplorerPart();
    pexplorer.open();
    pexplorer.getProject(PROJECT_NAME).select();
    new ContextMenuItem("Maven", "Update Project...").select();
    new WaitUntil(new ShellIsAvailable("Update Maven Project"), TimePeriod.LONG);
    new CheckBox("Force Update of Snapshots/Releases").toggle(true);
    new PushButton("OK").click();
    new WaitWhile(new ShellIsAvailable("Update Maven Project"), TimePeriod.DEFAULT);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 23 with PushButton

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

the class CreateApplicationFromTemplateTest method createApplicationFromLocalWorkspaceTemplate.

@Test
public void createApplicationFromLocalWorkspaceTemplate() {
    new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer(DatastoreOS3.PROJECT1_DISPLAYED_NAME);
    new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
    new PushButton(OpenShiftLabel.Button.BROWSE_WORKSPACE).click();
    new DefaultShell(OpenShiftLabel.Shell.SELECT_OPENSHIFT_TEMPLATE);
    new DefaultTreeItem(TESTS_PROJECT, "eap64-basic-s2i.json").select();
    new OkButton().click();
    new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    assertTrue("Template from workspace is not correctly shown in text field containing its path", new LabeledText(OpenShiftLabel.TextLabels.SELECT_LOCAL_TEMPLATE).getText().equals("${workspace_loc:" + File.separator + TESTS_PROJECT + File.separator + "eap64-basic-s2i.json}"));
    new WaitUntil(new ControlIsEnabled(new CancelButton()));
    // TODO: Remove comment once JBIDE-24492 is resolved
    // assertTrue("Defined resource button should be enabled",
    // new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).isEnabled());
    completeApplicationCreationAndVerify(helloworldProject);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem) NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test) TemplateParametersTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.TemplateParametersTest)

Example 24 with PushButton

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

the class DebuggingEAPAppTest method cleanAndBuildWorkspace.

private static void cleanAndBuildWorkspace() {
    new ShellMenuItem("Project", "Clean...").select();
    new DefaultShell("Clean");
    new PushButton("Clean").click();
    new WaitWhile(new JobIsRunning());
}
Also used : ShellMenuItem(org.eclipse.reddeer.swt.impl.menu.ShellMenuItem) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 25 with PushButton

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

the class CDKLaunchConfigurationDialog method apply.

public void apply() {
    logger.info("Pressing apply button...");
    Button apply = new PushButton(this, new WithTextMatcher("Apply"));
    if (apply.isEnabled()) {
        apply.click();
    }
}
Also used : PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) Button(org.eclipse.reddeer.swt.api.Button) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Aggregations

PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)94 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)49 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)43 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)41 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)38 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)38 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)34 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)28 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)20 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)17 Test (org.junit.Test)16 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)15 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)9 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)8 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)7 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)6 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)6 Button (org.eclipse.reddeer.swt.api.Button)6 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)6 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6