use of org.eclipse.reddeer.swt.condition.ShellIsActive 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.condition.ShellIsActive in project linuxtools by eclipse.
the class RunDockerImageLaunchConfiguration method searchImage.
public void searchImage(String imageName, String tag) {
selectTab(MAIN_TAB_LABEL);
new PushButton("Search...");
ImageSearchPage pageOne = new ImageSearchPage(new DefaultCTabItem(MAIN_TAB_LABEL));
pageOne.searchImage(imageName);
pageOne.next();
new WaitWhile(new ShellIsActive("Progress Information"), TimePeriod.DEFAULT);
ImageTagSelectionPage pageTwo = new ImageTagSelectionPage(pageOne);
assertFalse("Search tags are empty!", pageTwo.getTags().isEmpty());
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
assertTrue("Search results do not contains tag:" + tag + "!", pageTwo.tagsContains(tag));
pageTwo.selectTag(tag);
pageTwo.finish();
new DefaultShell("Pull Image");
new PushButton("Finish").click();
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Aggregations