]> source.dussan.org Git - vaadin-framework.git/commitdiff
Update Chrome to 40.
authorSauli Tähkäpää <sauli@vaadin.com>
Fri, 6 Feb 2015 08:13:35 +0000 (10:13 +0200)
committerVaadin Code Review <review@vaadin.com>
Mon, 9 Feb 2015 13:41:47 +0000 (13:41 +0000)
Change-Id: I6f970babd7cf6d32d4cf816727d44e140a1018c0

uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java
uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java

index ba2e1f3c739b735c344659d4cab295dbeaca5207..38c94dda7d536b1d1f7b2c84116992b6761ffb99 100644 (file)
  */
 package com.vaadin.tests;
 
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
 import java.util.HashMap;
 import java.util.Map;
 
-import org.junit.Assert;
 import org.junit.Test;
 import org.openqa.selenium.remote.DesiredCapabilities;
 
@@ -29,39 +32,27 @@ public class VerifyBrowserVersionTest extends MultiBrowserTest {
     private Map<DesiredCapabilities, String> expectedUserAgent = new HashMap<DesiredCapabilities, String>();
 
     {
-        expectedUserAgent
-                .put(Browser.FIREFOX.getDesiredCapabilities(),
-                        "Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Firefox/24.0");
-        expectedUserAgent
-                .put(Browser.IE8.getDesiredCapabilities(),
-                        "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)");
-        expectedUserAgent
-                .put(Browser.IE9.getDesiredCapabilities(),
-                        "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)");
-        expectedUserAgent
-                .put(Browser.IE10.getDesiredCapabilities(),
-                        "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)");
-        expectedUserAgent
-                .put(Browser.IE11.getDesiredCapabilities(),
-                        "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko");
-        expectedUserAgent
-                .put(Browser.CHROME.getDesiredCapabilities(),
-                        "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36");
-        expectedUserAgent
-                .put(Browser.PHANTOMJS.getDesiredCapabilities(),
-                        "Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34");
-
+        expectedUserAgent.put(Browser.FIREFOX.getDesiredCapabilities(), "Firefox/");
+        expectedUserAgent.put(Browser.IE8.getDesiredCapabilities(), "MSIE ");
+        expectedUserAgent.put(Browser.IE9.getDesiredCapabilities(), "MSIE ");
+        expectedUserAgent.put(Browser.IE10.getDesiredCapabilities(), "MSIE ");
+        expectedUserAgent.put(Browser.IE11.getDesiredCapabilities(), "Trident/7.0; rv:");
+        expectedUserAgent.put(Browser.CHROME.getDesiredCapabilities(), "Chrome/");
+        expectedUserAgent.put(Browser.PHANTOMJS.getDesiredCapabilities(), "PhantomJS/");
     }
 
     @Test
     public void verifyUserAgent() {
         openTestURL();
-        String expected = expectedUserAgent.get(getDesiredCapabilities());
-        String actual = vaadinElementById("userAgent").getText();
-        Assert.assertEquals("Remote control " + getRemoteControlName()
-                + " uses incorrect browser version", expected, actual);
-        Assert.assertEquals("Touch device? No",
-                vaadinElementById("touchDevice").getText());
+
+        DesiredCapabilities desiredCapabilities = getDesiredCapabilities();
+
+        assertThat(vaadinElementById("userAgent").getText(),
+            containsString(expectedUserAgent.get(desiredCapabilities)
+                                         + desiredCapabilities.getVersion()));
+
+        assertThat(vaadinElementById("touchDevice").getText(),
+                                                        is("Touch device? No"));
     }
 
 }
index c8ca4c12a168fabf96d587c23b0ced7b7c8ce139..cd89579c31329af307f3a4bfd4b46d262245d0a0 100644 (file)
@@ -934,7 +934,7 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
         public static DesiredCapabilities chrome(int version) {
             DesiredCapabilities c = DesiredCapabilities.chrome();
             c.setVersion("" + version);
-            c.setPlatform(Platform.XP);
+            c.setPlatform(Platform.VISTA);
             return c;
         }
 
index 5a25a4ebb886825e85c7656ea6258e3a67b840bf..19f62d69ee73e7b19112fe853f0155d688d06700 100644 (file)
@@ -93,7 +93,7 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration {
     }
 
     public enum Browser {
-        FIREFOX(BrowserUtil.firefox(24)), CHROME(BrowserUtil.chrome(33)), SAFARI(
+        FIREFOX(BrowserUtil.firefox(24)), CHROME(BrowserUtil.chrome(40)), SAFARI(
                 BrowserUtil.safari(7)), IE8(BrowserUtil.ie(8)), IE9(BrowserUtil
                 .ie(9)), IE10(BrowserUtil.ie(10)), IE11(BrowserUtil.ie(11)), OPERA(
                 BrowserUtil.opera(17)), PHANTOMJS(BrowserUtil.phantomJS(1));