From: Artur Signell Date: Thu, 10 Jan 2013 17:38:08 +0000 (+0200) Subject: Test for CustomField required flag (#10656, #8797) X-Git-Tag: 7.0.0.rc1~22^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F19%2F619%2F2;p=vaadin-framework.git Test for CustomField required flag (#10656, #8797) Change-Id: I09e948a60816ab4b8b0fb28d9df7e90f36fbd30f --- 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);