use of org.eclipse.reddeer.junit.execution.annotation.RunIf in project jbosstools-openshift by jbosstools.
the class CreateNewConnectionTest method testCreateNewV3BasicConnection.
@Test
@RunIf(conditionClass = ConnectionCredentialsExists.class)
public void testCreateNewV3BasicConnection() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.open();
DatastoreOS3.AUTH_METHOD = AuthenticationMethod.BASIC;
explorer.openConnectionShell();
OpenShift3ConnectionWizard connectionWizard = new OpenShift3ConnectionWizard();
connectionWizard.setServer(DatastoreOS3.SERVER);
connectionWizard.switchAuthenticationSection(DatastoreOS3.AUTH_METHOD);
BasicAuthenticationSection authSection = (BasicAuthenticationSection) connectionWizard.getAuthSection();
authSection.setUsername(DatastoreOS3.USERNAME);
authSection.setPassword(DatastoreOS3.PASSWORD);
authSection.setSavePassword(false);
connectionWizard.finishAndHandleCertificate();
assertTrue("Connection does not exist in OpenShift Explorer view", explorer.connectionExists(DatastoreOS3.USERNAME));
}
use of org.eclipse.reddeer.junit.execution.annotation.RunIf in project jbosstools-openshift by jbosstools.
the class CreateNewConnectionTest method testCreateNewV3OAuthConnection.
@Test
@RunIf(conditionClass = ConnectionCredentialsExists.class)
public void testCreateNewV3OAuthConnection() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.open();
DatastoreOS3.AUTH_METHOD = AuthenticationMethod.OAUTH;
explorer.openConnectionShell();
try {
explorer.connectToOpenShift(DatastoreOS3.SERVER, null, DatastoreOS3.TOKEN, false, false, AuthenticationMethod.OAUTH, true);
} catch (RedDeerException ex) {
fail("Creating an OpenShift v3 OAuth connection failed." + ex.getCause());
}
assertTrue("Connection does not exist in OpenShift Explorer view", explorer.connectionExists(DatastoreOS3.USERNAME));
}
use of org.eclipse.reddeer.junit.execution.annotation.RunIf in project jbosstools-openshift by jbosstools.
the class CreateNewConnectionTest method invalidRegistryURLShouldReportErrorMessage.
@Test
@RunIf(conditionClass = ConnectionCredentialsExists.class)
public void invalidRegistryURLShouldReportErrorMessage() {
openConnectionWizardAndSetDefaultServer();
new LabeledCombo(OpenShiftLabel.TextLabels.PROTOCOL).setSelection(AuthenticationMethod.BASIC.toString());
new LabeledText(OpenShiftLabel.TextLabels.USERNAME).setText(DatastoreOS3.USERNAME);
new LabeledText(OpenShiftLabel.TextLabels.PASSWORD).setText(DatastoreOS3.PASSWORD);
new PushButton(OpenShiftLabel.Button.ADVANCED_OPEN).click();
new LabeledText(OpenShiftLabel.TextLabels.IMAGE_REGISTRY_URL).setText("invalidURL");
new WaitUntil(new ControlIsEnabled(new CancelButton()), TimePeriod.DEFAULT);
new WaitUntil(new ControlIsEnabled(new DefaultText(" Please provide a valid image registry (HTTP/S) URL.")), TimePeriod.DEFAULT);
new CancelButton().click();
}
use of org.eclipse.reddeer.junit.execution.annotation.RunIf in project jbosstools-openshift by jbosstools.
the class CreateNewConnectionTest method shouldExtractTokenInBrowserWindow.
// Skip Test for now, not stable
// @Test
@RunIf(conditionClass = ConnectionCredentialsExists.class)
public void shouldExtractTokenInBrowserWindow() {
openConnectionWizardAndSetDefaultServerOAuth();
String token = new AuthenticationTokenRetrival(DatastoreOS3.USERNAME, DatastoreOS3.PASSWORD).retrieveToken();
String tokenText = new LabeledText(OpenShiftLabel.TextLabels.TOKEN).getText();
assertEquals(token, tokenText);
new CancelButton().click();
}
Aggregations