diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index 802bb2d8123..9df67582693 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -24,7 +24,7 @@ 1.8 local 1.0-SNAPSHOT - 5.1-SNAPSHOT + 5.0.0 4.0.0 2.0.1 diff --git a/integration-tests/reference-screenshots/initialBarChartUI_xp_chrome_58.png b/integration-tests/reference-screenshots/initialBarChartUI_xp_chrome_58.png new file mode 100644 index 00000000000..8d08c54852c Binary files /dev/null and b/integration-tests/reference-screenshots/initialBarChartUI_xp_chrome_58.png differ diff --git a/integration-tests/reference-screenshots/initialPieChartUI_xp_chrome_58.png b/integration-tests/reference-screenshots/initialPieChartUI_xp_chrome_58.png new file mode 100644 index 00000000000..188ff8479b4 Binary files /dev/null and b/integration-tests/reference-screenshots/initialPieChartUI_xp_chrome_58.png differ diff --git a/integration-tests/reference-screenshots/initialTimeLineUI_xp_chrome_58.png b/integration-tests/reference-screenshots/initialTimeLineUI_xp_chrome_58.png new file mode 100644 index 00000000000..5b19635f78e Binary files /dev/null and b/integration-tests/reference-screenshots/initialTimeLineUI_xp_chrome_58.png differ diff --git a/integration-tests/reference-screenshots/middleBarChartUI_xp_chrome_58.png b/integration-tests/reference-screenshots/middleBarChartUI_xp_chrome_58.png new file mode 100644 index 00000000000..8f03be4cca5 Binary files /dev/null and b/integration-tests/reference-screenshots/middleBarChartUI_xp_chrome_58.png differ diff --git a/integration-tests/reference-screenshots/middlePieChartUI_xp_chrome_58.png b/integration-tests/reference-screenshots/middlePieChartUI_xp_chrome_58.png new file mode 100644 index 00000000000..88bb7c4210d Binary files /dev/null and b/integration-tests/reference-screenshots/middlePieChartUI_xp_chrome_58.png differ diff --git a/integration-tests/reference-screenshots/middleTimeLineUI_xp_chrome_58.png b/integration-tests/reference-screenshots/middleTimeLineUI_xp_chrome_58.png new file mode 100644 index 00000000000..6cc40d5c3ec Binary files /dev/null and b/integration-tests/reference-screenshots/middleTimeLineUI_xp_chrome_58.png differ diff --git a/integration-tests/reference-screenshots/smallBarChartUI_xp_chrome_58.png b/integration-tests/reference-screenshots/smallBarChartUI_xp_chrome_58.png new file mode 100644 index 00000000000..6be44b23de4 Binary files /dev/null and b/integration-tests/reference-screenshots/smallBarChartUI_xp_chrome_58.png differ diff --git a/integration-tests/reference-screenshots/smallPieChartUI_xp_chrome_58.png b/integration-tests/reference-screenshots/smallPieChartUI_xp_chrome_58.png new file mode 100644 index 00000000000..07a2a6e0529 Binary files /dev/null and b/integration-tests/reference-screenshots/smallPieChartUI_xp_chrome_58.png differ diff --git a/integration-tests/reference-screenshots/smallTimeLineUI_xp_chrome_58.png b/integration-tests/reference-screenshots/smallTimeLineUI_xp_chrome_58.png new file mode 100644 index 00000000000..2ae998c6dea Binary files /dev/null and b/integration-tests/reference-screenshots/smallTimeLineUI_xp_chrome_58.png differ diff --git a/integration-tests/src/main/java/com/vaadin/addon/board/testUI/AbstractTestCompUI.java b/integration-tests/src/main/java/com/vaadin/addon/board/testUI/AbstractTestCompUI.java index 9fc828a8fb2..d316cf86f3b 100644 --- a/integration-tests/src/main/java/com/vaadin/addon/board/testUI/AbstractTestCompUI.java +++ b/integration-tests/src/main/java/com/vaadin/addon/board/testUI/AbstractTestCompUI.java @@ -12,8 +12,9 @@ import com.vaadin.ui.VerticalLayout; public abstract class AbstractTestCompUI extends AbstractTestUI { - String PX1024 = "setSizeFull"; - String PX0512 = (3 * 128) + "px"; + public static String FULL_SIZE_BTN = "setSizeFull"; + public static String MIDDLE_SIZE_BTN = "700px"; + public static String SMALL_SIZE_BTN = "400px"; public static String SWITCH = "switch"; public static String ID_PREFIX = "test-component-"; @@ -26,26 +27,30 @@ protected void init(VaadinRequest request) { int i = 0; for (final Component component : components) { component.setId(ID_PREFIX + i++); - component.setSizeFull(); } final Row row = board.addRow(components); final AbstractOrderedLayout baseLayout = new VerticalLayout(); - final Button button1024 = new Button(PX1024, + final Button btnFullSize = new Button(FULL_SIZE_BTN, (Button.ClickListener) clickEvent -> UI.getCurrent().setSizeFull()); - button1024.setSizeFull(); + btnFullSize.setSizeFull(); - final Button button0512 = new Button(PX0512, + final Button btnMiddleSize = new Button(MIDDLE_SIZE_BTN, (Button.ClickListener) clickEvent - -> UI.getCurrent().setWidth((2 * 128), PIXELS)); - button0512.setSizeFull(); - + -> UI.getCurrent().setWidth(700, PIXELS)); + btnMiddleSize.setSizeFull(); + btnMiddleSize.setId(MIDDLE_SIZE_BTN); + final Button btnSmallSize = new Button(SMALL_SIZE_BTN, + (Button.ClickListener) clickEvent + -> UI.getCurrent().setWidth(400, PIXELS)); + btnSmallSize.setSizeFull(); + btnSmallSize.setId(SMALL_SIZE_BTN); final Button buttonSwitch = new Button(SWITCH, (Button.ClickListener) clickEvent -> row.setCols(components[1], (row.getCols(components[1]) > 1) ? 1 : 2)); buttonSwitch.setSizeFull(); - baseLayout.addComponents(board, button1024, button0512, buttonSwitch); + baseLayout.addComponents(board, btnFullSize,btnMiddleSize, btnSmallSize, buttonSwitch); setContent(baseLayout); } diff --git a/integration-tests/src/main/java/com/vaadin/addon/board/testUI/CompatBasicChartUI.java b/integration-tests/src/main/java/com/vaadin/addon/board/testUI/CompatBasicChartUI.java index 79c54d5df9c..f368fa9229a 100644 --- a/integration-tests/src/main/java/com/vaadin/addon/board/testUI/CompatBasicChartUI.java +++ b/integration-tests/src/main/java/com/vaadin/addon/board/testUI/CompatBasicChartUI.java @@ -15,7 +15,12 @@ public abstract class CompatBasicChartUI extends AbstractTestCompUI { @Override protected Component[] createTestedComponents() { - Component[] comps={nextChartInstance(),nextChartInstance(),nextChartInstance()}; + Component[] comps={ + nextChartInstance(), + nextChartInstance(), + nextChartInstance(), + nextChartInstance() + }; return comps; } diff --git a/integration-tests/src/main/java/com/vaadin/addon/board/testUI/CompatChartComponents.java b/integration-tests/src/main/java/com/vaadin/addon/board/testUI/CompatChartComponents.java index 5a341608605..9e6dbfa611b 100644 --- a/integration-tests/src/main/java/com/vaadin/addon/board/testUI/CompatChartComponents.java +++ b/integration-tests/src/main/java/com/vaadin/addon/board/testUI/CompatChartComponents.java @@ -6,11 +6,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Random; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.logging.Level; -import java.util.logging.Logger; import com.fasterxml.jackson.databind.ObjectMapper; import com.vaadin.addon.charts.Chart; @@ -33,12 +28,9 @@ import com.vaadin.addon.charts.model.PlotOptionsColumn; import com.vaadin.addon.charts.model.PlotOptionsPie; import com.vaadin.addon.charts.model.PlotOptionsSeries; -import com.vaadin.addon.charts.model.PlotOptionsSolidgauge; import com.vaadin.addon.charts.model.PlotOptionsSpline; import com.vaadin.addon.charts.model.RangeSelector; import com.vaadin.addon.charts.model.Series; -import com.vaadin.addon.charts.model.SeriesTooltip; -import com.vaadin.addon.charts.model.Stop; import com.vaadin.addon.charts.model.Tooltip; import com.vaadin.addon.charts.model.VerticalAlign; import com.vaadin.addon.charts.model.XAxis; @@ -48,7 +40,6 @@ import com.vaadin.addon.charts.model.style.SolidColor; import com.vaadin.addon.charts.model.style.Style; import com.vaadin.ui.Component; -import com.vaadin.ui.UI; /** * @@ -280,8 +271,6 @@ protected Component nextChartInstance() { } } - - //DASH-111 public static class GaugeUI extends CompatBasicChartUI { @Override protected Component nextChartInstance() { @@ -320,83 +309,14 @@ protected Component nextChartInstance() { yaxis.getTitle().setY(- 70); yaxis.setLabels(new Labels()); yaxis.getLabels().setY(16); - Stop stop1 = new Stop(0.1f, SolidColor.GREEN); - Stop stop2 = new Stop(0.5f, SolidColor.YELLOW); - Stop stop3 = new Stop(0.9f, SolidColor.RED); - yaxis.setStops(stop1, stop2, stop3); - - PlotOptionsSolidgauge plotOptions = new PlotOptionsSolidgauge(); - plotOptions.setTooltip(new SeriesTooltip()); - plotOptions.getTooltip().setValueSuffix(" km/h"); - DataLabels labels = new DataLabels(); - labels.setY(5); - labels.setBorderWidth(0); - labels.setUseHTML(true); - labels.setFormat("
{y}
" - + " km/h
"); - plotOptions.setDataLabels(labels); - configuration.setPlotOptions(plotOptions); final ListSeries series = new ListSeries("Speed", 80); configuration.setSeries(series); - runWhileAttached(chart, new Runnable() { - Random r = new Random(0); - - @Override - public void run() { - Integer oldValue = series.getData()[0].intValue(); - Integer newValue = (int) (oldValue + (r.nextDouble() - 0.5) * 20.0); - if (newValue > 200) { - newValue = 200; - } else if (newValue < 0) { - newValue = 0; - } - series.updatePoint(0, newValue); - } - }, 3000, 12000); - chart.drawChart(configuration); return chart; } - public static void runWhileAttached(final Component component, - final Runnable task, final int interval, final int initialPause) { - // Until reliable push available in our demo servers - UI.getCurrent().setPollInterval(interval); - - final Thread thread = new Thread() { - @Override - public void run() { - try { - Thread.sleep(initialPause); - while (component.getUI() != null) { - Future future = component.getUI().access(task); - future.get(); - Thread.sleep(interval); - } - } catch (InterruptedException e) { - } catch (ExecutionException e) { - Logger.getLogger(this.getClass().getName()) - .log(Level.WARNING, - "Stopping repeating command due to an exception", - e); - } catch (com.vaadin.ui.UIDetachedException e) { - } catch (Exception e) { - Logger.getLogger(this.getClass().getName()) - .log(Level.WARNING, - "Unexpected exception while running scheduled update", - e); - } - Logger.getLogger(this.getClass().getName()).log(Level.INFO, - "Thread stopped"); - } - - ; - }; - thread.start(); - } - } diff --git a/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/AbstractParallelTest.java b/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/AbstractParallelTest.java index 376702833be..415c15e4973 100644 --- a/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/AbstractParallelTest.java +++ b/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/AbstractParallelTest.java @@ -27,11 +27,6 @@ @RunOnHub("tb3-hub.intra.itmill.com") public abstract class AbstractParallelTest extends ParallelTest { - @BeforeClass - public static void setUp() throws Exception { - readTestbenchProperties(); - } - public Supplier buttonSwitchSupplier = () -> $(ButtonElement.class) .caption(AbstractTestCompUI.SWITCH).first(); diff --git a/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/BarIT.java b/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/BarIT.java new file mode 100644 index 00000000000..13e39cc45c4 --- /dev/null +++ b/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/BarIT.java @@ -0,0 +1,10 @@ +package com.vaadin.addon.board.testbenchtests; + +import com.vaadin.addon.board.testUI.CompatChartComponents; + +public class BarIT extends CompatChartsUIIT{ + @Override + protected Class getUIClass() { + return CompatChartComponents.BarChartUI.class; + } +} diff --git a/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/CompatChartsUIIT.java b/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/CompatChartsUIIT.java new file mode 100644 index 00000000000..44fc9a699b3 --- /dev/null +++ b/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/CompatChartsUIIT.java @@ -0,0 +1,35 @@ +package com.vaadin.addon.board.testbenchtests; + +import java.util.function.Supplier; + +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.addon.board.testUI.AbstractTestCompUI; +import com.vaadin.testbench.elements.ButtonElement; + +/** + * + */ +public abstract class CompatChartsUIIT extends AbstractParallelTest { + + //Unfortunatelly we can not used + //Parametrized Runner, because Testbench already uses Parallel Runner + Supplier smallSizeButton = () -> $(ButtonElement.class) + .id(AbstractTestCompUI.SMALL_SIZE_BTN); + + @Test + public void testScreenshot() throws Exception { + String chartType= getUIClass().getSimpleName(); + compareScreen("initial"+chartType); + + $(ButtonElement.class).id(AbstractTestCompUI.MIDDLE_SIZE_BTN).click(); + compareScreen("middle"+chartType); + + $(ButtonElement.class).id(AbstractTestCompUI.SMALL_SIZE_BTN).click(); + compareScreen("small"+chartType); + + } + + +} diff --git a/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/GaugeIT.java b/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/GaugeIT.java new file mode 100644 index 00000000000..970621a4418 --- /dev/null +++ b/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/GaugeIT.java @@ -0,0 +1,19 @@ +package com.vaadin.addon.board.testbenchtests; + +import org.junit.Ignore; +import org.junit.Test; + +import com.vaadin.addon.board.testUI.CompatChartComponents; + +public class GaugeIT extends CompatChartsUIIT{ + @Override + protected Class getUIClass() { + return CompatChartComponents.GaugeUI.class; + } + + @Ignore + @Test + public void testScreenshot() throws Exception{ + throw new Exception("Gauge chart is broken"); + } +} diff --git a/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/PieIT.java b/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/PieIT.java new file mode 100644 index 00000000000..3e7ced3556a --- /dev/null +++ b/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/PieIT.java @@ -0,0 +1,10 @@ +package com.vaadin.addon.board.testbenchtests; + +import com.vaadin.addon.board.testUI.CompatChartComponents; + +public class PieIT extends CompatChartsUIIT{ + @Override + protected Class getUIClass() { + return CompatChartComponents.PieChartUI.class; + } +} diff --git a/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/TimeLineIT.java b/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/TimeLineIT.java new file mode 100644 index 00000000000..859a671f074 --- /dev/null +++ b/integration-tests/src/test/java/com/vaadin/addon/board/testbenchtests/TimeLineIT.java @@ -0,0 +1,10 @@ +package com.vaadin.addon.board.testbenchtests; + +import com.vaadin.addon.board.testUI.CompatChartComponents; + +public class TimeLineIT extends CompatChartsUIIT{ + @Override + protected Class getUIClass() { + return CompatChartComponents.TimeLineUI.class; + } +} diff --git a/vaadin-board-flow-parent/pom.xml b/vaadin-board-flow-parent/pom.xml index e25c5848105..b016892947d 100644 --- a/vaadin-board-flow-parent/pom.xml +++ b/vaadin-board-flow-parent/pom.xml @@ -9,7 +9,8 @@ 1.0-SNAPSHOT vaadin-board-root - 8.1.0.beta1 + + 8.1-SNAPSHOT ${vaadin.version}