summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2014-04-01 20:26:46 +0300
committerVaadin Code Review <review@vaadin.com>2014-04-15 10:51:06 +0000
commit0cb1704336a10653bde82aa0470c25c49539f38b (patch)
tree4397e9758aabc4c8a2aa56cb07807d1e1b1a4023 /uitest
parent4a3fe8e346ba2f3376492836763383d53e9be689 (diff)
downloadvaadin-framework-0cb1704336a10653bde82aa0470c25c49539f38b.tar.gz
vaadin-framework-0cb1704336a10653bde82aa0470c25c49539f38b.zip
Disable/enable text field for DateField on setEnable() method (#13124).
Change-Id: I49222e44f75ff228219042360f1764077da1016c
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java3
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java32
2 files changed, 29 insertions, 6 deletions
diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java
index cf09ff029d..2140b0007e 100644
--- a/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java
+++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java
@@ -35,7 +35,6 @@ public class DisabledParentLayout extends AbstractTestUI {
content.setMargin(true);
final VerticalLayout pane = new VerticalLayout();
- pane.setEnabled(false);
pane.addComponent(new DateField());
content.addComponent(pane);
@@ -44,7 +43,7 @@ public class DisabledParentLayout extends AbstractTestUI {
button.addClickListener(new Button.ClickListener() {
@Override
public void buttonClick(Button.ClickEvent event) {
- pane.setEnabled(true);
+ pane.setEnabled(!pane.isEnabled());
}
});
content.addComponent(button);
diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java
index 3ee4544693..b511ca168a 100644
--- a/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java
+++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java
@@ -35,17 +35,41 @@ public class DisabledParentLayoutTest extends MultiBrowserTest {
WebElement button = driver.findElement(By.className("v-button"));
button.click();
+ WebElement textField = driver.findElement(By
+ .className("v-datefield-textfield"));
+ textField.click();
+
+ Assert.assertFalse(
+ "Date input text field shoud be disabled for disabled DateField",
+ textField.isEnabled());
+
WebElement dataFieldButton = driver.findElement(By
.className("v-datefield-button"));
dataFieldButton.click();
- WebElement popup = driver
- .findElement(By.className("v-datefield-popup"));
+ Assert.assertFalse(
+ "Disabled date popup is opened after click to its button",
+ isElementPresent(By.className("v-datefield-popup")));
+
+ button.click();
+
+ Assert.assertTrue(
+ "Date input text field shoud be enabled for enabled DateField",
+ textField.isEnabled());
+ textField.click();
+ String text = "text";
+ textField.sendKeys(text);
+
+ Assert.assertEquals("Unexpected text in date text field", text,
+ textField.getAttribute("value"));
+
+ dataFieldButton.click();
Assert.assertFalse("Unexpected disabled element found",
isElementPresent(By.className("v-disabled")));
- Assert.assertNotNull(
- "Date popup is not opened after click to its button", popup);
+ Assert.assertTrue("Date popup is not opened after click to its button",
+ isElementPresent(By.className("v-datefield-popup")));
}
+
}