Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JBTIS-758: Add test for collapse/expand feature in Camel Editor #880

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/org.jboss.tools.fuse.ui.bot.test/META-INF/MANIFEST.MF
Expand Up @@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui,
org.jboss.reddeer.graphiti;bundle-version="1.0.0",
org.jboss.tools.runtime.reddeer;bundle-version="4.5.0",
org.jboss.tools.fuse.reddeer;bundle-version="4.5.0",
org.jboss.reddeer.eclipse
org.jboss.reddeer.eclipse,
org.eclipse.draw2d
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Vendor: JBoss by Red Hat
Expand Down
Expand Up @@ -8,6 +8,8 @@

import org.jboss.reddeer.common.logging.Logger;
import org.jboss.reddeer.core.exception.CoreLayerException;
import org.jboss.reddeer.common.wait.AbstractWait;
import org.jboss.reddeer.common.wait.TimePeriod;
import org.jboss.reddeer.eclipse.ui.perspectives.JavaEEPerspective;
import org.jboss.reddeer.gef.view.PaletteView;
import org.jboss.reddeer.jface.text.contentassist.ContentAssistant;
Expand All @@ -28,6 +30,7 @@
import org.jboss.tools.fuse.reddeer.component.File;
import org.jboss.tools.fuse.reddeer.component.Log;
import org.jboss.tools.fuse.reddeer.component.Otherwise;
import org.jboss.tools.fuse.reddeer.editor.CamelComponentEditPart;
import org.jboss.tools.fuse.reddeer.editor.CamelEditor;
import org.jboss.tools.fuse.reddeer.editor.SourceEditor;
import org.jboss.tools.fuse.reddeer.projectexplorer.CamelProject;
Expand Down Expand Up @@ -253,4 +256,38 @@ public void testDragAndDropComponents() {
assertTrue(EditorManipulator.isEditorContentEqualsFile("resources/camel-context-all.xml"));
assertTrue(LogGrapper.getPluginErrors("fuse").size() == 0);
}

/**
* <p>
* Test checks collapse/expand feature of Camel editor components
* </p>
* <ol>
* <li>create a new project from template 'Content Based Router'</li>
* <li>open camel-context.xml file</li>
* <li>Invoke 'Collapse' on route component 'Choice'</li>
* <li>Check if component was collapsed (check if changed size of collapsed component area and height is smaller
* then begin values)</li>
* <li>Check fuse errors in Error Log View</li>
* <li>Invoke 'Expand' on route component 'Choice'</li>
* <li>Check if component was expanded (check changed size of expanded component area -> should be same as area size
* and height before collapse)</li>
* <li>Check fuse errors in Error Log View</li>
* </ol>
*
* @author djelinek
*/
@Test
public void testCollapseExpandFeature() {
CamelEditor editor = new CamelEditor("camel-context.xml");
CamelComponentEditPart editPart = new CamelComponentEditPart("Choice");
int startHeight = editPart.getBounds().height;
editor.doOperation("Choice", "Collapse");
AbstractWait.sleep(TimePeriod.getCustom(5));
assertTrue("Route component 'Choice' wasn't collapsed properly", editPart.getBounds().height < startHeight);
assertTrue(LogGrapper.getPluginErrors("fuse").size() == 0);
editor.doOperation("Choice", "Expand");
AbstractWait.sleep(TimePeriod.getCustom(5));
assertEquals(editPart.getBounds().height, startHeight);
assertTrue(LogGrapper.getPluginErrors("fuse").size() == 0);
}
}