/*
 * (C) Copyright 2015 Boni Garcia (http://bonigarcia.github.io/)
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-2.1.html
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 */
package io.github.bonigarcia.wdm.test;

import java.util.Arrays;
import java.util.Collection;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import io.github.bonigarcia.wdm.WebDriverManager;

/**
 * Parameterized test with several browsers.
 *
 * @author Boni Garcia (boni.gg@gmail.com)
 * @since 1.3.1
 */
@RunWith(Parameterized.class)
public class WebDriverTest extends ManagerTest {

	private Class<? extends WebDriver> driverClass;

	public WebDriverTest(Class<? extends WebDriver> driverClass)
			throws InstantiationException, IllegalAccessException {
		this.driverClass = driverClass;
	}

	@Parameters(name = "{index}: {0}")
	public static Collection<Object[]> data() {
		return Arrays.asList(new Object[][] { { ChromeDriver.class },
				{ FirefoxDriver.class } });
	}

	@Before
	public void setupTest()
			throws InstantiationException, IllegalAccessException {
		WebDriverManager.getInstance(driverClass).setup();
		this.driver = driverClass.newInstance();
	}

	@After
	public void teardown() {
		if (driver != null) {
			driver.quit();
		}
	}

	@Test
	public void testChrome() {
		browseWikipedia();
	}

}

@@ -837,16 +837,66 @@
 erized;%0A
+import org.junit.runners.Parameterized.Parameter;%0A
 import o
@@ -938,16 +938,16 @@
 meters;%0A
-
 import o
@@ -1326,214 +1326,66 @@
 %7B%0A%0A%09
-private Class%3C? extends WebDriver%3E driverClass;%0A%0A%09public WebDriverTest(Class%3C? extends WebDriver%3E driverClass)%0A%09%09%09throws InstantiationException, IllegalAccessException %7B%0A%09%09this.driverClass = driverClass;%0A%09%7D
+@Parameter%0A%09public Class%3C? extends WebDriver%3E driverClass;
 %0A%0A%09@
@@ -1715,13 +1715,8 @@
 ;%0A%09%09
-this.
 driv
@@ -1842,16 +1842,16 @@
 %0A%09@Test%0A
+
 %09public 
@@ -1859,22 +1859,16 @@
 oid test
-Chrome
 () %7B%0A%09%09b

Update WebDriverTest