]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test for CustomField required flag (#10656, #8797) 19/619/2
authorArtur Signell <artur@vaadin.com>
Thu, 10 Jan 2013 17:38:08 +0000 (19:38 +0200)
committerArtur Signell <artur@vaadin.com>
Mon, 14 Jan 2013 12:58:27 +0000 (14:58 +0200)
Change-Id: I09e948a60816ab4b8b0fb28d9df7e90f36fbd30f

uitest/src/com/vaadin/tests/components/AddressFormExample.html [new file with mode: 0644]
uitest/src/com/vaadin/tests/components/customfield/AddressFormExample.java

diff --git a/uitest/src/com/vaadin/tests/components/AddressFormExample.html b/uitest/src/com/vaadin/tests/components/AddressFormExample.html
new file mode 100644 (file)
index 0000000..5f1893a
--- /dev/null
@@ -0,0 +1,72 @@
+<?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.customfield.AddressFormExample?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertValue</td>
+       <td>vaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td>
+       <td>Ruukinkatu 2-4</td>
+</tr>
+<tr>
+       <td>assertValue</td>
+       <td>vaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[1]</td>
+       <td>20,540</td>
+</tr>
+<tr>
+       <td>assertValue</td>
+       <td>vaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+       <td>Turku</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td>Save</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCustomComponent[0]/VForm[0]/domChild[0]/domChild[0]/domChild[0]</td>
+       <td>Address</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+       <td>Street Address</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/domChild[0]/domChild[1]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td>
+       <td>Postal Code</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[0]</td>
+       <td>City</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/domChild[0]/domChild[1]/domChild[0]</td>
+       <td>exact:*</td>
+</tr>
+<tr>
+       <td>assertCSSClass</td>
+       <td>vaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/domChild[0]/domChild[1]/domChild[0]</td>
+       <td>v-required-field-indicator</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
index 693b1e11b17c0325b69b3b31a22662682468e509..e5ac67b32ee348a9710586f457859214215f777a 100644 (file)
@@ -1,5 +1,7 @@
 package com.vaadin.tests.components.customfield;
 
+import java.util.Locale;
+
 import com.vaadin.tests.components.TestBase;
 import com.vaadin.tests.util.Address;
 import com.vaadin.ui.Button;
@@ -14,9 +16,11 @@ public class AddressFormExample extends TestBase {
 
     @Override
     protected void setup() {
+        getMainWindow().setLocale(Locale.ENGLISH);
         Address address = new Address("Ruukinkatu 2-4", 20540, "Turku");
         final AddressField field = new AddressField();
         field.setValue(address);
+        field.setRequired(true);
 
         addComponent(field);