|
|
@@ -1,9 +1,11 @@ |
|
|
|
package com.vaadin.tests.themes.valo; |
|
|
|
|
|
|
|
import org.junit.Assert; |
|
|
|
import org.junit.Test; |
|
|
|
import org.openqa.selenium.By; |
|
|
|
import org.openqa.selenium.WebElement; |
|
|
|
|
|
|
|
import com.vaadin.testbench.Parameters; |
|
|
|
import com.vaadin.testbench.elements.ButtonElement; |
|
|
|
import com.vaadin.testbench.elements.CheckBoxElement; |
|
|
|
import com.vaadin.testbench.elements.CssLayoutElement; |
|
|
@@ -13,23 +15,31 @@ import com.vaadin.v7.testbench.elements.TreeElement; |
|
|
|
|
|
|
|
public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void setup() throws Exception { |
|
|
|
super.setup(); |
|
|
|
|
|
|
|
openTestURL("test"); |
|
|
|
// During the URL open process, we have already verified that the UI |
|
|
|
// is correct, so that in this case, we can assume everything is fine |
|
|
|
// as long as the UI is not totally broken |
|
|
|
Parameters.setScreenshotComparisonTolerance(0.1); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void labels() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Labels"); |
|
|
|
compareScreen("labels"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void buttonsLinks() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Buttons & Links", "Buttons"); |
|
|
|
compareScreen("buttonsLinks_with_disabled"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void textFields() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Text Fields <span class=\"valo-menu-badge\">123</span>", |
|
|
|
"Text Fields"); |
|
|
|
compareScreen("textFields"); |
|
|
@@ -37,14 +47,12 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void common() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Common UI Elements"); |
|
|
|
compareScreen("common"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void datefields() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Date Fields"); |
|
|
|
// Note that this can look broken in IE9 because of some browser |
|
|
|
// rendering issue... The problem seems to be in the customized |
|
|
@@ -54,49 +62,42 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void comboboxes() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Combo Boxes"); |
|
|
|
compareScreen("comboboxes"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void selects() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Selects"); |
|
|
|
compareScreen("selects"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void checkboxes() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Check Boxes & Option Groups", "Check Boxes"); |
|
|
|
compareScreen("checkboxes_with_readonly"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void sliders() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Sliders & Progress Bars", "Sliders"); |
|
|
|
compareScreen("sliders"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void colorpickers() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Color Pickers"); |
|
|
|
compareScreen("colorpickers"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void menubars() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Menu Bars"); |
|
|
|
compareScreen("menubars"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void trees() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Trees"); |
|
|
|
selectTreeNodeByCaption("Quid securi"); |
|
|
|
compareScreen("trees"); |
|
|
@@ -111,7 +112,6 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void tables() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Tables"); |
|
|
|
check("Components in Cells"); |
|
|
|
compareScreen("tables"); |
|
|
@@ -119,7 +119,6 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void treeTables() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Tables"); |
|
|
|
check("Hierarchical"); |
|
|
|
check("Footer"); |
|
|
@@ -128,28 +127,24 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void dragging() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Drag and Drop", "Dragging Components"); |
|
|
|
compareScreen("dragging"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void panels() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Panels", "Panels & Layout panels"); |
|
|
|
compareScreen("panels"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void splitpanels() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Split Panels"); |
|
|
|
compareScreen("splitpanels"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void tabs() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Tabs <span class=\"valo-menu-badge\">123</span>", "Tabs"); |
|
|
|
sleep(200); |
|
|
|
compareScreen("tabs"); |
|
|
@@ -158,7 +153,6 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void tabsClosable() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Tabs <span class=\"valo-menu-badge\">123</span>", "Tabs"); |
|
|
|
check("Closable"); |
|
|
|
check("Disable tabs"); |
|
|
@@ -169,7 +163,6 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void tabsClosableUnframed() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Tabs <span class=\"valo-menu-badge\">123</span>", "Tabs"); |
|
|
|
check("Closable"); |
|
|
|
// Framed option is checked by default so we are actually unchecking |
|
|
@@ -181,7 +174,6 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void tabsAlignRight() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Tabs <span class=\"valo-menu-badge\">123</span>", "Tabs"); |
|
|
|
check("Right-aligned tabs"); |
|
|
|
sleep(200); |
|
|
@@ -197,7 +189,6 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void tabsAlignCenter() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Tabs <span class=\"valo-menu-badge\">123</span>", "Tabs"); |
|
|
|
check("Centered tabs"); |
|
|
|
sleep(200); |
|
|
@@ -206,7 +197,6 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void tabsIconsOnTop() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Tabs <span class=\"valo-menu-badge\">123</span>", "Tabs"); |
|
|
|
check("Icons on top"); |
|
|
|
sleep(200); |
|
|
@@ -215,7 +205,6 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void tabsEqualCompactPadded() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Tabs <span class=\"valo-menu-badge\">123</span>", "Tabs"); |
|
|
|
check("Equal-width tabs"); |
|
|
|
check("Padded tabbar"); |
|
|
@@ -226,14 +215,20 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void accordions() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Accordions"); |
|
|
|
compareScreen("accordions"); |
|
|
|
|
|
|
|
// Screenshot test is very unstable here. |
|
|
|
// We are testing the label contains the correct text in this case. |
|
|
|
CssLayoutElement content = wrap(CssLayoutElement.class, |
|
|
|
findElement(By.className("valo-content"))); |
|
|
|
LabelElement labelElem = content.$(LabelElement.class).get(1); |
|
|
|
String text = "Fabio vel iudice vincam, sunt in culpa qui officia. Ut " + |
|
|
|
"enim ad minim veniam, quis nostrud exercitation."; |
|
|
|
Assert.assertEquals(text, labelElem.getText()); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void popupviews() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
open("Popup Views"); |
|
|
|
scrollTo(500, 0); |
|
|
|
compareScreen("popupviews"); |
|
|
@@ -241,7 +236,6 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void calendar() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
scrollTo(500, 0); |
|
|
|
open("Calendar"); |
|
|
|
|
|
|
@@ -250,7 +244,6 @@ public class ValoThemeUITest extends MultiBrowserTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void forms() throws Exception { |
|
|
|
openTestURL("test"); |
|
|
|
scrollTo(500, 0); |
|
|
|
open("Forms"); |
|
|
|
compareScreen("forms"); |