From: Teemu Suo-Anttila Date: Mon, 4 May 2015 13:14:44 +0000 (+0300) Subject: Convert BooleanTextField test from TB2 to TB4 X-Git-Tag: 7.5.0.beta1~53 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7e4459bd1dd5e103e0e6dba76be85f67052b6bb1;p=vaadin-framework.git Convert BooleanTextField test from TB2 to TB4 Change-Id: Ib9061494db9e5537364525f55b55ea0820e68b31 --- diff --git a/uitest/src/com/vaadin/tests/fieldgroup/BooleanTextFieldTest.java b/uitest/src/com/vaadin/tests/fieldgroup/BooleanTextFieldTest.java new file mode 100644 index 0000000000..7a74deb2e0 --- /dev/null +++ b/uitest/src/com/vaadin/tests/fieldgroup/BooleanTextFieldTest.java @@ -0,0 +1,60 @@ +package com.vaadin.tests.fieldgroup; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; + +public class BooleanTextFieldTest extends BasicPersonFormTest { + + @Override + protected boolean requireWindowFocusForIE() { + return true; + } + + @Test + public void testSetBooleanTextField() throws Exception { + openTestURL(); + + getLastNameArea().clear(); + getLastNameArea().click(); + getLastNameArea().sendKeys("Dover"); + + assertBeanValuesUnchanged(); + + getDeceasedField().click(); + while (!getDeceasedField().getValue().isEmpty()) { + getDeceasedField().sendKeys(Keys.BACK_SPACE); + } + getDeceasedField().sendKeys("false", Keys.ENTER); + + /* error indicator */ + Assert.assertEquals("Incorrect amount of error indicators on page.", 1, + findElements(By.className("v-errorindicator")).size()); + Assert.assertEquals("false", getDeceasedField().getAttribute("value")); + + assertBeanValuesUnchanged(); + + /* error message in tooltip */ + getDeceasedField().showTooltip(); + Assert.assertEquals("Could not convert value to Boolean", + getTooltipErrorElement().getText()); + + getDeceasedField().click(); + while (!getDeceasedField().getValue().isEmpty()) { + getDeceasedField().sendKeys(Keys.BACK_SPACE); + } + getDeceasedField().sendKeys("YAY!", Keys.ENTER); + + /* no error indicator */ + Assert.assertFalse(isElementPresent(By.className("v-errorindicator"))); + + assertCommitSuccessful(); + + /* commit last name and new deceased status */ + showBeanValues(); + Assert.assertEquals( + "4. Person [firstName=John, lastName=Dover, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=true, salary=null, salaryDouble=null, rent=null]", + getLogRow(0)); + } +} diff --git a/uitest/tb2/com/vaadin/tests/fieldgroup/BooleanTextField.html b/uitest/tb2/com/vaadin/tests/fieldgroup/BooleanTextField.html deleted file mode 100644 index 92c03e14f4..0000000000 --- a/uitest/tb2/com/vaadin/tests/fieldgroup/BooleanTextField.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - -New Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
New Test
open/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication
screenCaptureinitial
mouseClickvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]90,38
enterCharactervaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]Dover
clickvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]
assertTextvaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_01. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]
dragvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]108,9
dropvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]0,587
mouseClickvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]-18,9
enterCharactervaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]false
mouseClickvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]239,14
assertCSSClassvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[7]/domChild[0]/domChild[1]/v-errorindicator
assertValuevaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]false
clickvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]
assertTextvaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_02. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]
showTooltipvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]0,0
assertTextvaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]Could not convert value to Boolean
mouseClickvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]66,6
typevaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]YAY!
assertElementNotPresentvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[7]/domChild[0]/domChild[1]v-errorindicator
clickvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]
closeNotificationvaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VNotification[0]0,0
clickvaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]
assertTextvaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_04. Person [firstName=John, lastName=Dover, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=true, salary=null, salaryDouble=null, rent=null]
- -