diff options
author | Build Agent <build@vaadin.com> | 2014-03-31 09:57:14 +0300 |
---|---|---|
committer | Build Agent <build@vaadin.com> | 2014-03-31 09:57:15 +0300 |
commit | 7a91d29097e606a7e2dc4440443cb21ae7dfa61b (patch) | |
tree | 9ca14ddcb808b5fe1dac963359d9c1426d5c55dd /uitest | |
parent | 26b897dc71b8d1b0ddf4a4d671318a7c088f652e (diff) | |
parent | 3612ce1c294208dd85405c5e5956eca49e636d75 (diff) | |
download | vaadin-framework-7a91d29097e606a7e2dc4440443cb21ae7dfa61b.tar.gz vaadin-framework-7a91d29097e606a7e2dc4440443cb21ae7dfa61b.zip |
Merge changes from origin/7.1
3612ce1 Fixed aria-disabled attribute value on DateField button (#13463)
Change-Id: I888e9bed47ae2a540161786791d546b2fd0f85cf
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java | 48 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java | 43 |
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); + } + +} |