Commit 5d55d4d7 authored by yihua.huang's avatar yihua.huang

add selenium ignore

parent 644a90c2
package us.codecraft.webmagic.selenium; package us.codecraft.webmagic.selenium;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
...@@ -15,6 +16,7 @@ import java.util.List; ...@@ -15,6 +16,7 @@ import java.util.List;
*/ */
public class SeleniumTest { public class SeleniumTest {
@Ignore("need chrome driver")
@Test @Test
public void test(){ public void test(){
System.getProperties().setProperty("webdriver.chrome.driver","/Users/yihua/Downloads/chromedriver"); System.getProperties().setProperty("webdriver.chrome.driver","/Users/yihua/Downloads/chromedriver");
......
...@@ -20,6 +20,7 @@ public class SeleniumDownloaderTest { ...@@ -20,6 +20,7 @@ public class SeleniumDownloaderTest {
@Test @Test
public void test(){ public void test(){
SeleniumDownloader seleniumDownloader = new SeleniumDownloader(chromeDriverPath); SeleniumDownloader seleniumDownloader = new SeleniumDownloader(chromeDriverPath);
Page page = seleniumDownloader.download(new Request("http://huaban.com/"), new Task() { Page page = seleniumDownloader.download(new Request("http://huaban.com/"), new Task() {
@Override @Override
public String getUUID() { public String getUUID() {
......
package us.codecraft.webmagic.selenium.downloader; package us.codecraft.webmagic.selenium.downloader;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
...@@ -12,6 +13,7 @@ public class WebDriverPoolTest { ...@@ -12,6 +13,7 @@ public class WebDriverPoolTest {
private String chromeDriverPath = "/Users/yihua/Downloads/chromedriver"; private String chromeDriverPath = "/Users/yihua/Downloads/chromedriver";
@Ignore("need chrome driver")
@Test @Test
public void test() { public void test() {
System.getProperties().setProperty("webdriver.chrome.driver", chromeDriverPath); System.getProperties().setProperty("webdriver.chrome.driver", chromeDriverPath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment