From 24d51f48d6c18752275bf647b609207c6b5e7f30 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 20 Dec 2011 10:26:36 +0000 Subject: Split test for #5655 to separate file to avoid issues with screenshots and changing dates svn changeset:22454/svn branch:6.8 --- .../tests/application/WebBrowserSizeTest.html | 44 +++++++++++++++++++++ .../tests/application/WebBrowserSizeTest.java | 45 ++++++++++++++++++++++ .../vaadin/tests/application/WebBrowserTest.html | 24 ++---------- .../vaadin/tests/application/WebBrowserTest.java | 20 ++++------ 4 files changed, 99 insertions(+), 34 deletions(-) create mode 100644 tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.html create mode 100644 tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java (limited to 'tests') diff --git a/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.html b/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.html new file mode 100644 index 0000000000..f04dd564bf --- /dev/null +++ b/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.html @@ -0,0 +1,44 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.application.WebBrowserTest?restartApplication
clickvaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]
assertTextvaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]7200000
assertTextvaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VLabel[0]0
assertTextvaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VLabel[0]Yes
+ + diff --git a/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java b/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java new file mode 100644 index 0000000000..f2726118d4 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java @@ -0,0 +1,45 @@ +package com.vaadin.tests.application; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; + +public class WebBrowserSizeTest extends TestBase { + + @Override + protected void setup() { + + final Label screenSizeLabel = new Label("n/a"); + screenSizeLabel.setCaption("Screen size"); + + final Label browserSizeLabel = new Label("n/a"); + browserSizeLabel.setCaption("Client (browser window) size"); + + final Button update = new Button("Refresh", new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + screenSizeLabel.setValue(getBrowser().getScreenWidth() + " x " + + getBrowser().getScreenHeight()); + browserSizeLabel.setValue(getBrowser().getClientWidth() + " x " + + getBrowser().getClientHeight()); + } + }); + + addComponent(update); + addComponent(screenSizeLabel); + addComponent(browserSizeLabel); + + } + + @Override + protected String getDescription() { + return "Verifies that browser sizes are reported correctly. Note that client width differs depending on browser decorations."; + } + + @Override + protected Integer getTicketNumber() { + return 5655; + } + +} diff --git a/tests/testbench/com/vaadin/tests/application/WebBrowserTest.html b/tests/testbench/com/vaadin/tests/application/WebBrowserTest.html index f4dd48f6d0..4648f6abb1 100644 --- a/tests/testbench/com/vaadin/tests/application/WebBrowserTest.html +++ b/tests/testbench/com/vaadin/tests/application/WebBrowserTest.html @@ -13,36 +13,18 @@ open - /run/com.vaadin.tests.application.WebBrowserTest?restartApplication + /run/com.vaadin.tests.application.WebBrowserSizeTest?restartApplication click - vaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0] + vaadin=runcomvaadintestsapplicationWebBrowserSizeTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0] - - - assertText - vaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0] - 7200000 - - - - assertText - vaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VLabel[0] - 0 - - - - assertText - vaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VLabel[0] - Yes - screenCapture - browserinfo + size diff --git a/tests/testbench/com/vaadin/tests/application/WebBrowserTest.java b/tests/testbench/com/vaadin/tests/application/WebBrowserTest.java index 33a70a942c..e95daf3144 100644 --- a/tests/testbench/com/vaadin/tests/application/WebBrowserTest.java +++ b/tests/testbench/com/vaadin/tests/application/WebBrowserTest.java @@ -35,12 +35,6 @@ public class WebBrowserTest extends TestBase { final Label containsLabel = new Label("n/a"); containsLabel.setCaption("Browser could be in Helsinki"); - final Label screenSizeLabel = new Label("n/a"); - screenSizeLabel.setCaption("Screen size"); - - final Label browserSizeLabel = new Label("n/a"); - browserSizeLabel.setCaption("Client (browser window) size"); - final Button update = new Button("Get TimeZone from browser", new Button.ClickListener() { @@ -78,14 +72,17 @@ public class WebBrowserTest extends TestBase { curDateLabel.setValue(getBrowser().getCurrentDate() .toString()); - screenSizeLabel.setValue(getBrowser().getScreenWidth() - + " x " + getBrowser().getScreenHeight()); - browserSizeLabel.setValue(getBrowser().getClientWidth() - + " x " + getBrowser().getClientHeight()); } }); addComponent(update); + addComponent(new Button("Hide non-static info", + new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + + } + })); addComponent(offsetLabel); addComponent(rawOffsetLabel); addComponent(dstDiffLabel); @@ -93,9 +90,6 @@ public class WebBrowserTest extends TestBase { addComponent(curDateLabel); addComponent(diffLabel); addComponent(containsLabel); - addComponent(screenSizeLabel); - addComponent(browserSizeLabel); - } @Override -- cgit v1.2.3