Search in sources :

Example 1 with ShellIsActive

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;
}
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 2 with ShellIsActive

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);
}
Also used : ImageSearchPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageSearchPage) ShellIsActive(org.eclipse.reddeer.swt.condition.ShellIsActive) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ImageTagSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageTagSelectionPage) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) DefaultCTabItem(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabItem)

Aggregations

ShellIsActive (org.eclipse.reddeer.swt.condition.ShellIsActive)2 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)2 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)2 ImageSearchPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageSearchPage)1 ImageTagSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageTagSelectionPage)1 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)1 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)1 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)1 InternalBrowser (org.eclipse.reddeer.swt.impl.browser.InternalBrowser)1 DefaultCTabItem (org.eclipse.reddeer.swt.impl.ctab.DefaultCTabItem)1 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)1 LoginPageIsLoaded (org.jboss.tools.openshift.reddeer.condition.LoginPageIsLoaded)1