1
1
import org.openqa.selenium.chrome.ChromeDriver
2
2
import org.openqa.selenium.chrome.ChromeOptions
3
3
import org.openqa.selenium.firefox.FirefoxDriver
4
- import org.openqa.selenium.phantomjs.PhantomJSDriver
5
4
6
5
environments {
7
6
@@ -17,24 +16,17 @@ environments {
17
16
if (! System . getProperty(" webdriver.chrome.driver" )) {
18
17
System . setProperty(" webdriver.chrome.driver" , " node_modules/chromedriver/bin/chromedriver" )
19
18
}
20
- driver = { new ChromeDriver () }
21
- }
22
-
23
- firefox {
24
- driver = { new FirefoxDriver () }
25
- }
26
19
27
- phantomjs {
28
- if (! System . getProperty(" phantomjs.binary.path" )) {
29
- String phantomjsPath = " node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs"
30
- if (! new File (phantomjsPath). exists()) {
31
- throw new RuntimeException (" Please install node modules before running functional tests" )
32
- }
33
20
34
- System . setProperty(" phantomjs.binary.path" , phantomjsPath)
21
+ driver = {
22
+ ChromeOptions options = new ChromeOptions ()
23
+ options. addArguments(" --remote-allow-origins=*" )
24
+ new ChromeDriver (options)
35
25
}
26
+ }
36
27
37
- driver = { new PhantomJSDriver () }
28
+ firefox {
29
+ driver = { new FirefoxDriver () }
38
30
}
39
31
40
32
chromeHeadless {
@@ -46,6 +38,7 @@ environments {
46
38
o. addArguments(' headless' )
47
39
o. addArguments(" window-size=1920,1080" )
48
40
o. addArguments(' disable-dev-shm-usage' )
41
+ o. addArguments(" --remote-allow-origins=*" )
49
42
new ChromeDriver (o)
50
43
}
51
44
}
0 commit comments