use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class ProjectNameValidationTest method closeNewProjectShell.
private void closeNewProjectShell() {
new CancelButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class LinkToCreateNewProjectTest method createOpenShiftProjectViaLinkInExplorer.
@Test
public void createOpenShiftProjectViaLinkInExplorer() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
OpenShiftUtils.deleteAllProjects(connectionReq.getConnection());
TreeItem connectionItem = explorer.getOpenShift3Connection(connectionReq.getConnection()).getTreeItem();
TreeItem newProjectLinkItem = null;
try {
newProjectLinkItem = connectionItem.getItem("No projects are available. Click here to create a new project...");
} catch (RedDeerException ex) {
fail("There is no link to create a new project even connection does not have any project.");
}
TreeItemHandler.getInstance().click(newProjectLinkItem.getSWTWidget());
try {
new DefaultShell(OpenShiftLabel.Shell.CREATE_OS_PROJECT);
} catch (RedDeerException ex) {
fail("Create new OpenShift project shell has not been opened.");
}
new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText(projectName);
new WaitUntil(new ControlIsEnabled(new FinishButton()));
new FinishButton().click();
projectCreated = true;
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
assertTrue("OpenShift project is not visible in OpenShift Explorer under the connection" + " although it should have been created successfully and visible.", explorer.getOpenShift3Connection(connectionReq.getConnection()).projectExists(projectName));
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class DeployDockerImageTest method proceedThroughDeployImageToOpenShiftWizard.
/**
* Proceeds through the image if the first wizard page has correct details -
* connection, project and image name.
*/
private void proceedThroughDeployImageToOpenShiftWizard() {
new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT, false);
assertTrue("Next button should be enabled if all details are set correctly", new NextButton().isEnabled());
new NextButton().click();
new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
new NextButton().click();
if (!new CheckBox("Add Route").isChecked()) {
new CheckBox("Add Route").click();
}
new FinishButton().click();
new ShellWithButton("Deploy Image to OpenShift", "OK");
new OkButton().click();
new WaitWhile(new ShellIsAvailable("Deploy Image to OpenShift"), TimePeriod.LONG);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class GetOpenShiftIOTokenTest method testGetToken.
@Test
public void testGetToken() {
new DefaultToolItem(new WorkbenchShell(), "Connect to OpenShift.io").click();
DefaultShell browser = new DefaultShell();
InternalBrowser internalBrowser = new InternalBrowser(browser);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitUntil(new BrowserContainsText("OpenShift.io Developer Preview"), TimePeriod.LONG);
internalBrowser.execute(String.format("document.getElementById(\"username\").value=\"%s\"", DatastoreOS3.OPENSHIFT_IO_USERNAME));
internalBrowser.execute(String.format("document.getElementById(\"password\").value=\"%s\"", DatastoreOS3.OPENSHIFT_IO_PASSWORD));
internalBrowser.execute("document.getElementById(\"password\").parentElement.parentElement.parentElement.submit()");
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
try {
new DefaultShell("OpenShift.io");
} catch (CoreLayerException ex) {
// Secure storage has been triggered
SecureStorage.handleSecureStoragePasswordAndHint(SystemProperties.SECURE_STORAGE_PASSWORD);
new DefaultShell("OpenShift.io");
}
new OkButton().click();
checkAccountInProperties();
checkPluginInSecureStorage();
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class OpenShiftProject method delete.
/**
* Deletes OpenShift project.
*/
public void delete() {
item.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.DELETE_OS_PROJECT).select();
new DefaultShell(OpenShiftLabel.Shell.DELETE_OS_PROJECT);
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.DELETE_OS_PROJECT), TimePeriod.LONG);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Aggregations