summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-05-04 16:14:44 +0300
committerTeemu Suo-Anttila <teemusa@vaadin.com>2015-05-04 16:14:44 +0300
commit7e4459bd1dd5e103e0e6dba76be85f67052b6bb1 (patch)
tree42ae9077ea44276254999432b1bb7cb3a37a9ee3 /uitest
parentdd05b436d9f74e9daa54829db3c73ff473d18acd (diff)
downloadvaadin-framework-7e4459bd1dd5e103e0e6dba76be85f67052b6bb1.tar.gz
vaadin-framework-7e4459bd1dd5e103e0e6dba76be85f67052b6bb1.zip
Convert BooleanTextField test from TB2 to TB4
Change-Id: Ib9061494db9e5537364525f55b55ea0820e68b31
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/fieldgroup/BooleanTextFieldTest.java60
-rw-r--r--uitest/tb2/com/vaadin/tests/fieldgroup/BooleanTextField.html141
2 files changed, 60 insertions, 141 deletions
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 @@
-<?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="" />
-<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.fieldgroup.BasicPersonForm?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>initial</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
- <td>90,38</td>
-</tr>
-<tr>
- <td>enterCharacter</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
- <td>Dover</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
- <td>1. 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]</td>
-</tr>
-<tr>
- <td>drag</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
- <td>108,9</td>
-</tr>
-<tr>
- <td>drop</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]</td>
- <td>0,587</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
- <td>-18,9</td>
-</tr>
-<tr>
- <td>enterCharacter</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
- <td>false</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]</td>
- <td>239,14</td>
-</tr>
-<!--error indicator-->
-<tr>
- <td>assertCSSClass</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[7]/domChild[0]/domChild[1]/</td>
- <td>v-errorindicator</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
- <td>false</td>
-</tr>
-<!--show bean values-->
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
- <td>2. 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]</td>
-</tr>
-<!--error message in tooltip-->
-<tr>
- <td>showTooltip</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]</td>
- <td>Could not convert value to Boolean</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
- <td>66,6</td>
-</tr>
-<tr>
- <td>type</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
- <td>YAY!</td>
-</tr>
-<!--no error indicator-->
-<tr>
- <td>assertElementNotPresent</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[7]/domChild[0]/domChild[1]</td>
- <td>v-errorindicator</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>closeNotification</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VNotification[0]</td>
- <td>0,0</td>
-</tr>
-<!--commit last name and new deceased status-->
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
- <td>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]</td>
-</tr>
-</tbody></table>
-</body>
-</html>