From d8bb481a75a3b21e2652e94f2343e53e5edfdb3f Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 10 Jan 2013 19:38:08 +0200 Subject: [PATCH] Test for CustomField required flag (#10656, #8797) Change-Id: I09e948a60816ab4b8b0fb28d9df7e90f36fbd30f --- .../tests/components/AddressFormExample.html | 72 +++++++++++++++++++ .../customfield/AddressFormExample.java | 4 ++ 2 files changed, 76 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/AddressFormExample.html diff --git a/uitest/src/com/vaadin/tests/components/AddressFormExample.html b/uitest/src/com/vaadin/tests/components/AddressFormExample.html new file mode 100644 index 0000000000..5f1893a33c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/AddressFormExample.html @@ -0,0 +1,72 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.customfield.AddressFormExample?restartApplication
assertValuevaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]Ruukinkatu 2-4
assertValuevaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[1]20,540
assertValuevaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]Turku
assertTextvaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VButton[0]/domChild[0]/domChild[0]Save
assertTextvaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCustomComponent[0]/VForm[0]/domChild[0]/domChild[0]/domChild[0]Address
assertTextvaadin=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]Street Address
assertTextvaadin=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]Postal Code
assertTextvaadin=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]City
assertTextvaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/domChild[0]/domChild[1]/domChild[0]exact:*
assertCSSClassvaadin=runcomvaadintestscomponentscustomfieldAddressFormExample::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/domChild[0]/domChild[1]/domChild[0]v-required-field-indicator
+ + diff --git a/uitest/src/com/vaadin/tests/components/customfield/AddressFormExample.java b/uitest/src/com/vaadin/tests/components/customfield/AddressFormExample.java index 693b1e11b1..e5ac67b32e 100644 --- a/uitest/src/com/vaadin/tests/components/customfield/AddressFormExample.java +++ b/uitest/src/com/vaadin/tests/components/customfield/AddressFormExample.java @@ -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); -- 2.39.5