selenium-phantomjs 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -1
- data/lib/selenium/phantomjs.rb +8 -4
- data/lib/selenium/phantomjs/version.rb +1 -1
- data/lib/selenium/phantomjs/web_driver.rb +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 399d9a7b39e518ecb54ba1a141d09875aa72dbe1
|
4
|
+
data.tar.gz: 6a8a91f502e4d00df1d5abdc52932f0abcc25259
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f649082aa23cbbe57a9a32b091899f616e782e7f1496db1b0981c5d1d700d8abde268693749c0eccc67b92cc193938661539b092b07bf2e4bcfe78eea79f9cb3
|
7
|
+
data.tar.gz: c1206d3b34bbc4275879f07fef1db5f37989c9f85bcf779a86a276344dbca66079de0087fc2b283ef60c66999495211051698737d1027fde0fc28bd4c83ec2e9
|
data/README.md
CHANGED
@@ -24,7 +24,18 @@ To use PhantomJS as a browser for Selenium test just add to your ```spec_helper.
|
|
24
24
|
Capybara.default_driver = :selenium_phantomjs
|
25
25
|
```
|
26
26
|
|
27
|
-
Please note that Ghostdriver needs [Selenium Hub](https://code.google.com/p/selenium/wiki/Grid2)
|
27
|
+
Please note that Ghostdriver needs [Selenium Hub](https://code.google.com/p/selenium/wiki/Grid2) run on ```localhost:4444```.
|
28
|
+
|
29
|
+
## How to pass startup args to PhantomJS
|
30
|
+
|
31
|
+
If you want to pass command line args to the phantmojs binary by startup you
|
32
|
+
can:
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
Selenium::Phantomjs.start(:proxy => 'localhost:45678')
|
36
|
+
```
|
37
|
+
|
38
|
+
This will start a Phantomjs instance with `--proxy="localhost:45678"` argument
|
28
39
|
|
29
40
|
## Contributing
|
30
41
|
|
data/lib/selenium/phantomjs.rb
CHANGED
@@ -4,18 +4,22 @@ require 'selenium/phantomjs/version'
|
|
4
4
|
require 'selenium/phantomjs/instance'
|
5
5
|
require 'selenium/phantomjs/web_driver'
|
6
6
|
|
7
|
-
Selenium::Phantomjs::WebDriver.new('tmp/pids/phantomjs.pid').run
|
8
|
-
|
9
7
|
module Selenium
|
10
8
|
module Phantomjs
|
11
9
|
extend self
|
12
10
|
|
11
|
+
def start(args = {})
|
12
|
+
WebDriver.new('tmp/pids/phantomjs.pid').run(args)
|
13
|
+
end
|
14
|
+
|
13
15
|
def register_driver
|
14
16
|
begin
|
15
17
|
require 'selenium/webdriver'
|
16
18
|
rescue LoadError
|
17
19
|
end
|
18
20
|
|
21
|
+
Phantomjs.start
|
22
|
+
|
19
23
|
if defined? Selenium::WebDriver
|
20
24
|
Capybara.register_driver :selenium_phantomjs do |app|
|
21
25
|
Capybara::Selenium::Driver.new(app, options)
|
@@ -25,8 +29,8 @@ module Selenium
|
|
25
29
|
|
26
30
|
def options
|
27
31
|
{
|
28
|
-
browser: :remote,
|
29
|
-
url: "#{WebDriver::SELENIUM_GRID_URL}/wd/hub",
|
32
|
+
browser: :remote,
|
33
|
+
url: "#{WebDriver::SELENIUM_GRID_URL}/wd/hub",
|
30
34
|
desired_capabilities: {
|
31
35
|
browserName: :phantomjs
|
32
36
|
}
|
@@ -5,12 +5,13 @@ module Selenium
|
|
5
5
|
LOGLEVEL = 'WARN'.freeze
|
6
6
|
SELENIUM_GRID_URL = "http://#{Selenium::WebDriver::Platform.localhost}:4444".freeze
|
7
7
|
|
8
|
-
def run(options = {[:out, :err] => [LOG, 'a']})
|
9
|
-
|
10
|
-
:
|
11
|
-
:'webdriver-selenium-grid-hub' => SELENIUM_GRID_URL,
|
8
|
+
def run(args = {}, options = {[:out, :err] => [LOG, 'a']})
|
9
|
+
phantomjs_args = {
|
10
|
+
:'webdriver-selenium-grid-hub' => SELENIUM_GRID_URL,
|
12
11
|
:'webdriver-loglevel' => LOGLEVEL
|
13
|
-
}
|
12
|
+
}.merge(args).merge(wd: nil)
|
13
|
+
|
14
|
+
super(phantomjs_args, options)
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium-phantomjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Slotin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|