aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTeemu Pòˆntelin <teemu@vaadin.com>2014-03-16 20:01:16 +0200
committerVaadin Code Review <review@vaadin.com>2014-03-31 06:50:14 +0000
commit3612ce1c294208dd85405c5e5956eca49e636d75 (patch)
tree2de1d16766073653faaa7b956872f0da2b77b5de /uitest
parentca5d053e20700f36db97874c3698e6d365c8cedb (diff)
downloadvaadin-framework-3612ce1c294208dd85405c5e5956eca49e636d75.tar.gz
vaadin-framework-3612ce1c294208dd85405c5e5956eca49e636d75.zip
Fixed aria-disabled attribute value on DateField button (#13463)
Change-Id: I9b13b76a92f0070c3b4c30556a276d60ceba94e8
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java48
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java43
2 files changed, 91 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java b/uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java
new file mode 100644
index 0000000000..c192b561cc
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.datefield;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.DateField;
+import com.vaadin.ui.VerticalLayout;
+
+public class AriaDisabled extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ VerticalLayout content = new VerticalLayout();
+ content.setMargin(true);
+ content.setSpacing(true);
+
+ final DateField disabledDateField = new DateField("Disabled DateField");
+ disabledDateField.setEnabled(false);
+
+ setContent(content);
+ content.addComponent(disabledDateField);
+ content.addComponent(new DateField("Enabled DateField"));
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Test for aria-disabled attribute on DateField.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 13463;
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java b/uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java
new file mode 100644
index 0000000000..823638ef0c
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.datefield;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.By;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class AriaDisabledTest extends MultiBrowserTest {
+
+ @Test
+ public void verifyAriaDisabledAttributes() {
+ openTestURL();
+
+ // Expect aria-disabled="false" on the enabled DateField.
+ String ariaDisabled = driver.findElement(
+ By.vaadin("/VVerticalLayout[0]/VPopupCalendar[1]#popupButton"))
+ .getAttribute("aria-disabled");
+ assertEquals("false", ariaDisabled);
+
+ // Expect aria-disabled="true" on the disabled DateField.
+ ariaDisabled = driver.findElement(By.cssSelector(".v-disabled button"))
+ .getAttribute("aria-disabled");
+ assertEquals("true", ariaDisabled);
+ }
+
+}