diff options
author | Artur Signell <artur@vaadin.com> | 2013-10-15 17:01:32 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2013-10-15 17:03:36 +0300 |
commit | ce89a75620078677d118769a74d5b2cf778c9792 (patch) | |
tree | fe8d7578e51f8f3868f078cf2b28703db2251f16 /uitest/src/com/vaadin | |
parent | c7ae45cc2404c2eab557866f310a2bb2130ddffe (diff) | |
download | vaadin-framework-ce89a75620078677d118769a74d5b2cf778c9792.tar.gz vaadin-framework-ce89a75620078677d118769a74d5b2cf778c9792.zip |
Created constants for tested browser versions (#12786)
Change-Id: I8f349bb3c338bb7e9073944891436edac5ee1bb1
Diffstat (limited to 'uitest/src/com/vaadin')
4 files changed, 24 insertions, 17 deletions
diff --git a/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java b/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java index 6704f55226..83af6d07d5 100644 --- a/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java +++ b/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java @@ -23,7 +23,6 @@ import org.junit.Test; import org.openqa.selenium.remote.DesiredCapabilities; import com.vaadin.tests.tb3.MultiBrowserTest; -import com.vaadin.tests.tb3.AbstractTB3Test.BrowserUtil; public class VerifyBrowserVersionTest extends MultiBrowserTest { @@ -31,7 +30,8 @@ public class VerifyBrowserVersionTest extends MultiBrowserTest { { expectedUserAgent - .put(BrowserUtil.firefox(24), + .put(BrowserUtil + .firefox(MultiBrowserTest.TESTED_FIREFOX_VERSION), "Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Firefox/24.0"); expectedUserAgent .put(BrowserUtil.ie(8), @@ -46,19 +46,18 @@ public class VerifyBrowserVersionTest extends MultiBrowserTest { .put(BrowserUtil.ie(11), "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko"); expectedUserAgent - .put(BrowserUtil.chrome(29), + .put(BrowserUtil.chrome(MultiBrowserTest.TESTED_CHROME_VERSION), "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36"); - expectedUserAgent - .put(BrowserUtil.opera(12), - "Opera/9.80 (Windows NT 5.1) Presto/2.12.388 Version/12.15"); + expectedUserAgent.put( + BrowserUtil.opera(MultiBrowserTest.TESTED_OPERA_VERSION), + "Opera/9.80 (Windows NT 5.1) Presto/2.12.388 Version/12.15"); } @Test public void verifyUserAgent() { openTestURL(); - Assert.assertEquals( - expectedUserAgent.get(getDesiredCapabilities()), + Assert.assertEquals(expectedUserAgent.get(getDesiredCapabilities()), vaadinElementById("userAgent").getText()); Assert.assertEquals("Touch device? No", vaadinElementById("touchDevice").getText()); diff --git a/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java index 5f4ae41361..ddaf84b3e1 100644 --- a/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java +++ b/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java @@ -22,6 +22,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; import org.openqa.selenium.remote.DesiredCapabilities; +import com.vaadin.tests.tb3.MultiBrowserTest; import com.vaadin.tests.tb3.PrivateTB3Configuration; /** @@ -32,8 +33,7 @@ import com.vaadin.tests.tb3.PrivateTB3Configuration; * @author Vaadin Ltd */ @RunWith(IntegrationTestRunner.class) -public abstract class AbstractIntegrationTest extends - PrivateTB3Configuration { +public abstract class AbstractIntegrationTest extends PrivateTB3Configuration { @Override protected String getBaseURL() { String deploymentUrl = System.getProperty("deployment.url"); @@ -47,7 +47,8 @@ public abstract class AbstractIntegrationTest extends @Parameters public static Collection<DesiredCapabilities> getBrowsersForTest() { - return Collections.singleton(BrowserUtil.firefox(17)); + return Collections.singleton(BrowserUtil + .firefox(MultiBrowserTest.TESTED_FIREFOX_VERSION)); } } diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java index 1967891a7a..e831a4f15f 100644 --- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -77,7 +77,8 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { private boolean push = false; { // Default browser to run on unless setDesiredCapabilities is called - desiredCapabilities = BrowserUtil.firefox(24); + desiredCapabilities = BrowserUtil + .firefox(MultiBrowserTest.TESTED_FIREFOX_VERSION); } /** @@ -193,7 +194,8 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { * @return The browsers to run the test on */ public Collection<DesiredCapabilities> getBrowsersToTest() { - return Collections.singleton(BrowserUtil.firefox(17)); + return Collections.singleton(BrowserUtil + .firefox(MultiBrowserTest.TESTED_FIREFOX_VERSION)); } diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java index 3553954ec0..587e2db623 100644 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java @@ -40,17 +40,22 @@ import org.openqa.selenium.remote.DesiredCapabilities; */ public abstract class MultiBrowserTest extends PrivateTB3Configuration { + public static final int TESTED_SAFARI_VERSION = 6; + public static final int TESTED_CHROME_VERSION = 29; + public static final int TESTED_FIREFOX_VERSION = 24; + public static final int TESTED_OPERA_VERSION = 12; + static List<DesiredCapabilities> allBrowsers = new ArrayList<DesiredCapabilities>(); static { allBrowsers.add(BrowserUtil.ie(8)); allBrowsers.add(BrowserUtil.ie(9)); allBrowsers.add(BrowserUtil.ie(10)); allBrowsers.add(BrowserUtil.ie(11)); - allBrowsers.add(BrowserUtil.firefox(24)); + allBrowsers.add(BrowserUtil.firefox(TESTED_FIREFOX_VERSION)); // Uncomment once we have the capability to run on Safari 6 - // allBrowsers.add(safari(6)); - allBrowsers.add(BrowserUtil.chrome(29)); - allBrowsers.add(BrowserUtil.opera(12)); + // allBrowsers.add(safari(TESTED_SAFARI_VERSION)); + allBrowsers.add(BrowserUtil.chrome(TESTED_CHROME_VERSION)); + allBrowsers.add(BrowserUtil.opera(TESTED_OPERA_VERSION)); } |