]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test for repainting Window contents (#8832, #8943)
authorArtur Signell <artur@vaadin.com>
Wed, 13 Jun 2012 06:39:01 +0000 (09:39 +0300)
committerArtur Signell <artur@vaadin.com>
Thu, 21 Jun 2012 14:11:23 +0000 (17:11 +0300)
tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.html [new file with mode: 0644]
tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java [new file with mode: 0644]

diff --git a/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.html b/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.html
new file mode 100644 (file)
index 0000000..9cbcf1d
--- /dev/null
@@ -0,0 +1,57 @@
+<?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="http://arturwin.office.itmill.com:8888/" />
+<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.components.window.RepaintWindowContents?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td>Button 1</td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td>Button 2</td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td>Button 1</td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td>Button 2</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java b/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java
new file mode 100644 (file)
index 0000000..353eb53
--- /dev/null
@@ -0,0 +1,56 @@
+package com.vaadin.tests.components.window;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+
+public class RepaintWindowContents extends AbstractTestRoot {
+    private static final long serialVersionUID = 1L;
+
+    @SuppressWarnings("serial")
+    @Override
+    protected void setup(WrappedRequest request) {
+        final Window window = new Window("Test window");
+        addWindow(window);
+
+        final Layout layout1 = new VerticalLayout();
+        Button button1 = new Button("Button 1");
+        layout1.addComponent(button1);
+
+        final Layout layout2 = new VerticalLayout();
+        Button button2 = new Button("Button 2");
+        layout2.addComponent(button2);
+
+        window.setContent(layout1);
+
+        button1.addListener(new ClickListener() {
+
+            public void buttonClick(ClickEvent event) {
+                window.setContent(layout2);
+            }
+        });
+
+        button2.addListener(new ClickListener() {
+
+            public void buttonClick(ClickEvent event) {
+                window.setContent(layout1);
+            }
+        });
+    }
+
+    @Override
+    protected String getTestDescription() {
+        return "Clicking the button switches the content between content1 and content2";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 8832;
+    }
+
+}
\ No newline at end of file