use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-openshift by jbosstools.
the class CDKLaunchConfigurationDialog method revert.
public void revert() {
logger.info("Pressing revert button...");
Button revert = new PushButton(this, new WithTextMatcher("Revert"));
if (revert.isEnabled()) {
revert.click();
}
}
use of org.eclipse.reddeer.swt.impl.button.PushButton 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.swt.impl.button.PushButton 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());
}
}
use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-openshift by jbosstools.
the class PortForwardingTest method closePortForwardingShell.
@After
public void closePortForwardingShell() {
PushButton stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
if (stopAllButton.isEnabled()) {
stopAllButton.click();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false);
}
new DefaultShell(OpenShiftLabel.Shell.APPLICATION_PORT_FORWARDING).close();
}
use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-openshift by jbosstools.
the class PortForwardingTest method testPortForwardingButtonsAccessibility.
@Test
public void testPortForwardingButtonsAccessibility() {
openPortForwardingDialog();
PushButton startAllButton = new PushButton(OpenShiftLabel.Button.START_ALL);
PushButton stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
OkButton okButton = new OkButton();
assertTrue("Button Start All should be enabled at this point.", startAllButton.isEnabled());
assertFalse("Button Stop All should be disabled at this point.", stopAllButton.isEnabled());
startAllButton.click();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitUntil(new ControlIsEnabled(okButton));
try {
new WaitWhile(new ControlIsEnabled(startAllButton), TimePeriod.getCustom(5));
} catch (WaitTimeoutExpiredException ex) {
fail("Button Start All should be disabled at this point.");
}
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitWhile(new ControlIsEnabled(okButton), false);
stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
assertTrue("Button Stop All should be enabled at this point.", stopAllButton.isEnabled());
stopAllButton.click();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.APPLICATION_PORT_FORWARDING);
new WaitUntil(new ControlIsEnabled(okButton));
try {
new WaitUntil(new ControlIsEnabled(startAllButton), TimePeriod.getCustom(5));
} catch (WaitTimeoutExpiredException ex) {
fail("Button Start All should be enabled at this point.");
}
assertFalse("Button Stop All should be disabled at this point.", stopAllButton.isEnabled());
}
Aggregations