Browse Source

Created constants for tested browser versions (#12786)

Change-Id: I8f349bb3c338bb7e9073944891436edac5ee1bb1
tags/7.1.8
Artur Signell 10 years ago
parent
commit
ce89a75620

+ 7
- 8
uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java View 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());

+ 4
- 3
uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java View 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));
}

}

+ 4
- 2
uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java View 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));

}


+ 9
- 4
uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java View 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));

}


Loading…
Cancel
Save