diff options
author | michaelvogt <michael@vaadin.com> | 2013-04-11 13:47:51 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-04-11 12:46:07 +0000 |
commit | c89b2e6556b1432cb2b5f9de2868f3104b7ff000 (patch) | |
tree | 54e62382fbef04e66d29fa2d45100135da3059a4 /uitest | |
parent | 2fcb0ba40f862f5a341397ca6e275d414efdb429 (diff) | |
download | vaadin-framework-c89b2e6556b1432cb2b5f9de2868f3104b7ff000.tar.gz vaadin-framework-c89b2e6556b1432cb2b5f9de2868f3104b7ff000.zip |
TestBench test for Button (#11581)
Makes sure the WAI-ARIA functions work
Change-Id: If3835f038f5cca009bef678fdfe037d4287ece7e
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.html | 82 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.java | 51 |
2 files changed, 133 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.html b/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.html new file mode 100644 index 0000000000..42c39ca0ed --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.html @@ -0,0 +1,82 @@ +<?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="http://127.0.0.1:8080/" /> +<title>ButtonsWaiAria</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">ButtonsWaiAria</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.button.ButtonsWaiAria?restartApplication</td> + <td></td> +</tr> +<tr> + <td>verifyElementPresent</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VButton[0]/</td> + <td></td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VButton[0]@role</td> + <td>button</td> +</tr> +<tr> + <td>verifyElementPresent</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VButton[0]/</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>xpath=/html/body/div/div/div[2]/div/div[2]/div/div[5]/div/span/img[@alt='']</td> + <td></td> +</tr> +<tr> + <td>storeAttribute</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]@alt</td> + <td>emptyAlt</td> +</tr> +<tr> + <td>verifyElementPresent</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VButton[0]/</td> + <td></td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]@alt</td> + <td>user icon</td> +</tr> +<tr> + <td>verifyElementPresent</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[4]/VButton[0]/</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonsWaiAria::PID_Scheckboxaction-Enabled/domChild[0]</td> + <td>7,7</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VButton[0]/@aria-disabled</td> + <td>true</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonsWaiAria::PID_Scheckboxaction-Enabled/domChild[0]</td> + <td>7,7</td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>/html/body/div/div/div[2]/div/div[2]/div/div[3]/div[@aria-disabled]</td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.java b/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.java new file mode 100644 index 0000000000..1208b8be3b --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.java @@ -0,0 +1,51 @@ +package com.vaadin.tests.components.button; + +import com.vaadin.tests.components.ComponentTestCase; +import com.vaadin.ui.Button; +import com.vaadin.ui.NativeButton; + +public class ButtonsWaiAria extends ComponentTestCase<Button> { + + @Override + protected Class<Button> getTestClass() { + return Button.class; + } + + @Override + protected void initializeComponents() { + + Button l; + boolean nat = false; + + l = createButton("Default Button", nat); + addTestComponent(l); + + l = createButton("Icon Button, empty alt", nat); + l.setIcon(ICON_16_USER_PNG_CACHEABLE); + addTestComponent(l); + + l = createButton("Icon Button with alt", nat); + l.setIcon(ICON_16_USER_PNG_CACHEABLE, "user icon"); + addTestComponent(l); + + l = createButton("Tooltip Button", nat); + l.setDescription("Tooltip"); + addTestComponent(l); + } + + private Button createButton(String text, boolean nativeButton) { + Button b; + if (nativeButton) { + b = new NativeButton(text); + } else { + b = new Button(text); + } + + return b; + } + + @Override + protected String getDescription() { + return "A generic test for Buttons in different configurations"; + } +} |