diff options
author | Artur Signell <artur.signell@itmill.com> | 2011-12-20 10:26:36 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2011-12-20 10:26:36 +0000 |
commit | 24d51f48d6c18752275bf647b609207c6b5e7f30 (patch) | |
tree | 3c03c4932798f01215191b186cb080af9609579f /tests | |
parent | 4e9bd2a49142d3dd87f380b1f6e458734c566f7d (diff) | |
download | vaadin-framework-24d51f48d6c18752275bf647b609207c6b5e7f30.tar.gz vaadin-framework-24d51f48d6c18752275bf647b609207c6b5e7f30.zip |
Split test for #5655 to separate file to avoid issues with screenshots and changing dates
svn changeset:22454/svn branch:6.8
Diffstat (limited to 'tests')
4 files changed, 99 insertions, 34 deletions
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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.application.WebBrowserTest?restartApplication</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<!-- Raw offset --> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td> + <td>7200000</td> +</tr> +<!-- offset to Helsinki --> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VLabel[0]</td> + <td>0</td> +</tr> +<!-- in Helsinki? --> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VLabel[0]</td> + <td>Yes</td> +</tr> +</tbody></table> +</body> +</html> 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 @@ </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.application.WebBrowserTest?restartApplication</td> + <td>/run/com.vaadin.tests.application.WebBrowserSizeTest?restartApplication</td> <td></td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestsapplicationWebBrowserSizeTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td> <td></td> </tr> -<!-- Raw offset --> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td> - <td>7200000</td> -</tr> -<!-- offset to Helsinki --> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VLabel[0]</td> - <td>0</td> -</tr> -<!-- in Helsinki? --> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsapplicationWebBrowserTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VLabel[0]</td> - <td>Yes</td> -</tr> <tr> <td>screenCapture</td> <td></td> - <td>browserinfo</td> + <td>size</td> </tr> </tbody></table> </body> 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
|