]> source.dussan.org Git - vaadin-framework.git/commitdiff
Created constants for tested browser versions (#12786)
authorArtur Signell <artur@vaadin.com>
Tue, 15 Oct 2013 14:01:32 +0000 (17:01 +0300)
committerArtur Signell <artur@vaadin.com>
Tue, 15 Oct 2013 14:03:36 +0000 (17:03 +0300)
Change-Id: I8f349bb3c338bb7e9073944891436edac5ee1bb1

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

index 6704f5522691604222c8c8a563283d4db301fdda..83af6d07d565a53cc61df32936a9a458b26090f0 100644 (file)
@@ -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());
index 5f4ae413617d5046976711c0e5852464af615675..ddaf84b3e1d69b1dc68801094355d3a65e1bc9b6 100644 (file)
@@ -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));
     }
 
 }
index 1967891a7a3662188b6e77b61ade34ec037bae7d..e831a4f15f7bf5a2255b8bc2135579400a1e20d9 100644 (file)
@@ -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));
 
     }
 
index 3553954ec07e57e8c7c0a41c21ab8ce600bd827c..587e2db6238ad3143a82e0135896cf05d35ae52e 100644 (file)
@@ -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));
 
     }