selenium-connect 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/chromedriver +0 -0
- data/chromedriver.log +56 -0
- data/lib/selenium-connect/configuration.rb +7 -9
- data/lib/selenium-connect/rake.task +2 -1
- data/lib/selenium-connect/server.rb +16 -9
- data/lib/selenium-connect.rb +4 -0
- data/selenium-connect.gemspec +1 -1
- data/spec/acceptance_spec.rb +1 -1
- data/spec/example.yaml +2 -2
- data/spec/yaml_spec.rb +11 -0
- metadata +4 -2
data/bin/chromedriver
ADDED
Binary file
|
data/chromedriver.log
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
[0.001][INFO]: ChromeDriver 26.0.1383.0 /Users/more/Dropbox/_dev/Arrgyle/selenium-connect/bin/chromedriver
|
2
|
+
[1.019][FINE]: Initializing session with capabilities {
|
3
|
+
"browserName": "chrome",
|
4
|
+
"cssSelectorsEnabled": true,
|
5
|
+
"javascriptEnabled": true,
|
6
|
+
"nativeEvents": false,
|
7
|
+
"platform": "ANY",
|
8
|
+
"rotatable": false,
|
9
|
+
"takesScreenshot": false,
|
10
|
+
"version": ""
|
11
|
+
}
|
12
|
+
|
13
|
+
[1.019][INFO]: Launching chrome: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome --disable-hang-monitor --disable-prompt-on-repost --dom-automation --full-memory-crash-report --no-default-browser-check --no-first-run --disable-background-networking --disable-sync --disable-translate --disable-web-resources --safebrowsing-disable-auto-update --safebrowsing-disable-download-protection --disable-client-side-phishing-detection --disable-component-update --disable-default-apps --enable-logging --log-level=1 --use-mock-keychain --ignore-certificate-errors about:blank
|
14
|
+
[2.960][INFO]: Connected to Chrome successfully. Version: 27.0.1453.93
|
15
|
+
[3.044][FINE]: Command received (/session/d84d6ebf341008c58eee63695f329969)
|
16
|
+
[3.045][FINE]: Command finished (/session/d84d6ebf341008c58eee63695f329969) with response {
|
17
|
+
"sessionId": "d84d6ebf341008c58eee63695f329969",
|
18
|
+
"status": 0,
|
19
|
+
"value": {
|
20
|
+
"acceptSslCerts": false,
|
21
|
+
"applicationCacheEnabled": false,
|
22
|
+
"browserConnectionEnabled": false,
|
23
|
+
"browserName": "chrome",
|
24
|
+
"chrome.chromedriverVersion": "26.0.1383.0",
|
25
|
+
"cssSelectorsEnabled": true,
|
26
|
+
"databaseEnabled": false,
|
27
|
+
"handlesAlerts": true,
|
28
|
+
"javascriptEnabled": true,
|
29
|
+
"locationContextEnabled": false,
|
30
|
+
"nativeEvents": true,
|
31
|
+
"platform": "mac",
|
32
|
+
"rotatable": false,
|
33
|
+
"takesScreenshot": true,
|
34
|
+
"version": "27.0.1453.93",
|
35
|
+
"webStorageEnabled": true
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
[3.338][FINE]: Command received (/session/d84d6ebf341008c58eee63695f329969/url) with params {
|
40
|
+
"url": "http://google.com"
|
41
|
+
}
|
42
|
+
|
43
|
+
[3.338][FINER]: Waiting for all views to stop loading...
|
44
|
+
[3.339][FINER]: Done waiting for all views to stop loading
|
45
|
+
[3.997][FINER]: Waiting for all views to stop loading...
|
46
|
+
[3.999][FINER]: Done waiting for all views to stop loading
|
47
|
+
[3.999][FINE]: Command finished (/session/d84d6ebf341008c58eee63695f329969/url) with response {
|
48
|
+
"sessionId": "d84d6ebf341008c58eee63695f329969",
|
49
|
+
"status": 0,
|
50
|
+
"value": {
|
51
|
+
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
[4.011][FINE]: Command received (/session/d84d6ebf341008c58eee63695f329969)
|
56
|
+
[4.156][INFO]: Chrome shutdown
|
@@ -1,8 +1,5 @@
|
|
1
1
|
module SeleniumConnect
|
2
2
|
class Configuration
|
3
|
-
#YAML Config File
|
4
|
-
attr_accessor :config_file
|
5
|
-
|
6
3
|
#Selenium Server
|
7
4
|
attr_accessor :host, :port, :version,
|
8
5
|
:background, :log, :jar
|
@@ -38,10 +35,11 @@ module SeleniumConnect
|
|
38
35
|
end
|
39
36
|
|
40
37
|
def set_config_values_from_file(config_file_values)
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
38
|
+
config_file_values.each do |config_parameter, config_value|
|
39
|
+
instance_variable_set("@#{config_parameter}", config_value)
|
40
|
+
end
|
41
|
+
defaults
|
45
42
|
end
|
46
|
-
|
47
|
-
end
|
43
|
+
|
44
|
+
end #Configuration
|
45
|
+
end #SeleniumConnect
|
@@ -1,8 +1,9 @@
|
|
1
1
|
require 'selenium/rake/server_task'
|
2
2
|
|
3
3
|
Selenium::Rake::ServerTask.new(:server) do |t|
|
4
|
-
t.
|
4
|
+
t.version = :latest
|
5
5
|
t.background
|
6
6
|
t.log = false
|
7
7
|
t.port = 4444
|
8
|
+
t.opts = '-Dwebdriver.chrome.driver=/Users/more/Dropbox/_dev/Arrgyle/selenium-connect/lib/selenium-connect/../../bin/chromedriver'
|
8
9
|
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
module SeleniumConnect
|
2
2
|
class Server
|
3
|
-
attr_reader :configuration
|
3
|
+
attr_reader :configuration, :current_dir_path
|
4
4
|
|
5
5
|
def initialize(configuration)
|
6
6
|
@configuration = configuration
|
7
|
+
@current_dir_path = File.join(File.dirname(File.expand_path(__FILE__)))
|
7
8
|
end
|
8
9
|
|
9
10
|
def start
|
@@ -30,7 +31,7 @@ module SeleniumConnect
|
|
30
31
|
else
|
31
32
|
"t.version = :latest"
|
32
33
|
end
|
33
|
-
|
34
|
+
}
|
34
35
|
t.background
|
35
36
|
#{
|
36
37
|
if configuration.log
|
@@ -40,19 +41,25 @@ module SeleniumConnect
|
|
40
41
|
end
|
41
42
|
}
|
42
43
|
t.port = #{configuration.port}
|
44
|
+
#{
|
45
|
+
if configuration.browser == 'chrome'
|
46
|
+
"t.opts = '-Dwebdriver.chrome.driver=#{current_dir_path + '/../../bin/chromedriver'}'"
|
47
|
+
end
|
48
|
+
}
|
43
49
|
end"
|
44
50
|
end
|
45
51
|
|
46
52
|
def get_rake_file
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
return
|
53
|
+
rake_file_path = current_dir_path + '/rake.task'
|
54
|
+
rake_file = File.open(rake_file_path, 'w')
|
55
|
+
rake_file << generate_rake_task
|
56
|
+
rake_file.close
|
57
|
+
return rake_file_path
|
52
58
|
end
|
53
59
|
|
54
60
|
def rake(task)
|
55
61
|
system "rake -f #{get_rake_file} server:#{task}"
|
56
62
|
end
|
57
|
-
|
58
|
-
end
|
63
|
+
|
64
|
+
end #Server
|
65
|
+
end #SeleniumConnect
|
data/lib/selenium-connect.rb
CHANGED
data/selenium-connect.gemspec
CHANGED
data/spec/acceptance_spec.rb
CHANGED
data/spec/example.yaml
CHANGED
data/spec/yaml_spec.rb
CHANGED
@@ -6,6 +6,17 @@ describe "YAML" do
|
|
6
6
|
SeleniumConnect.configure do |c|
|
7
7
|
c.config_file = "#{Dir.pwd}/spec/example.yaml"
|
8
8
|
end
|
9
|
+
config = SeleniumConnect.debug_config
|
10
|
+
config.class.should == SeleniumConnect::Configuration
|
11
|
+
config.inspect.empty?.should == false
|
9
12
|
end
|
10
13
|
|
14
|
+
it 'chrome', :wip => true do
|
15
|
+
SeleniumConnect.configure do |c|
|
16
|
+
c.config_file = "#{Dir.pwd}/spec/example.yaml"
|
17
|
+
end
|
18
|
+
driver = SeleniumConnect.start
|
19
|
+
driver.get 'http://google.com'
|
20
|
+
SeleniumConnect.finish
|
21
|
+
end
|
11
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium-connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: selenium-webdriver
|
@@ -86,6 +86,8 @@ files:
|
|
86
86
|
- .rvmrc
|
87
87
|
- Gemfile
|
88
88
|
- README.md
|
89
|
+
- bin/chromedriver
|
90
|
+
- chromedriver.log
|
89
91
|
- lib/selenium-connect.rb
|
90
92
|
- lib/selenium-connect/configuration.rb
|
91
93
|
- lib/selenium-connect/rake.task
|