]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix ThemeChangeOnTheFlyTest to work with autogenerated style. (#14670)
authorSauli Tähkäpää <sauli@vaadin.com>
Sat, 27 Sep 2014 10:03:02 +0000 (13:03 +0300)
committerVaadin Code Review <review@vaadin.com>
Sat, 27 Sep 2014 10:40:33 +0000 (10:40 +0000)
Change-Id: Iac7800a97e7263b51032579bd6ab0de9a95d59f8

uitest/src/com/vaadin/tests/themes/ThemeChangeOnTheFlyTest.java

index eb010e82ee50ac5aef2b7dacffad19e67809f322..a5657c4eec39d53b049971c0a0303e89e480127e 100644 (file)
  */
 package com.vaadin.tests.themes;
 
-import java.io.IOException;
-import java.util.List;
-
-import org.junit.Assert;
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
 import org.junit.Test;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebDriver;
@@ -26,8 +24,11 @@ import org.openqa.selenium.WebElement;
 import org.openqa.selenium.remote.DesiredCapabilities;
 import org.openqa.selenium.support.ui.ExpectedCondition;
 
-import com.vaadin.testbench.elements.ButtonElement;
-import com.vaadin.tests.tb3.MultiBrowserTest;
+import java.io.IOException;
+import java.util.List;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
 
 public class ThemeChangeOnTheFlyTest extends MultiBrowserTest {
 
@@ -100,9 +101,8 @@ public class ThemeChangeOnTheFlyTest extends MultiBrowserTest {
             @Override
             public Boolean apply(WebDriver input) {
                 String rootClass = rootDiv.getAttribute("class").trim();
-                String expected = "v-app " + theme;
-                expected = expected.trim();
-                return rootClass.equals(expected);
+
+                return rootClass.contains(theme);
             }
         }, 30);
     }
@@ -110,12 +110,9 @@ public class ThemeChangeOnTheFlyTest extends MultiBrowserTest {
     private void assertOverlayTheme(String theme) {
         final WebElement overlayContainerDiv = findElement(By
                 .xpath("//div[contains(@class,'v-overlay-container')]"));
-        String expected = "v-app v-overlay-container " + theme;
-        expected = expected.trim();
-
         String overlayClass = overlayContainerDiv.getAttribute("class").trim();
 
-        Assert.assertEquals(expected, overlayClass);
+        assertThat(overlayClass, containsString(theme));
     }
 
 }