diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2015-02-06 10:13:35 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-02-09 13:41:47 +0000 |
commit | ad5075ec3041a7e5ee87bfb56d14e48f3bb42c6d (patch) | |
tree | 9ce4d6b313d3c5d1e955fa8fad9a7e3d10592128 /uitest | |
parent | cf0a3cba90aa21055b6271d0b52968bc7e6e378d (diff) | |
download | vaadin-framework-ad5075ec3041a7e5ee87bfb56d14e48f3bb42c6d.tar.gz vaadin-framework-ad5075ec3041a7e5ee87bfb56d14e48f3bb42c6d.zip |
Update Chrome to 40.
Change-Id: I6f970babd7cf6d32d4cf816727d44e140a1018c0
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java | 49 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java | 2 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java | 2 |
3 files changed, 22 insertions, 31 deletions
diff --git a/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java b/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java index ba2e1f3c73..38c94dda7d 100644 --- a/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java +++ b/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java @@ -15,10 +15,13 @@ */ 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")); } } diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java index c8ca4c12a1..cd89579c31 100644 --- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -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; } diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java index 5a25a4ebb8..19f62d69ee 100644 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java @@ -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)); |