diff options
author | John Ahlroos <john@vaadin.com> | 2012-10-09 16:59:59 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2012-10-09 16:59:59 +0300 |
commit | 31298fee7d1edd87af3affe7654fb8bf364cfb2a (patch) | |
tree | fc62857439dd3556c3d79baa66491df77d59fd05 | |
parent | 2bced3979f169a415756952f70e05c13d8d31cb7 (diff) | |
download | vaadin-framework-31298fee7d1edd87af3affe7654fb8bf364cfb2a.tar.gz vaadin-framework-31298fee7d1edd87af3affe7654fb8bf364cfb2a.zip |
Added test to confirm primary stylenames work with TextField #9896
Change-Id: I8cbbc5936151bdaee809741b225ddb79bb829b6c
-rw-r--r-- | uitest/src/com/vaadin/tests/components/textfield/TextFieldPrimaryStyleName | 47 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/textfield/TextFieldPrimaryStyleName.java | 36 |
2 files changed, 83 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextFieldPrimaryStyleName b/uitest/src/com/vaadin/tests/components/textfield/TextFieldPrimaryStyleName new file mode 100644 index 0000000000..9c99d86a91 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/textfield/TextFieldPrimaryStyleName @@ -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="http://localhost: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.textfield.TextFieldPrimaryStyleName?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldPrimaryStyleName::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTextField[0]</td> + <td>my-textfield</td> +</tr> +<tr> + <td>assertNotCSSClass</td> + <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldPrimaryStyleName::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTextField[0]</td> + <td>v-textfield</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldPrimaryStyleName::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldPrimaryStyleName::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTextField[0]</td> + <td>my-dynamic-textfield</td> +</tr> +<tr> + <td>assertNotCSSClass</td> + <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldPrimaryStyleName::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTextField[0]</td> + <td>my-textfield</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextFieldPrimaryStyleName.java b/uitest/src/com/vaadin/tests/components/textfield/TextFieldPrimaryStyleName.java new file mode 100644 index 0000000000..5746f74b5a --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/textfield/TextFieldPrimaryStyleName.java @@ -0,0 +1,36 @@ +package com.vaadin.tests.components.textfield; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.TextField; + +public class TextFieldPrimaryStyleName extends TestBase { + + @Override + protected void setup() { + final TextField field = new TextField(); + field.setPrimaryStyleName("my-textfield"); + addComponent(field); + + addComponent(new Button("Change primary style name", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + field.setPrimaryStyleName("my-dynamic-textfield"); + } + })); + + } + + @Override + protected String getDescription() { + return "Textfield should support setting the primary stylename both initially and dynamically"; + } + + @Override + protected Integer getTicketNumber() { + return 9896; + } + +} |