use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class ConnectionWizardHandlingTest method testLinkToRetrieveToken.
@Test
@Ignore("Link has been changed to Styled text. Test need to be corrected")
public void testLinkToRetrieveToken() {
new LabeledCombo(OpenShiftLabel.TextLabels.SERVER_TYPE).setSelection(OpenShiftLabel.Others.OPENSHIFT3);
new LabeledCombo(OpenShiftLabel.TextLabels.PROTOCOL).setSelection(AuthenticationMethod.OAUTH.toString());
try {
new DefaultStyledText("Enter a token or retrieve a new one.");
// pass
} catch (RedDeerException ex) {
fail("Link to retrieve token for a connection is not available.");
}
new LabeledCombo(OpenShiftLabel.TextLabels.SERVER).setText("https://nonexisting.server.com");
WidgetHandler.getInstance().sendClickNotifications(new DefaultStyledText("Enter a token or retrieve a new one.").getSWTWidget());
// There can be problem occured dialog, or it is only in log
try {
new DefaultShell("Problem Occurred");
new OkButton().click();
new WaitWhile(new ShellIsAvailable("Problem Occurred"));
new DefaultShell("");
// pass
} catch (RedDeerException ex) {
// pass
}
try {
new InternalBrowser();
fail("Browser with token should not opened for nonexisting server.");
} catch (RedDeerException ex) {
// pass
}
new LabeledCombo(OpenShiftLabel.TextLabels.SERVER).setText(DatastoreOS3.SERVER);
WidgetHandler.getInstance().sendClickNotifications(new DefaultStyledText("Enter a token or retrieve a new one.").getSWTWidget());
try {
new ShellWithButton("", "Close");
new PushButton("Close").click();
AbstractWait.sleep(TimePeriod.SHORT);
} catch (RedDeerException ex) {
fail("Browser with token was not opened.");
}
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class ConnectionWizardHandlingTest method openConnectionShell.
@Before
public void openConnectionShell() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.openConnectionShell();
new DefaultShell(OpenShiftLabel.Shell.NEW_CONNECTION);
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell 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.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class CDKLaunchConfigurationTest method openLaunchConfiguration.
/**
* Open Launch configuration dialog via server editor and return object of CDKLaunchConfigurationDialog
* @return
*/
private void openLaunchConfiguration() {
editor.openLaunchConfigurationFromLink();
DefaultShell shell = new DefaultShell("Edit Configuration");
shell.setFocus();
launchDialog = new CDKLaunchConfigurationDialog(shell);
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class CDKServerWizardAbstractTest method assertServerType.
protected void assertServerType(final String serverType) {
NewCDKServerWizard wizard = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
try {
TreeItem item = new DefaultTreeItem(new String[] { SERVER_TYPE_GROUP }).getItem(serverType);
item.select();
assertTrue(item.getText().equalsIgnoreCase(serverType));
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
} catch (CoreLayerException coreExp) {
log.error(coreExp.getMessage());
fail("Server type " + serverType + " was not found in New Server Wizard");
}
assertEquals(new LabeledText("Server's host name:").getText(), "localhost");
assertEquals(new LabeledText("Server name:").getText(), getServerAdapter());
new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.MEDIUM, false);
assertTrue("Dialog button Next is not enabled!", wizard.isNextEnabled());
try {
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
new CancelButton().click();
} catch (WaitTimeoutExpiredException exc) {
exc.printStackTrace();
log.error("Dialog could not be canceled because there were unfinished jobs running after timeout" + "\n\rTrying to cancel dialog manually");
new DefaultShell("New Server").close();
}
}
Aggregations