diff options
author | John Ahlroos <john@vaadin.com> | 2012-10-18 14:07:41 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2012-10-18 14:07:41 +0300 |
commit | 9ce55984a403044a1309a6f5f047d06869aedab8 (patch) | |
tree | 7611b3931260f661cf915d175964ce742442c4ee /uitest | |
parent | 43c3f454d419c0eb7b0d094c4cf853e3ec3867ae (diff) | |
download | vaadin-framework-9ce55984a403044a1309a6f5f047d06869aedab8.tar.gz vaadin-framework-9ce55984a403044a1309a6f5f047d06869aedab8.zip |
Fixed primary stylename handling for MenuBar #9908
Change-Id: I8ac3f6eec22cbfd94a6abd6fdbb1d738422c97ae
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/menubar/MenuBarPrimaryStylenames.html | 217 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/menubar/MenuBarPrimaryStylenames.java | 48 |
2 files changed, 265 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/menubar/MenuBarPrimaryStylenames.html b/uitest/src/com/vaadin/tests/components/menubar/MenuBarPrimaryStylenames.html new file mode 100644 index 0000000000..1232418978 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/menubar/MenuBarPrimaryStylenames.html @@ -0,0 +1,217 @@ +<?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://localhost:8888/" /> +<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.components.menubar.MenuBarPrimaryStylenames?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]</td> + <td>my-menu-bar</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[0]</td> + <td>my-menu-bar-menuitem</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[1]</td> + <td>my-menu-bar-menuitem</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[1]/domChild[0]</td> + <td>my-menu-bar-submenu-indicator</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[1]/domChild[1]</td> + <td>my-menu-bar-menuitem-caption</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]#item0</td> + <td>24,9</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[0]/</td> + <td>my-menu-bar-popup</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[0]/VMenuBar[0]</td> + <td>my-menu-bar-submenu</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[0]/VMenuBar[0]/domChild[0]</td> + <td>my-menu-bar-menuitem</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[0]/VMenuBar[0]/domChild[0]/domChild[0]</td> + <td>my-menu-bar-menuitem-caption</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]#item0</td> + <td>24,9</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]#item1</td> + <td>44,6</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]</td> + <td>down</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]</td> + <td>right</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[1]</td> + <td>my-menu-bar-popup</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[1]/VMenuBar[0]</td> + <td>my-menu-bar-submenu</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[1]/VMenuBar[0]/domChild[0]</td> + <td>my-menu-bar-menuitem</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[1]/VMenuBar[0]/domChild[0]/domChild[0]</td> + <td>my-menu-bar-menuitem-caption</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]#item0</td> + <td>[tab]</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]</td> + <td>my-other-menu</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[0]</td> + <td>my-other-menu-menuitem</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[1]</td> + <td>my-other-menu-menuitem</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[1]/domChild[0]</td> + <td>my-other-menu-submenu-indicator</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[1]/domChild[1]</td> + <td>my-other-menu-menuitem-caption</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]#item0</td> + <td>24,9</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[0]/</td> + <td>my-other-menu-popup</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[0]/VMenuBar[0]</td> + <td>my-other-menu-submenu</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[0]/VMenuBar[0]/domChild[0]</td> + <td>my-other-menu-menuitem</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[0]/VMenuBar[0]/domChild[0]/domChild[0]</td> + <td>my-other-menu-menuitem-caption</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]#item0</td> + <td>24,9</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]#item1</td> + <td>44,6</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]</td> + <td>down</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]</td> + <td>right</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[1]</td> + <td>my-other-menu-popup</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[1]/VMenuBar[0]</td> + <td>my-other-menu-submenu</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[1]/VMenuBar[0]/domChild[0]</td> + <td>my-other-menu-menuitem</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::Root/VOverlay[1]/VMenuBar[0]/domChild[0]/domChild[0]</td> + <td>my-other-menu-menuitem-caption</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]#item0</td> + <td>[tab]</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/menubar/MenuBarPrimaryStylenames.java b/uitest/src/com/vaadin/tests/components/menubar/MenuBarPrimaryStylenames.java new file mode 100644 index 0000000000..79bec2e65e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/menubar/MenuBarPrimaryStylenames.java @@ -0,0 +1,48 @@ +package com.vaadin.tests.components.menubar; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.MenuBar; +import com.vaadin.ui.MenuBar.MenuItem; + +public class MenuBarPrimaryStylenames extends TestBase { + + @Override + protected void setup() { + final MenuBar mainMenu = new MenuBar(); + mainMenu.setPrimaryStyleName("my-menu-bar"); + + MenuItem submenu1 = mainMenu.addItem("Submenu1", null); + MenuItem item1 = submenu1.addItem("Item1", null); + item1.setCheckable(true); + item1.setStyleName("my-menu-item"); + submenu1.addItem("Item2", null); + + MenuItem submenu2 = mainMenu.addItem("Submenu2", null); + MenuItem menu1 = submenu2.addItem("Menu1", null); + menu1.addItem("Item11", null); + + addComponent(mainMenu); + + addComponent(new Button("Change primary stylename", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + mainMenu.setPrimaryStyleName("my-other-menu"); + } + })); + + } + + @Override + protected String getDescription() { + return "Menubar should support primary stylenames both initially and dynamically"; + } + + @Override + protected Integer getTicketNumber() { + return 9908; + } + +} |