summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-04-26 08:52:41 +0000
committerLeif Åstrand <leif@vaadin.com>2012-04-26 08:52:41 +0000
commit11cdb557957ee6e9eed30105341ed7dc2c3a6377 (patch)
treeab479cf1f9cca76f3b9d13dd4c3a7799a1fbf7d1 /tests
parente3695e3c38fe75630bf840f918324d73a1cfe2e6 (diff)
downloadvaadin-framework-11cdb557957ee6e9eed30105341ed7dc2c3a6377.tar.gz
vaadin-framework-11cdb557957ee6e9eed30105341ed7dc2c3a6377.zip
Add support for html in buttons (#8663)
svn changeset:23634/svn branch:6.8
Diffstat (limited to 'tests')
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonHtml.html47
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java39
-rw-r--r--tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.html47
-rw-r--r--tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.java41
4 files changed, 174 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.html b/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.html
new file mode 100644
index 0000000000..2d58d0e2e1
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.html
@@ -0,0 +1,47 @@
+<?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>ButtonHtml</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">ButtonHtml</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.button.ButtonHtml?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonHtml::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>after_1_click</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonHtml::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>after_2_clicks</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java b/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java
new file mode 100644
index 0000000000..253de5b43c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java
@@ -0,0 +1,39 @@
+package com.vaadin.tests.components.button;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+
+public class ButtonHtml extends TestBase {
+
+ @Override
+ protected void setup() {
+ Button b = new Button("<b>Plain text button</b>");
+ addComponent(b);
+
+ b = new Button(
+ "<span style=\"color: red; font-weight: bold;\">HTML</span> button");
+ b.setHtmlContentAllowed(true);
+ addComponent(b);
+
+ final Button swapButton = new Button("<i>Swap button<i>");
+ swapButton.addListener(new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ swapButton.setHtmlContentAllowed(!swapButton
+ .isHtmlContentAllowed());
+ }
+ });
+ addComponent(swapButton);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Verify that Button HTML rendering works";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8663;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.html b/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.html
new file mode 100644
index 0000000000..8a1b21c35d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.html
@@ -0,0 +1,47 @@
+<?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>NativeButtonHtml</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">NativeButtonHtml</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.nativebutton.NativeButtonHtml?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonHtml::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VNativeButton[0]</td>
+ <td>116,9</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>after_1_click</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonHtml::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VNativeButton[0]</td>
+ <td>74,10</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>after_2_clicks</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.java b/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.java
new file mode 100644
index 0000000000..011439f810
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.java
@@ -0,0 +1,41 @@
+package com.vaadin.tests.components.nativebutton;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.NativeButton;
+
+public class NativeButtonHtml extends TestBase {
+
+ @Override
+ protected void setup() {
+ NativeButton b = new NativeButton("<b>Plain text button</b>");
+ addComponent(b);
+
+ b = new NativeButton(
+ "<span style=\"color: red; font-weight: bold;\">HTML</span> button");
+ b.setHtmlContentAllowed(true);
+ addComponent(b);
+
+ final NativeButton swapButton = new NativeButton("<i>Swap button<i>");
+ swapButton.addListener(new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ swapButton.setHtmlContentAllowed(!swapButton
+ .isHtmlContentAllowed());
+ }
+ });
+ addComponent(swapButton);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Verify that NativeButton HTML rendering works";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // 8663 was for normal button (see ButtonHtml test)
+ return null;
+ }
+}