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;
}
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);
}
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);
}
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());
}
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();
}
}
Aggregations