use of org.eclipse.reddeer.swt.impl.text.LabeledText in project jbosstools-openshift by jbosstools.
the class ConnectionWizardHandlingTest method testTokenCachingAfterSwitchingAuthProtocol.
@Test
public void testTokenCachingAfterSwitchingAuthProtocol() {
new LabeledCombo(OpenShiftLabel.TextLabels.SERVER_TYPE).setSelection(OpenShiftLabel.Others.OPENSHIFT3);
String token = "r4nd0mT0k3n";
switchToOAuth();
new LabeledText(OpenShiftLabel.TextLabels.TOKEN).setText(token);
switchToBasic();
switchToOAuth();
assertTrue("Token text field does not cache token after switching authentication protocol.", token.equals(new LabeledText(OpenShiftLabel.TextLabels.TOKEN).getText()));
}
use of org.eclipse.reddeer.swt.impl.text.LabeledText in project jbosstools-openshift by jbosstools.
the class OpenShiftExplorerView method connectToOpenShift.
public void connectToOpenShift(String server, String username, String password, boolean storePassword, boolean useDefaultServer, AuthenticationMethod authMethod, boolean certificateShown) {
new DefaultShell(OpenShiftLabel.Shell.NEW_CONNECTION);
if (new CheckBox(0).isChecked() != useDefaultServer) {
new CheckBox(0).click();
}
if (!useDefaultServer) {
new LabeledCombo(OpenShiftLabel.TextLabels.SERVER).setText(server);
}
new LabeledCombo(OpenShiftLabel.TextLabels.PROTOCOL).setSelection(authMethod.toString());
if (AuthenticationMethod.OAUTH.equals(authMethod)) {
new LabeledText(OpenShiftLabel.TextLabels.TOKEN).setText(password);
}
if (AuthenticationMethod.BASIC.equals(authMethod)) {
new LabeledText(OpenShiftLabel.TextLabels.USERNAME).setText(username);
new LabeledText(OpenShiftLabel.TextLabels.PASSWORD).setText(password);
if (new CheckBox(OpenShiftLabel.TextLabels.STORE_PASSWORD).isChecked() != storePassword) {
new CheckBox(OpenShiftLabel.TextLabels.STORE_PASSWORD).click();
}
}
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.DEFAULT);
new FinishButton().click();
if (certificateShown) {
try {
new DefaultShell(OpenShiftLabel.Shell.UNTRUSTED_SSL_CERTIFICATE);
new PushButton("Yes").click();
} catch (RedDeerException ex) {
fail("Aceptance of SSL certificate failed.");
}
}
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_CONNECTION), TimePeriod.LONG);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
use of org.eclipse.reddeer.swt.impl.text.LabeledText in project jbosstools-openshift by jbosstools.
the class OpenShift3Connection method createNewProject.
/**
* Creates a new OpenShift project for a connection.
*
* @param projectName project name
* @param displayedName displayed name
* @return OpenShift Project
*/
public OpenShiftProject createNewProject(String projectName, String displayedName) {
select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_OS_PROJECT).select();
new DefaultShell(OpenShiftLabel.Shell.CREATE_OS_PROJECT);
new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText(projectName);
if (displayedName != null) {
new LabeledText(OpenShiftLabel.TextLabels.PROJECT_DISPLAYED_NAME).setText(displayedName);
}
new FinishButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
if (displayedName == null) {
return getProject(projectName);
} else {
return getProject(displayedName);
}
}
Aggregations