Search in sources :

Example 1 with WorkbenchLayerException

use of org.eclipse.reddeer.workbench.exception.WorkbenchLayerException in project jbosstools-openshift by jbosstools.

the class CDKServerAdapterAbstractTest method passCredentialsIntoEnvironment.

protected void passCredentialsIntoEnvironment(boolean pass) {
    getCDKServer().open();
    CDK3ServerEditor editor = new CDK3ServerEditor(getCDKServer().getLabel().getName());
    editor.getPassCredentialsCheckBox().toggle(pass);
    new WaitUntil(new EditorIsDirty(editor), TimePeriod.MEDIUM, false);
    new WaitWhile(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.MEDIUM);
    try {
        editor.save();
    } catch (WorkbenchLayerException exc) {
        String message = exc.getMessage().toLowerCase();
        if (message.contains("save") && message.contains("not enabled")) {
            log.info("There was nothing to save");
        } else {
            throw exc;
        }
    }
}
Also used : SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) WorkbenchLayerException(org.eclipse.reddeer.workbench.exception.WorkbenchLayerException) CDK3ServerEditor(org.jboss.tools.cdk.reddeer.server.ui.editor.CDK3ServerEditor) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) EditorIsDirty(org.eclipse.reddeer.workbench.condition.EditorIsDirty) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)1 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)1 EditorIsDirty (org.eclipse.reddeer.workbench.condition.EditorIsDirty)1 WorkbenchLayerException (org.eclipse.reddeer.workbench.exception.WorkbenchLayerException)1 SystemJobIsRunning (org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning)1 CDK3ServerEditor (org.jboss.tools.cdk.reddeer.server.ui.editor.CDK3ServerEditor)1