use of org.eclipse.reddeer.common.exception.RedDeerException 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.common.exception.RedDeerException 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.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.
the class LabelsTest method testCreateDuplicativeLabel.
@Test
public void testCreateDuplicativeLabel() {
ResourceLabelsWizardPage page = new ResourceLabelsWizardPage();
String name = "label";
String value = "value";
page.createLabel(name, value);
try {
page.createLabel(name, value);
fail("It should not be possible to create duplicitive labels");
} catch (RedDeerException ex) {
// pass
} finally {
closeResourceLabelShell();
}
}
use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.
the class NewApplicationWizardHandlingTest method testTemplatesRelatedWidgetAccess.
@Test
public void testTemplatesRelatedWidgetAccess() {
assertTrue("Server template selection should be chosen by default.", new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).isSelected());
new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
try {
new DefaultTree();
fail("Tree with server templates should not be visible if local template " + "tab item is selected.");
} catch (RedDeerException ex) {
// pass
}
assertTrue("Browse button should be visible and enabled while local template " + "tab item is selected.", new PushButton(OpenShiftLabel.Button.BROWSE).isEnabled());
new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
assertTrue("Tree with server templates should be visible and enabled if server template " + "tab item is selected.", new DefaultTree().isEnabled());
try {
new PushButton(1, new WithTextMatcher(OpenShiftLabel.Button.BROWSE));
fail("Browse button should not be visible while server template tab item is selected.");
} catch (RedDeerException ex) {
// pass
}
}
use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.
the class CreateNewProjectTest method testCreateNewProjectViaManageShell.
@Test
public void testCreateNewProjectViaManageShell() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.reopen();
OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
connection.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT_OS_PROJECTS).select();
new DefaultShell(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS);
new PushButton(OpenShiftLabel.Button.NEW).click();
new DefaultShell(OpenShiftLabel.Shell.CREATE_OS_PROJECT);
new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText(DatastoreOS3.PROJECT1);
new LabeledText(OpenShiftLabel.TextLabels.PROJECT_DISPLAYED_NAME).setText(DatastoreOS3.PROJECT1_DISPLAYED_NAME);
new WaitUntil(new ControlIsEnabled(new FinishButton()));
new FinishButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS);
try {
new DefaultTable().getItem(DatastoreOS3.PROJECT1);
} catch (RedDeerException ex) {
fail("Project " + DatastoreOS3.PROJECT1 + " does not exist in the table. It has not been created.");
}
assertTrue("Displayed name for project " + DatastoreOS3.PROJECT1 + " is not shown in the table.", new DefaultTable().getItem(DatastoreOS3.PROJECT1).getText(1).equals(DatastoreOS3.PROJECT1_DISPLAYED_NAME));
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS), TimePeriod.LONG);
try {
connection.getProject();
} catch (RedDeerException ex) {
fail("OpenShift project created for a connection has not been shown in OpenShift explorer.\n" + ex.getCause());
}
}
Aggregations