selenium-connect 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/selenium-connect/configuration.rb +12 -0
- data/lib/selenium-connect/runner.rb +4 -11
- data/selenium-connect.gemspec +1 -1
- metadata +1 -1
@@ -1,5 +1,17 @@
|
|
1
1
|
module SeleniumConnect
|
2
2
|
class Configuration
|
3
3
|
attr_accessor :host, :port, :browser, :profile_path, :version, :background, :log, :jar
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
set_sensible_defaults
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def set_sensible_defaults
|
12
|
+
host = "localhost" unless host
|
13
|
+
port = "4444" unless port
|
14
|
+
browser = "firefox" unless browser
|
15
|
+
end
|
4
16
|
end
|
5
17
|
end
|
@@ -8,16 +8,13 @@ module SeleniumConnect
|
|
8
8
|
|
9
9
|
def initialize(configuration)
|
10
10
|
@configuration = configuration
|
11
|
-
|
12
|
-
@driver = initialize_selenium
|
11
|
+
@driver = initialize_driver
|
13
12
|
end
|
14
13
|
|
15
14
|
private
|
16
15
|
|
17
|
-
def
|
18
|
-
configuration.host
|
19
|
-
configuration.port = "4444" unless configuration.port
|
20
|
-
configuration.browser = "firefox" unless configuration.browser
|
16
|
+
def set_server_url
|
17
|
+
"http://#{configuration.host}:#{configuration.port}/wd/hub"
|
21
18
|
end
|
22
19
|
|
23
20
|
def set_profile
|
@@ -26,11 +23,7 @@ module SeleniumConnect
|
|
26
23
|
Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile)
|
27
24
|
end
|
28
25
|
|
29
|
-
def
|
30
|
-
"http://#{configuration.host}:#{configuration.port}/wd/hub"
|
31
|
-
end
|
32
|
-
|
33
|
-
def initialize_selenium
|
26
|
+
def initialize_driver
|
34
27
|
Selenium::WebDriver::Remote::Bridge.new(
|
35
28
|
:url => set_server_url,
|
36
29
|
:desired_capabilities => set_profile)
|
data/selenium-connect.gemspec
CHANGED