use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.
the class LabelsTest method testCreateDuplicativeReadOnlyLabel.
@Test
public void testCreateDuplicativeReadOnlyLabel() {
ResourceLabelsWizardPage page = new ResourceLabelsWizardPage();
try {
page.createLabel("template", "noway");
fail("It should not be possible to create duplicite labels of already existing read only label");
} catch (RedDeerException ex) {
// pass
} finally {
closeResourceLabelShell();
}
}
use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.
the class ServerAdapterFromResourceTest method importProject.
@BeforeClass
public static void importProject() {
explorer = new OpenShiftExplorerView();
explorer.open();
project = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(DatastoreOS3.TEST_PROJECT);
project.getServicesWithName(OpenShiftResources.NODEJS_SERVICE).get(0).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
ImportApplicationWizard appWizard = new ImportApplicationWizard();
try {
CheckBox checkBox = new CheckBox("Do not clone - use existing repository");
if (checkBox.isEnabled()) {
checkBox.toggle(true);
LOGGER.debug("Using existing project, skipping import");
}
} catch (RedDeerException ex) {
LOGGER.debug("No existing project found, importing");
}
try {
appWizard.finish();
} catch (WaitTimeoutExpiredException ex) {
// When running test in suite, it needs to be selected correct build config(in OpenShift instance could be more build configs)
appWizard.selectExistingBuildConfiguration(OpenShiftResources.NODEJS_APP_DEPLOYMENT_CONFIG);
appWizard.finish();
}
new WaitUntil(new OpenShiftResourceExists(Resource.DEPLOYMENT, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER, ResourceState.UNSPECIFIED, DatastoreOS3.TEST_PROJECT, connectionReq.getConnection()), TimePeriod.LONG);
}
use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.
the class ConnectionWizardHandlingTest method switchToBasic.
private void switchToBasic() {
new LabeledCombo(OpenShiftLabel.TextLabels.PROTOCOL).setSelection(AuthenticationMethod.BASIC.toString());
try {
new LabeledText(OpenShiftLabel.TextLabels.USERNAME);
new LabeledText(OpenShiftLabel.TextLabels.PASSWORD);
// pass
} catch (RedDeerException ex) {
fail("Text field for username and/or password is not present for Basic authentication protocol.");
}
}
use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.
the class DeployDockerImageTest method closeBrowser.
public static void closeBrowser() {
try {
BrowserEditor browser = new BrowserEditor(new StringContains("hello"));
browser.close();
} catch (RedDeerException ex) {
// do nothing, browser is not opened
}
}
use of org.eclipse.reddeer.common.exception.RedDeerException 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);
}
Aggregations