aboutsummaryrefslogtreecommitdiffstats
path: root/test/widget-set-testutil
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2016-09-28 13:24:42 +0300
committerDenis Anisimov <denis@vaadin.com>2016-10-03 09:00:48 +0300
commit43bb825f0e7fbaa3a1382f85c9b2f6f6c4fe3ac4 (patch)
tree6ba789759db22c0d8042c4ede8d91593b648ed7e /test/widget-set-testutil
parentd6967afcbc87836464b39b22b2d424a336403952 (diff)
downloadvaadin-framework-43bb825f0e7fbaa3a1382f85c9b2f6f6c4fe3ac4.tar.gz
vaadin-framework-43bb825f0e7fbaa3a1382f85c9b2f6f6c4fe3ac4.zip
Migrating 7.7.1, 7.7.2, 7.7.3 to V8.
commit 11c3f8bd9ea65f7a7b8da9a282c31a127bd475a6 - Test and its UI class are added (both V8 and V7). Required functionality should be available via modern GWT version. commit 729dbf96fe76e7627168ab2c9d1d71c4eb7214c8 - About update release notes. No need to be included. commit 675f38349c43ac45dae40cf33a7b1fd0f8f261ca - V8 already contains correct Import-Packages section which uses osgi.javax.servlet.version variable whise version is 3.0.0 at the moment. commit 5da7c052f55cb4703b74f38f5bb19fc3f3fa2a76 - Use Vaadin plugin 7.7.0 from 7.7.0.alpha1. Is not applicable. commit 1df80001ab6c916effa917781dba652d09d01056 - Updated tutorial to Vaadin 7.7.0. Is not applicable. The tutorial already contains correct links and updated source code snippets. commit 8b4f0ed8a894b04902a5d4258119dcdc8e76d1e0 - set-property-fallback name="user.agent" value="safari". Is already there. commit 28ed04e827669cc4dd329331dac9699bd93f70bc - Fix animation end listeners so they are always removed. Is already there. commit 408253bc3f8bd3975f0525ce6832be214a3552e9 - Use servlet context classloader when finding servlet class for websockets. Is already there. commit 7a6f250d89474849648ed2ee96a6bfb78c3b9ca8 - Fire actions before removing menu from the DOM. Is already there. commit 9b66c6eb9bebf657d3f2def8c767e0e9d51cc92c - Do not run test on IE8 as IE8 is broken. Transplanted. commit 3faa43ff39ecda56587b93f0c5e262a2907871a7 - Discard for DateField when the data source contains null. It is not applicable for V8 (There is no anymore discard method in DateField (and no datasource suport in field)). Transplanted for DateField in compatibility. commit e0c1f91a3d6d1884e07ce8d1ba957aff6a9bf29a - Fix ComboBox paging when number of items equals page length. It's already done by another fix which replaced ComboBox in compatibility package to the V7 version. commit 83a1b8a0961cc9b2d43e01757530cefd035b0a22 - Update DOM and update escalator row count in the correct order. Transplanted. commit 45f2fba8ff7a4b62680618a325d4afcebfb7a1e9 - Prevent editor from being canceled while it is being saved. Transplanted to compatibility package. Is not applicable to modern Grid. commit ad67f7f43afb0feec5e029aea90297f2abe4f2c1 - Delete broken stylesheet and revert to default style until a new stylesheet is created. Is already there. commit c970a78d42a2d8f1745df7a11a74f3731f8be9a5 - Always show loading indicator for JavaScript RPC. Transplanted. commit 2aad3416061586f7e2649160bd832eefe03702ad - Make test independent of any converters present in the factory. It's already there. commit c9ad48430be135d18fe9f30868e091dd51c57b94 - Do not include yuicompressor for Sass compiler. Transplanted. Exclusion is added into vaadin/pom.xml commit 52d01a68e91ce73306b3a1747af97e928048ecdf - Test for Firefox download disconnecting push channel. Transplanted. commit 4bc375d1d21f468e6433da3a183150e0bfe0cae4 - Handle encoded URL characters correctly when constructing widget set name. Transplanted. commit 17ba88eaf87e15e6f3c729e5c7f8e875d5f86d8d - Update version to 7.7-SNAPSHOT. Is not applicable. commit 47b7b13e5c959de3bd925693b074d85e7625a87e - Ensure Firefox always updates the grid scrollbar. Transplanted. Made changes in the logic to the test for modern Grid component. commit 4d851ba21d1b8f35685b631d2845731f8fb33252 - Calculate column widths immediately if there is data. Transplanted to both client side modules. commit 8f0b1a1dd026a756912c9f21bd2b34ea46897c7f - Skip Maven enforcer plugin during demo validation. Transplanted (one build file is affected). commit 62815353e1b9d3cd126809f5c818ad35bf913807 - Build demos from 7.7 branch (now for master branch). FW8 demos are added (one build file is affected). commit 815d72115d5aaf3676daefd5642115577e4151ef - Make test pass on all browsers. Transplanted to both V7 and V8 version tests. commit 516c428ca127e3c31b7b4d74220e4b7eed4571be - Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit b00c580ed70f682a42afbfa91f978921bb86c2cd - Use correct column index when calculating min width during resize. Transplanted into both client side classes (main and compatibility) as is. Test for V7 is transplanted as is. Test for V8 is written from scratch based on V7 version. commit 7dd91cf057eb06a09009096a8278f34aad9bd8d9 - Fix regression that broke widget set compilation in 7.7.1. It's already there. commit c665731b0b97b697e80c47955d3558c19f0c81cb - Ensure temporary layout manager state is cleared at the end of a layout phase. Transplanted to the one LayoutManager class. commit 57a965251afdb5ee9ac1913a0101d854d8215aa6 - Fix assertion error when column widths are calculated. Transplanted to both versions of the client Grid widget. commit c5c52684eb30d924cb75a632b526a0f879d5a33c - Format Java files using Eclipse Neon and Vaadin settings. Only formatting changes. Is not transplanted. f5d06d877165bf413ec71c4fc88cf46c8c57a372 - Change javadoc to a style Eclipse formatter can handle. Transplanted to both versions of the client Grid widget. commit 6033e13c20b3d6e8b6f5add0f786d5ab2e1bb3fe - Make initially disabled grid work when enabled. Transplanted to both client side modules. commit a2d6e4fb4b1fd13e9a1b88f2ab1b78d14d8b64a9 - Use requestAnimationFrame when scrolling in Grid. Transplanted to both client side modules. commit fe9438e7b77c606855cfd739dd7e30b3f8cd4165 - Specify branch also for Sampler. Is not applicable for master branch. commit 1ec5d8ef7cb8bbd82bae1c9b79a376a5dca28f48 - Update to Chrome 53. Is already there. commit 961851bfbc4844474299433c34af6c9e4323d891 - Updated link to new step 1 video in tutorial. Is already there. commit 41dc2fe1611adc70d00e6f77debb2a6d4dcdefb0 - Revert "Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit 092b4f7f3192555fe3ae22ac03a89ac2ada2a2dd - Use widget set specified by init parameter. Transplanted to the common server side classes. commit 977cec7e3107c2da306d46449dbf32f6544313be - Fix widget set builder to create widget set in correct location. Transplanted to the one ClassPathExplorer class file. commit 6c12ad89ea1064cd4cc0456baca5ee00ae76d032 - Format project pom files using correct settings. Is not transplanted: only formatting changes for POM files. commit 0aad93ecc1ce743dffc093ce7ae2ef88831f6073 - Add tests for widgetset compilation in different modes. Transplanted. New test projects. commit 0a3a1ef8321ed421be2337034fdb1cae2c434c3d - Use versions-maven-plugin 2.3 to avoid NPE while setting project version. Is already there. Change-Id: Ie3a5088f25de1772f01ea30c4a5eba0b169ee0ab
Diffstat (limited to 'test/widget-set-testutil')
-rw-r--r--test/widget-set-testutil/pom.xml32
-rw-r--r--test/widget-set-testutil/src/main/java/com/vaadin/test/widgetset/AbstractTestWidgetSetUI.java39
-rw-r--r--test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java59
3 files changed, 130 insertions, 0 deletions
diff --git a/test/widget-set-testutil/pom.xml b/test/widget-set-testutil/pom.xml
new file mode 100644
index 0000000000..3dcc6db865
--- /dev/null
+++ b/test/widget-set-testutil/pom.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-test</artifactId>
+ <version>8.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>vaadin-test-widget-set-testutil</artifactId>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project> \ No newline at end of file
diff --git a/test/widget-set-testutil/src/main/java/com/vaadin/test/widgetset/AbstractTestWidgetSetUI.java b/test/widget-set-testutil/src/main/java/com/vaadin/test/widgetset/AbstractTestWidgetSetUI.java
new file mode 100644
index 0000000000..c03645517a
--- /dev/null
+++ b/test/widget-set-testutil/src/main/java/com/vaadin/test/widgetset/AbstractTestWidgetSetUI.java
@@ -0,0 +1,39 @@
+package com.vaadin.test.widgetset;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+
+public abstract class AbstractTestWidgetSetUI extends UI {
+
+ @Override
+ protected void init(VaadinRequest vaadinRequest) {
+ final VerticalLayout layout = new VerticalLayout();
+ final Label widgetsetInfo = new Label();
+ widgetsetInfo.setId("widgetsetinfo");
+ final TextField name = new TextField();
+ name.setCaption("Type your name here:");
+
+ Button button = new Button("Click Me");
+ button.addClickListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent clickEvent) {
+ layout.addComponent(
+ new Label("Thanks " + name.getValue() + ", it works!"));
+ }
+ });
+
+ getPage().getJavaScript().execute(
+ "widgetsetinfo.innerText=document.querySelector('iframe').id;");
+ layout.addComponents(widgetsetInfo, name, button);
+ layout.setMargin(true);
+ layout.setSpacing(true);
+
+ setContent(layout);
+ }
+
+} \ No newline at end of file
diff --git a/test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java b/test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java
new file mode 100644
index 0000000000..e84296819c
--- /dev/null
+++ b/test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java
@@ -0,0 +1,59 @@
+package com.vaadin.test.defaultwidgetset;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.phantomjs.PhantomJSDriver;
+
+import com.vaadin.testbench.ScreenshotOnFailureRule;
+import com.vaadin.testbench.TestBenchTestCase;
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.LabelElement;
+import com.vaadin.testbench.elements.TextFieldElement;
+
+public abstract class AbstractWidgetSetIT extends TestBenchTestCase {
+
+ @Rule
+ public ScreenshotOnFailureRule rule = new ScreenshotOnFailureRule(this,
+ true);
+
+ @Before
+ public void setup() {
+ // Screenshot rule tears down the driver
+ setDriver(new PhantomJSDriver());
+ }
+
+ protected void testAppStartsUserCanInteract(String expectedWidgetSet) {
+ getDriver().get("http://localhost:8080");
+
+ TextFieldElement nameInput = $(TextFieldElement.class).first();
+ nameInput.setValue("John Dåe");
+
+ $(ButtonElement.class).first().click();
+
+ Assert.assertEquals("Label shown", 2,
+ $(LabelElement.class).all().size());
+
+ Assert.assertEquals("Thanks John Dåe, it works!",
+ $(LabelElement.class).get(1).getText());
+
+ Assert.assertEquals(expectedWidgetSet,
+ findElement(By.id("widgetsetinfo")).getText());
+
+ }
+
+ protected void assertNoUnknownComponentShown() {
+ Assert.assertEquals(0,
+ findElements(By.className("vaadin-unknown-caption")).size());
+ }
+
+ protected void assertUnknownComponentShown(String componentClass) {
+ WebElement unknownComponentCaption = findElement(
+ By.className("vaadin-unknown-caption"));
+ Assert.assertTrue(unknownComponentCaption.getText().contains(
+ "does not contain implementation for " + componentClass));
+ }
+
+} \ No newline at end of file