From d456fa6e71710a05e5c45899b42f520f5cbe48c8 Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 9 Mar 2017 13:01:16 +0200 Subject: [PATCH] Add Polymer 2 test module and configure travis to use Chrome for it (#1285) Fixes #1276 --- .travis.script.sh | 2 + .travis.yml | 1 + .../testutil/SingleBrowserTest.java | 66 ++++++ hummingbird-tests/pom.xml | 1 + .../test-root-context/frontend/bower.json | 1 + .../test-root-context/frontend/package.json | 1 + .../test-root-context/frontend/v2/bower.json | 21 ++ .../frontend/v2/package.json | 15 ++ hummingbird-tests/test-root-context/pom.xml | 196 ++++++++++-------- hummingbird-tests/test-root-context/repo.xml | 39 ++++ .../servlet/ApplicationRunnerServlet.java | 40 ++-- .../uitest/servlet/ViewClassLocator.java | 86 +++++--- .../vaadin/hummingbird/uitest/ui/EmptyUI.java | 7 - .../template/EventHandlerPolymerTemplate.java | 35 ++++ .../uitest/ui/template/EventHandlerUI.java | 31 +++ .../uitest/ui/template/EventHandler.html | 13 ++ .../uitest/ui/template/EventHandlerIT.java | 33 +++ 17 files changed, 451 insertions(+), 137 deletions(-) create mode 100644 hummingbird-test-util/src/main/java/com/vaadin/hummingbird/testutil/SingleBrowserTest.java create mode 100644 hummingbird-tests/test-root-context/frontend/v2/bower.json create mode 100644 hummingbird-tests/test-root-context/frontend/v2/package.json create mode 100644 hummingbird-tests/test-root-context/repo.xml delete mode 100644 hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/ui/EmptyUI.java create mode 100644 hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/ui/template/EventHandlerPolymerTemplate.java create mode 100644 hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/ui/template/EventHandlerUI.java create mode 100644 hummingbird-tests/test-root-context/src/main/webapp/com/vaadin/hummingbird/uitest/ui/template/EventHandler.html create mode 100644 hummingbird-tests/test-root-context/src/test/java/com/vaadin/hummingbird/uitest/ui/template/EventHandlerIT.java diff --git a/.travis.script.sh b/.travis.script.sh index b37e3ba989e..6634007d92c 100755 --- a/.travis.script.sh +++ b/.travis.script.sh @@ -5,6 +5,8 @@ # TRAVIS_SECURE_ENV_VARS == true if encrypted variables, e.g. SONAR_HOST is available # TRAVIS_REPO_SLUG == the repository, e.g. vaadin/vaadin +export DISPLAY=:99.0 +sh -e /etc/init.d/xvfb start if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ] then # Pull request for master with secure vars (SONAR_GITHUB_OAUTH, SONAR_HOST) available diff --git a/.travis.yml b/.travis.yml index 41277009fd0..be2b7440c0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ cache: - hummingbird-tests/test-expense-manager-imperative/frontend/node - hummingbird-tests/test-expense-manager-imperative/frontend/node_modules - hummingbird-tests/test-expense-manager-imperative/frontend/bower_components + - hummingbird-tests/test-polymer2/driver before_cache: # remove all build artifacts - rm -rf $HOME/.m2/repository/com/vaadin/hummingbird diff --git a/hummingbird-test-util/src/main/java/com/vaadin/hummingbird/testutil/SingleBrowserTest.java b/hummingbird-test-util/src/main/java/com/vaadin/hummingbird/testutil/SingleBrowserTest.java new file mode 100644 index 00000000000..b95a3955ca0 --- /dev/null +++ b/hummingbird-test-util/src/main/java/com/vaadin/hummingbird/testutil/SingleBrowserTest.java @@ -0,0 +1,66 @@ +/* + * Copyright 2000-2017 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.hummingbird.testutil; + +import org.junit.Before; +import org.openqa.selenium.chrome.ChromeDriver; +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.testbench.parallel.Browser; + +/** + * Base class for TestBench tests for some dedicated browser which is specified + * via {@link #getBrowser()}. + *

+ * By default Chrome is used. + *

+ * It is required to set system property with path to the driver to be able to + * run the test. + * + * @author Vaadin Ltd + * + */ +public class SingleBrowserTest extends ViewOrUITest { + + /** + * Setup the driver for the active browser. + */ + @Before + public void setupDriver() { + switch (getBrowser()) { + case FIREFOX: + setDriver(new FirefoxDriver(DesiredCapabilities.firefox())); + break; + case CHROME: + setDriver(new ChromeDriver(DesiredCapabilities.chrome())); + break; + case PHANTOMJS: + setupPhantomJsDriver(); + break; + default: + throw new IllegalStateException( + "Don't know how to execute test with the browser " + + getBrowser() + + ". Make a custom driver set up for it."); + } + } + + protected Browser getBrowser() { + return Browser.CHROME; + } + +} diff --git a/hummingbird-tests/pom.xml b/hummingbird-tests/pom.xml index 5390e8ce8f1..8ae3295101c 100644 --- a/hummingbird-tests/pom.xml +++ b/hummingbird-tests/pom.xml @@ -74,6 +74,7 @@ ${server.port} ${phantomjs.binary} + ${webdriver.chrome.driver} ${test.excludegroup} diff --git a/hummingbird-tests/test-root-context/frontend/bower.json b/hummingbird-tests/test-root-context/frontend/bower.json index 87b87cad88e..bd9b782c28c 100644 --- a/hummingbird-tests/test-root-context/frontend/bower.json +++ b/hummingbird-tests/test-root-context/frontend/bower.json @@ -21,3 +21,4 @@ "polymer": "1.5.0" } } + diff --git a/hummingbird-tests/test-root-context/frontend/package.json b/hummingbird-tests/test-root-context/frontend/package.json index 03b102c6fca..e23db241495 100644 --- a/hummingbird-tests/test-root-context/frontend/package.json +++ b/hummingbird-tests/test-root-context/frontend/package.json @@ -13,3 +13,4 @@ "author": "", "license": "Apache-2.0" } + diff --git a/hummingbird-tests/test-root-context/frontend/v2/bower.json b/hummingbird-tests/test-root-context/frontend/v2/bower.json new file mode 100644 index 00000000000..6ccc8766305 --- /dev/null +++ b/hummingbird-tests/test-root-context/frontend/v2/bower.json @@ -0,0 +1,21 @@ +{ + "name": "test-polymer2", + "homepage": "https://github.com/vaadin/hummingbird", + "authors": [ + ], + "description": "", + "main": "", + "license": "Apache2", + "private": true, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": { + "polymer": "Polymer/polymer#2.0-preview" + } +} + diff --git a/hummingbird-tests/test-root-context/frontend/v2/package.json b/hummingbird-tests/test-root-context/frontend/v2/package.json new file mode 100644 index 00000000000..fdd60c28cca --- /dev/null +++ b/hummingbird-tests/test-root-context/frontend/v2/package.json @@ -0,0 +1,15 @@ +{ + "name": "test-polymer2", + "version": "1.0.0", + "description": "This file exists only to define the Bower version", + "main": "", + "dependencies": { + "bower": "^1.8.0" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "Apache-2.0" +} diff --git a/hummingbird-tests/test-root-context/pom.xml b/hummingbird-tests/test-root-context/pom.xml index 1c07dbec39c..582e8739651 100644 --- a/hummingbird-tests/test-root-context/pom.xml +++ b/hummingbird-tests/test-root-context/pom.xml @@ -1,87 +1,119 @@ - 4.0.0 - - com.vaadin - hummingbird-tests - 0.0.19-SNAPSHOT - - hummingbird-test-root-context - Hummingbird root context tests - war - - true - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + com.vaadin + hummingbird-tests + 0.0.19-SNAPSHOT + + hummingbird-test-root-context + Hummingbird root context tests + war + + true + + - - - com.vaadin - hummingbird-test-resources - 0.0.19-SNAPSHOT - - + + + com.vaadin + hummingbird-test-resources + 0.0.19-SNAPSHOT + + - - - - org.apache.maven.plugins - maven-war-plugin - - - - - frontend - bower_components/** - - - - - - - - org.eclipse.jetty - jetty-maven-plugin - - - - start-jetty - pre-integration-test - - start - - - - stop-jetty - post-integration-test - - stop - - - - - - com.github.eirslett - frontend-maven-plugin - 1.0 - - ${node.version} - ${npm.version} - frontend - - - - install-node-and-npm - - install-node-and-npm - npm - bower - - - - - - + + + + + org.eclipse.jetty + jetty-maven-plugin + + + + start-jetty + pre-integration-test + + start + + + + stop-jetty + post-integration-test + + stop + + + + + + com.github.eirslett + frontend-maven-plugin + 1.0 + + ${node.version} + ${npm.version} + + + + install-node-and-npm-1 + + install-node-and-npm + npm + bower + + + frontend + + + + install-node-and-npm-2 + + install-node-and-npm + npm + bower + + + frontend/v2 + + + + + + org.apache.maven.plugins + maven-war-plugin + + + + + frontend + bower_components/** + v2/bower_components/** + + + + + + com.lazerycode.selenium + driver-binary-downloader-maven-plugin + 1.0.10 + + + true + driver + repo.xml + + + + + selenium + + + + + + diff --git a/hummingbird-tests/test-root-context/repo.xml b/hummingbird-tests/test-root-context/repo.xml new file mode 100644 index 00000000000..34f29b65872 --- /dev/null +++ b/hummingbird-tests/test-root-context/repo.xml @@ -0,0 +1,39 @@ + + + + + + + http://chromedriver.storage.googleapis.com/2.27/chromedriver_win32.zip + + d9d38707ed22f5549a1b5ed53ad054c2a0a1ada6 + sha1 + + + + + + + + + http://chromedriver.storage.googleapis.com/2.27/chromedriver_linux64.zip + + d2d5a41e7bdac88fd031095337fb3e20a812836c + sha1 + + + + + + + + + http://chromedriver.storage.googleapis.com/2.27/chromedriver_mac64.zip + + 3ebf455e5f461c8f7cabb825af40205b53fce58b + sha1 + + + + + diff --git a/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/servlet/ApplicationRunnerServlet.java b/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/servlet/ApplicationRunnerServlet.java index 040130e9216..0890eac3fd2 100644 --- a/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/servlet/ApplicationRunnerServlet.java +++ b/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/servlet/ApplicationRunnerServlet.java @@ -25,6 +25,10 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; import java.util.Collections; import java.util.LinkedHashSet; import java.util.Map; @@ -40,7 +44,6 @@ import javax.servlet.http.HttpSession; import com.vaadin.hummingbird.uitest.servlet.CustomDeploymentConfiguration.Conf; -import com.vaadin.hummingbird.uitest.ui.EmptyUI; import com.vaadin.server.DefaultDeploymentConfiguration; import com.vaadin.server.DeploymentConfiguration; import com.vaadin.server.ServiceException; @@ -76,8 +79,7 @@ public void init(ServletConfig servletConfig) throws ServletException { if (initParameter != null) { Collections.addAll(defaultPackages, initParameter.split(",")); } - String str = EmptyUI.class.getName().replace('.', '/') + ".class"; - URL url = getService().getClassLoader().getResource(str); + URL url = getService().getClassLoader().getResource("."); if ("file".equals(url.getProtocol())) { String path = url.getPath(); try { @@ -85,23 +87,33 @@ public void init(ServletConfig servletConfig) throws ServletException { } catch (URISyntaxException e) { getLogger().log(Level.FINE, "Failed to decode url", e); } - File comVaadinTests = new File(path).getParentFile() - .getParentFile(); - addDirectories(comVaadinTests, defaultPackages, "com.vaadin.tests"); + try { + addDirectories(new File(url.getPath()), defaultPackages); + } catch (IOException exception) { + throw new RuntimeException( + "Unable to scan classpath to find packages", exception); + } } } - private void addDirectories(File parent, LinkedHashSet packages, - String parentPackage) { - packages.add(parentPackage); + private void addDirectories(File parent, LinkedHashSet packages) + throws IOException { + Path root = parent.toPath(); + Files.walkFileTree(parent.toPath(), new SimpleFileVisitor() { - for (File f : parent.listFiles()) { - if (f.isDirectory()) { - String newPackage = parentPackage + "." + f.getName(); - addDirectories(f, packages, newPackage); + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) + throws IOException { + File file = dir.toFile(); + if (file.isDirectory()) { + Path relative = root.relativize(file.toPath()); + packages.add(relative.toString().replace(File.separatorChar, + '.')); + } + return super.postVisitDirectory(dir, exc); } - } + }); } @Override diff --git a/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/servlet/ViewClassLocator.java b/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/servlet/ViewClassLocator.java index 10a6258957d..5fd7c01b7be 100644 --- a/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/servlet/ViewClassLocator.java +++ b/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/servlet/ViewClassLocator.java @@ -16,15 +16,20 @@ package com.vaadin.hummingbird.uitest.servlet; import java.io.File; +import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; import java.net.URL; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; import java.util.Collection; import java.util.LinkedHashMap; import java.util.logging.Logger; import com.vaadin.hummingbird.router.View; -import com.vaadin.hummingbird.uitest.ui.EmptyUI; public class ViewClassLocator { private LinkedHashMap> views = new LinkedHashMap<>(); @@ -32,54 +37,67 @@ public class ViewClassLocator { public ViewClassLocator(ClassLoader classLoader) { this.classLoader = classLoader; - String str = EmptyUI.class.getName().replace('.', '/') + ".class"; - URL url = classLoader.getResource(str); + URL url = classLoader.getResource("."); if ("file".equals(url.getProtocol())) { String path = url.getPath(); - File testFolder = new File(path).getParentFile(); + File testFolder = new File(path); // This scans parts of the classpath. If it becomes slow, we have to // remove this or make the scanning lazy - findViews(testFolder, views, EmptyUI.class.getPackage().getName()); - getLogger().info("Found " + views.size() + " views"); + try { + findViews(testFolder, views); + getLogger().info("Found " + views.size() + " views"); + } catch (IOException exception) { + throw new RuntimeException( + "Unable to scan classpath to find views", exception); + } } else { throw new RuntimeException( - "Could not find EmptyUI.class using a file:// URL. Got URL: " + "Could not find 'com' package using a file:// URL. Got URL: " + url); } } - @SuppressWarnings("unchecked") private void findViews(File parent, - LinkedHashMap> packages, - String parentPackage) { + LinkedHashMap> packages) + throws IOException { + Path root = parent.toPath(); + Files.walkFileTree(parent.toPath(), new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path path, + BasicFileAttributes attrs) throws IOException { + tryLoadClass(root, path); + return super.visitFile(path, attrs); + } + }); - for (File f : parent.listFiles()) { - if (f.isDirectory()) { - String newPackage = parentPackage + "." + f.getName(); - findViews(f, views, newPackage); - } else if (f.getName().endsWith(".class") - && !f.getName().contains("$")) { - String className = parentPackage + "." - + f.getName().replace(".class", ""); - try { - Class cls = classLoader.loadClass(className); - if (View.class.isAssignableFrom(cls) - && !Modifier.isAbstract(cls.getModifiers())) { - try { - // Only include views which have a no-arg - // constructor - Constructor constructor = cls.getConstructor(); - assert constructor != null; - views.put(cls.getSimpleName(), - (Class) cls); - } catch (Exception e) { - // InlineTemplate or similar - } + } + + @SuppressWarnings("unchecked") + private void tryLoadClass(Path root, Path path) { + File file = path.toFile(); + if (file.getName().endsWith(".class") + && !file.getName().contains("$")) { + Path relative = root.relativize(path); + String className = relative.toString() + .replace(File.separatorChar, '.').replace(".class", ""); + try { + Class cls = classLoader.loadClass(className); + if (View.class.isAssignableFrom(cls) + && !Modifier.isAbstract(cls.getModifiers())) { + try { + // Only include views which have a no-arg + // constructor + Constructor constructor = cls.getConstructor(); + assert constructor != null; + views.put(cls.getSimpleName(), + (Class) cls); + } catch (Exception e) { + // InlineTemplate or similar } - } catch (Exception e) { - getLogger().warning("Unable to load class " + className); } + } catch (Exception e) { + getLogger().warning("Unable to load class " + className); } } } diff --git a/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/ui/EmptyUI.java b/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/ui/EmptyUI.java deleted file mode 100644 index 938190481c8..00000000000 --- a/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/ui/EmptyUI.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.vaadin.hummingbird.uitest.ui; - -import com.vaadin.ui.UI; - -public class EmptyUI extends UI { - -} diff --git a/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/ui/template/EventHandlerPolymerTemplate.java b/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/ui/template/EventHandlerPolymerTemplate.java new file mode 100644 index 00000000000..6d68f4ceeda --- /dev/null +++ b/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/ui/template/EventHandlerPolymerTemplate.java @@ -0,0 +1,35 @@ +/* + * Copyright 2000-2017 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.hummingbird.uitest.ui.template; + +import com.vaadin.annotations.EventHandler; +import com.vaadin.annotations.HtmlImport; +import com.vaadin.annotations.Tag; +import com.vaadin.hummingbird.dom.Element; +import com.vaadin.hummingbird.dom.ElementFactory; +import com.vaadin.hummingbird.template.PolymerTemplate; + +@Tag("event-handler") +@HtmlImport("/com/vaadin/hummingbird/uitest/ui/template/EventHandler.html") +public class EventHandlerPolymerTemplate extends PolymerTemplate { + + @EventHandler + private void handleClick() { + Element label = ElementFactory.createLabel("Event handler is invoked"); + label.setAttribute("id", "event-handler-result"); + getParent().get().getElement().appendChild(label); + } +} diff --git a/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/ui/template/EventHandlerUI.java b/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/ui/template/EventHandlerUI.java new file mode 100644 index 00000000000..04bbd188f2a --- /dev/null +++ b/hummingbird-tests/test-root-context/src/main/java/com/vaadin/hummingbird/uitest/ui/template/EventHandlerUI.java @@ -0,0 +1,31 @@ +/* + * Copyright 2000-2017 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.hummingbird.uitest.ui.template; + +import com.vaadin.annotations.WebComponents; +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.UI; + +@WebComponents(1) +public class EventHandlerUI extends UI { + + @Override + protected void init(VaadinRequest request) { + EventHandlerPolymerTemplate template = new EventHandlerPolymerTemplate(); + template.setId("template"); + add(template); + } +} diff --git a/hummingbird-tests/test-root-context/src/main/webapp/com/vaadin/hummingbird/uitest/ui/template/EventHandler.html b/hummingbird-tests/test-root-context/src/main/webapp/com/vaadin/hummingbird/uitest/ui/template/EventHandler.html new file mode 100644 index 00000000000..138f7eb04e4 --- /dev/null +++ b/hummingbird-tests/test-root-context/src/main/webapp/com/vaadin/hummingbird/uitest/ui/template/EventHandler.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/hummingbird-tests/test-root-context/src/test/java/com/vaadin/hummingbird/uitest/ui/template/EventHandlerIT.java b/hummingbird-tests/test-root-context/src/test/java/com/vaadin/hummingbird/uitest/ui/template/EventHandlerIT.java new file mode 100644 index 00000000000..a08bfabbafa --- /dev/null +++ b/hummingbird-tests/test-root-context/src/test/java/com/vaadin/hummingbird/uitest/ui/template/EventHandlerIT.java @@ -0,0 +1,33 @@ +/* + * Copyright 2000-2017 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.hummingbird.uitest.ui.template; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.hummingbird.testutil.SingleBrowserTest; +import com.vaadin.testbench.By; + +public class EventHandlerIT extends SingleBrowserTest { + + @Test + public void handleEventOnServer() { + open(); + + findElement(By.id("template")).click(); + Assert.assertTrue(isElementPresent(By.id("event-handler-result"))); + } +}