@@ -19,21 +19,21 @@ type PhantomJsSwitches map[string]interface{}
19
19
type PhantomJsDriver struct {
20
20
WebDriverCore
21
21
//The port that PhantomJsDriver listens on. Default: 9515
22
- Port int
22
+ Port int
23
23
//The URL path prefix to use for all incoming WebDriver REST requests. Default: ""
24
- BaseUrl string
24
+ BaseUrl string
25
25
//The number of threads to use for handling HTTP requests. Default: 4
26
- Threads int
26
+ Threads int
27
27
//The path to use for the PhantomJsDriver server log. Default: ./phantomJsdriver.log
28
- LogPath string
28
+ LogPath string
29
29
// Log file to dump phantomJsdriver stdout/stderr. If "" send to terminal. Default: ""
30
- LogFile string
30
+ LogFile string
31
31
// Start method fails if PhantomJsdriver doesn't start in less than StartTimeout. Default 20s.
32
32
StartTimeout time.Duration
33
33
34
- path string
35
- cmd * exec.Cmd
36
- logFile * os.File
34
+ path string
35
+ cmd * exec.Cmd
36
+ logFile * os.File
37
37
}
38
38
39
39
//create a new service using phantomJsdriver.
@@ -59,7 +59,7 @@ func (d *PhantomJsDriver) Start() error {
59
59
60
60
if d .LogPath != "" {
61
61
//check if log-path is writable
62
- file , err := os .OpenFile (d .LogPath , os .O_WRONLY | os .O_CREATE , 0664 )
62
+ file , err := os .OpenFile (d .LogPath , os .O_WRONLY | os .O_CREATE , 0664 )
63
63
if err != nil {
64
64
return errors .New (csferr + "unable to write in log path: " + err .Error ())
65
65
}
@@ -68,8 +68,8 @@ func (d *PhantomJsDriver) Start() error {
68
68
69
69
d .url = fmt .Sprintf ("http://127.0.0.1:%d%s" , d .Port , d .BaseUrl )
70
70
var switches []string
71
- switches = append (switches , "--webdriver=" + strconv .Itoa (d .Port ))
72
- switches = append (switches , "--webdriver-logfile=" + d .LogPath )
71
+ switches = append (switches , "--webdriver=" + strconv .Itoa (d .Port ))
72
+ switches = append (switches , "--webdriver-logfile=" + d .LogPath )
73
73
switches = append (switches , "--webdriver-loglevel=DEBUG" )
74
74
75
75
d .cmd = exec .Command (d .path , switches ... )
0 commit comments