use of org.eclipse.reddeer.core.matcher.WithTextMatcher 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.core.matcher.WithTextMatcher in project jbosstools-openshift by jbosstools.
the class NodeJSAppDebugTest method getVariable.
/**
* getVariable from Variables view.
*
* @param variable
* name
* @return TreeItem
*/
protected TreeItem getVariable(String name) {
WorkbenchView variables = new WorkbenchView("Variables");
variables.activate();
DefaultTree variablesTree = new DefaultTree();
TreeItem var = null;
try {
new WaitUntil(new TreeContainsItem(variablesTree, new WithTextMatcher(name), false));
} catch (WaitTimeoutExpiredException e) {
// not found
return null;
}
List<TreeItem> vars = variablesTree.getItems();
for (TreeItem i : vars) {
if (i.getText().equals(name)) {
var = i;
}
}
return var;
}
use of org.eclipse.reddeer.core.matcher.WithTextMatcher 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();
}
}
use of org.eclipse.reddeer.core.matcher.WithTextMatcher in project jbosstools-openshift by jbosstools.
the class CDKLaunchConfigurationDialog method revert.
public void revert() {
logger.info("Pressing revert button...");
Button revert = new PushButton(this, new WithTextMatcher("Revert"));
if (revert.isEnabled()) {
revert.click();
}
}
use of org.eclipse.reddeer.core.matcher.WithTextMatcher in project jbosstools-openshift by jbosstools.
the class CreateApplicationFromTemplateTest method importApplicationAndVerify.
public static void importApplicationAndVerify(String projectName) {
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
try {
new CheckBox(new WithTextMatcher(new StringStartsWith("Do not clone"))).toggle(true);
} catch (CoreLayerException ex) {
// git directory is not in use
} catch (WaitTimeoutExpiredException ex) {
// swallow, checkbox is disabled
}
new FinishButton().click();
ProjectExplorer projectExplorer = new ProjectExplorer();
projectExplorer.open();
OpenShiftUtils.handleCheatSheetCreateServerAdapter();
new WaitUntil(new ProjectExists(projectName, new ProjectExplorer()), TimePeriod.LONG, false);
assertTrue("Project Explorer should contain imported project " + projectName, projectExplorer.containsProject(projectName));
}
Aggregations