diff --git a/.rubocop.yml b/.rubocop.yml index 54c908e..90ead0a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,7 +9,7 @@ MethodLength: Max: 40 AbcSize: - Max: 25 + Max: 40 BlockLength: Enabled: false diff --git a/.travis.yml b/.travis.yml index 56e9f8c..93bedad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ +language: ruby + sudo: required # install the pre-release chef-dk. Use chef-stable-precise to install the stable release diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ef9914..c459525 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 4.0.0 2017- - Support Selenium 3.0 +- Log defaults to STDOUT when log attribute is nil - Drop support for Chef 11 ## 3.7.4 2016-10-29 diff --git a/README.md b/README.md index 52bb71d..50a7640 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ browsers, drivers, and screenresolution cookbooks into one comprehensive cookboo ## Requirements - Java (not installed by this cookbook) -- Chef 11.16+ +- Chef 12.6+ ### Platforms @@ -41,9 +41,10 @@ browsers, drivers, and screenresolution cookbooks into one comprehensive cookboo ### Cookbooks -- windows - nssm - Required by Windows services only (e.g. Hub and HtmlUnit running in background) - macosx_autologin - Required by Mac OS X GUI services +- windows +- windows_autologin - Required by Windows GUI service ## Recipes @@ -66,57 +67,30 @@ Installs and configures a Selenium Hub as a service. ### Attributes -- `node['selenium']['hub']['servicename']` - The name of the service. Default `selenium_hub`. -- `node['selenium']['hub']['host']` - Default `null`. -- `node['selenium']['hub']['port']` - Default `4444`. -- `node['selenium']['hub']['jvm_args']` - Default `nil`. -- `node['selenium']['hub']['newSessionWaitTimeout']` - Default `-1`. -- `node['selenium']['hub']['servlets']` - Default `[]`. -- `node['selenium']['hub']['prioritizer']` - Default `null`. -- `node['selenium']['hub']['capabilityMatcher']` - Default `org.openqa.grid.internal.utils.DefaultCapabilityMatcher`. -- `node['selenium']['hub']['throwOnCapabilityNotPresent']` - Default `true`. -- `node['selenium']['hub']['nodePolling']` - Default `5000`. -- `node['selenium']['hub']['cleanUpCycle']` - Default `5000`. -- `node['selenium']['hub']['timeout']` - Default `30_000`. -- `node['selenium']['hub']['browserTimeout']` - Default `0`. -- `node['selenium']['hub']['maxSession']` - Default `5`. -- `node['selenium']['hub']['jettyMaxThreads']` - Default `-1`. - +See [selenium_hub](https://github.com/dhoer/chef-selenium#attributes-3) +resource attributes for description. + ## node -Installs and configures a Selenium Node as service on Linux and a GUI service on Mac OS X and Windows. +Installs and configures a Selenium Node as service on Linux and a GUI +service on Mac OS X and Windows. - Firefox browser must be installed outside of this cookbook. - Linux nodes without a physical monitor require a headless display -(e.g., [xvfb](https://supermarket.chef.io/cookbooks/xvfb), [x11vnc](https://supermarket.chef.io/cookbooks/x11vnc), +(e.g., [xvfb](https://supermarket.chef.io/cookbooks/xvfb), +[x11vnc](https://supermarket.chef.io/cookbooks/x11vnc), etc...) and must be installed and configured outside this cookbook. -- Mac OS X/Windows nodes must run as a GUI service and that requires a username -and password for automatic login. Note that Windows password is stored unencrypted under windows registry -`HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon` and Mac OS X password is stored encrypted under -`/etc/kcpassword` but it can be easily decrypted. +- Mac OS X/Windows nodes must run as a GUI service and that requires a +username and password for automatic login. Note that Windows password +is stored unencrypted under windows registry +`HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon` and +Mac OS X password is stored encrypted under `/etc/kcpassword` but it +can be easily decrypted. ### Attributes -- `node['selenium']['node']['servicename']` - The name of the service. Default `selenium_node`. -- `node['selenium']['node']['host']` - Default `ip`. -- `node['selenium']['node']['port']` - Default `5555`. -- `node['selenium']['node']['jvm_args']` - Default `nil`. -- `node['selenium']['node']['proxy']` - Default `org.openqa.grid.selenium.proxy.DefaultRemoteProxy`. -- `node['selenium']['node']['maxSession']` - Default `5`. -- `node['selenium']['node']['register']` - Default `true`. -- `node['selenium']['node']['registerCycle']` - Default `5000`. -- `node['selenium']['node']['hubPort']` - Selenium-grid hub hostname. Default `4444`. -- `node['selenium']['node']['hubHost']` - Selenium-grid hub port. Default `ip`. -- `node['selenium']['node']['capabilities']` - Based on -[capabilities](https://code.google.com/p/selenium/wiki/DesiredCapabilities). Default `[]`. -- `node['selenium']['node']['additional_args']` - Default `[]`. -- `node['selenium']['node']['display']` - Default `:0`. -- Mac OS X/Windows only - Set both username and password to run as a GUI service: - - `username` - Default `nil`. - - `password` - Default `nil`. Note that Windows password is stored unencrypted under windows registry -`HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon` and Mac OS X password is stored encrypted under -`/etc/kcpassword` but it can be easily decrypted. - - `domain` - Optional for Windows only. Default `nil`. +See [selenium_hub](https://github.com/dhoer/chef-selenium#attributes-4) +resource attributes for description. ### Example @@ -151,13 +125,59 @@ Installs and configures a Selenium Hub as a service. ### Attributes -This is a partial list of attributes available. See -[hub](https://github.com/dhoer/chef-selenium/blob/master/resources/hub.rb) -resource for the complete listing of attributes. - -- `name` - Name attribute. The name of the service. -- `host` - Hostname. Default `null`. -- `port` - Port. Default `4444`. +- `servicename` - Name attribute. The name of the service. +- `host` - IP or hostname. Usually determined automatically. Most +commonly useful in exotic network configurations (e.g. network with +VPN). Default `nil`. +- `port` - The port number the server will use. Default: `4444`. +- `jvm_args` - JVM options, e.g., -Xms2G -Xmx2G. Default: `nil`. +- `newSessionWaitTimeout` - The time (in ms) after which a new test +waiting for a node to become available will time out. When that happens, +the test will throw an exception before attempting to start a browser. +An unspecified, zero, or negative value means wait indefinitely. +Default: `-1`. +- `prioritizer` - A class implementing the Prioritizer interface. +Specify a custom Prioritizer if you want to sort the order in which new +session requests are processed when there is a queue. +Default to null ( no priority = FIFO ). +- `servlets` - List of extra servlets the grid (hub or node) will make +available. The servlet must exist in the path, e.g., +/grid/admin/Servlet. Default: `[]`. +- `withoutServlets` - List of default (hub or node) servlets to disable. +Advanced use cases only. Not all default servlets can be disabled. +Default: `[]`. +- `capabilityMatcher` - A class implementing the CapabilityMatcher +interface. Specifies the logic the hub will follow to define whether a +request can be assigned to a node. For example, if you want to have the +matching process use regular expressions instead of exact match when +specifying browser version. ALL nodes of a grid ecosystem would then +use the same capabilityMatcher, as defined here. +Default: `org.openqa.grid.internal.utils.DefaultCapabilityMatcher` +- `throwOnCapabilityNotPresent` - If true, the hub will reject all test +requests if no compatible proxy is currently registered. If set to +false, the request will queue until a node supporting the capability is +registered with the grid. Default: `true`. +- `cleanUpCycle` - Specifies how often the hub will poll (in ms) +running proxies for timed-out (i.e. hung) threads. Must also specify +"timeout" option. Default: `5000`. +- `debug` - Enables LogLevel.FINE. Default: `false`. +- `timeout` - Specifies the timeout before the server automatically +kills a session that hasn't had any activity in the last X seconds. +The test slot will then be released for another test to use. This is +typically used to take care of client crashes. For grid hub/node roles, +cleanUpCycle must also be set. Default: `1800`. +- `browserTimeout` - Number of seconds a browser session is allowed to +hang while a WebDriver command is running (example: driver.get(url)). +If the timeout is reached while a WebDriver command is still processing, +the session will quit. Minimum value is `60`. An unspecified, zero, +or negative value means wait indefinitely. Default: `0`. +- `maxSession` - Max number of tests that can run at the same time on +the node, irrespective of the browser used. Default: `5`. +- `jettyMaxThreads` - Max number of threads for Jetty. An unspecified, +zero, or negative value means the Jetty default value (200) will be +used. Default: `-1`. +- `log` - The filename to use for logging. If omitted, will log to +STDOUT. Default: `nil`. ## selenium_node @@ -165,15 +185,56 @@ Installs and configures a Selenium Node as a service. ### Attributes -This is a partial list of attributes available. See -[node](https://github.com/dhoer/chef-selenium/blob/master/resources/node.rb) -resource for the complete listing of attributes. - -- `name` - Name attribute. The name of the service. -- `host` - Hostname. Default `null`. -- `port` - Port. Default `5555`. -- `hubHost` - Selenium-grid hub hostname. Default `ip`. -- `hubPort` - Selenium-grid hub port. Default `4444`. +- `servicename` - Name attribute. The name of the service. +- `host` - IP or hostname. Usually determined automatically. Most +commonly useful in exotic network configurations (e.g. network with +VPN). Default `nil`. +- `port` - The port number the server will use. Default: `5555`. +- `hub` - The url that will be used to post the registration request. +Default: `http://localhost:4444`. +- `jvm_args` - JVM options, e.g., -Xms2G -Xmx2G. Default: `nil`. +- `proxy` - The class used to represent the node proxy. +Default: `org.openqa.grid.selenium.proxy.DefaultRemoteProxy`. +- `maxSession` - Max number of tests that can run at the same time on +the node, irrespective of the browser used. Default: `5`. +- `register` - Node will attempt to re-register itself automatically +with its known grid hub if the hub becomes unavailable. Default: `true`. +- `registerCycle` - Specifies (in ms) how often the node will try to +register itself again. Allows administrator to restart the hub without +restarting (or risk orphaning) registered nodes. Must be specified with +the "register" option. Default: `5000`. +- `nodeStatusCheckTimeout` - When to time out a node status check. +Default: `5000`. +- `nodePolling` - Specifies (in ms) how often the hub will +poll to see if the node is still responding. Default: `5000`. +- `unregisterIfStillDownAfter` - If the node remains down for more +than specified (in ms), it will stop attempting to re-register from the +hub. Default: `60000`. +- `downPollingLimit` - Node is marked as "down" if the node hasn't +responded after the number of checks specified. Default: `2`. +- `debug` - [TrueClass, FalseClass], default: false +- `servlets` - List of extra servlets the grid (hub or node) will make +available. The servlet must exist in the path, e.g., +/grid/admin/Servlet. Default: `[]`. +- `withoutServlets` - List of default (hub or node) servlets to disable. +Advanced use cases only. Not all default servlets can be disabled. +Default: `[]`. +- `debug` - Enables LogLevel.FINE. Default: `false`. +- `timeout` - Specifies the timeout before the server automatically +kills a session that hasn't had any activity in the last X seconds. +The test slot will then be released for another test to use. This is +typically used to take care of client crashes. For grid hub/node roles, +cleanUpCycle must also be set. Default: `1800`. +- `browserTimeout` - Number of seconds a browser session is allowed to +hang while a WebDriver command is running (example: driver.get(url)). +If the timeout is reached while a WebDriver command is still processing, +the session will quit. Minimum value is `60`. An unspecified, zero, +or negative value means wait indefinitely. Default: `0`. +- `jettyMaxThreads` - Max number of threads for Jetty. An unspecified, +zero, or negative value means the Jetty default value (200) will be +used. Default: `-1`. +- `log` - The filename to use for logging. If omitted, will log to +STDOUT. Default: `nil`. - `capabilities` - Based on [capabilities](https://code.google.com/p/selenium/wiki/DesiredCapabilities). Default `[]`. - Mac OS X/Windows only - Set both username and password to run as a GUI service: @@ -210,8 +271,9 @@ end ## ChefSpec Matchers -The Selenium cookbook includes custom [ChefSpec](https://github.com/sethvargo/chefspec) matchers you can use to test -your own cookbooks. +This cookbook includes custom +[ChefSpec](https://github.com/sethvargo/chefspec) matchers you can use +to test your own cookbooks. Example Matcher Usage @@ -228,8 +290,10 @@ Selenium Cookbook Matchers ## Getting Help -- Ask specific questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/selenium). -- Report bugs and discuss potential features in [Github issues](https://github.com/dhoer/chef-selenium/issues). +- Ask specific questions on +[Stack Overflow](http://stackoverflow.com/questions/tagged/selenium). +- Report bugs and discuss potential features in +[Github issues](https://github.com/dhoer/chef-selenium/issues). ## Contributing @@ -237,4 +301,6 @@ Please refer to [CONTRIBUTING](https://github.com/dhoer/chef-selenium/blob/maste ## License -MIT - see the accompanying [LICENSE](https://github.com/dhoer/chef-selenium/blob/master/LICENSE.md) file for details. +MIT - see the accompanying +[LICENSE](https://github.com/dhoer/chef-selenium/blob/master/LICENSE.md) +file for details. diff --git a/appveyor.yml b/appveyor.yml index 21f3c29..dc56cae 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: "master-{build}" +version: "build-{build}" os: Windows Server 2012 R2 platform: diff --git a/attributes/default.rb b/attributes/default.rb index d918efc..cd4e6a2 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,5 +1,5 @@ default['selenium']['url'] = - 'https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar' + 'https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar' default['selenium']['windows']['home'] = "#{ENV['SYSTEMDRIVE']}/selenium" default['selenium']['windows']['java'] = "#{ENV['SYSTEMDRIVE']}\\java\\bin\\java.exe" @@ -7,3 +7,11 @@ # used by both macosx and linux platforms default['selenium']['unix']['home'] = '/opt/selenium' default['selenium']['unix']['java'] = '/usr/bin/java' + +if platform?('windows') + default['selenium']['home'] = node['selenium']['windows']['home'] + default['selenium']['java'] = node['selenium']['windows']['java'] +else + default['selenium']['home'] = node['selenium']['unix']['home'] + default['selenium']['java'] = node['selenium']['unix']['java'] +end diff --git a/attributes/hub.rb b/attributes/hub.rb index 69636d6..46ab435 100644 --- a/attributes/hub.rb +++ b/attributes/hub.rb @@ -1,15 +1,17 @@ default['selenium']['hub']['servicename'] = 'selenium_hub' # used by hub recipe only -default['selenium']['hub']['host'] = 'null' +default['selenium']['hub']['host'] = nil default['selenium']['hub']['port'] = 4444 default['selenium']['hub']['jvm_args'] = nil default['selenium']['hub']['newSessionWaitTimeout'] = -1 +default['selenium']['hub']['prioritizer'] = nil default['selenium']['hub']['servlets'] = [] -default['selenium']['hub']['prioritizer'] = 'null' +default['selenium']['hub']['withoutServlets'] = [] default['selenium']['hub']['capabilityMatcher'] = 'org.openqa.grid.internal.utils.DefaultCapabilityMatcher' default['selenium']['hub']['throwOnCapabilityNotPresent'] = true -default['selenium']['hub']['nodePolling'] = 5000 default['selenium']['hub']['cleanUpCycle'] = 5000 -default['selenium']['hub']['timeout'] = 30_000 +default['selenium']['hub']['debug'] = true +default['selenium']['hub']['timeout'] = 1800 default['selenium']['hub']['browserTimeout'] = 0 default['selenium']['hub']['maxSession'] = 5 -default['selenium']['hub']['jettyMaxThreads'] = -1 +default['selenium']['hub']['jettyMaxThreads'] = 0 +default['selenium']['hub']['log'] = nil diff --git a/attributes/node.rb b/attributes/node.rb index 3918d18..4306a29 100644 --- a/attributes/node.rb +++ b/attributes/node.rb @@ -1,16 +1,24 @@ default['selenium']['node']['servicename'] = 'selenium_node' # used by node recipe only -default['selenium']['node']['host'] = 'ip' +default['selenium']['node']['host'] = nil default['selenium']['node']['port'] = 5555 default['selenium']['node']['jvm_args'] = nil default['selenium']['node']['proxy'] = 'org.openqa.grid.selenium.proxy.DefaultRemoteProxy' default['selenium']['node']['maxSession'] = 5 default['selenium']['node']['register'] = true default['selenium']['node']['registerCycle'] = 5000 -default['selenium']['node']['hubPort'] = 4444 -default['selenium']['node']['hubHost'] = 'ip' +default['selenium']['node']['hub'] = 'http://localhost:4444' default['selenium']['node']['capabilities'] = [] -default['selenium']['node']['additional_args'] = [] +default['selenium']['node']['servlets'] = [] +default['selenium']['node']['withoutServlets'] = [] +default['selenium']['node']['nodeStatusCheckTimeout'] = 5000 +default['selenium']['node']['nodePolling'] = 5000 +default['selenium']['node']['unregisterIfStillDownAfter'] = 60_000 +default['selenium']['node']['downPollingLimit'] = 2 +default['selenium']['node']['debug'] = true +default['selenium']['node']['timeout'] = 1800 +default['selenium']['node']['browserTimeout'] = 0 +default['selenium']['node']['jettyMaxThreads'] = 0 +default['selenium']['node']['log'] = nil default['selenium']['node']['display'] = ':0' default['selenium']['node']['username'] = nil default['selenium']['node']['password'] = nil -default['selenium']['node']['domain'] = nil diff --git a/libraries/default.rb b/libraries/default.rb index 0d3d08c..91334f1 100644 --- a/libraries/default.rb +++ b/libraries/default.rb @@ -1,5 +1,5 @@ def selenium_java_exec - java = platform_family?('windows') ? node['selenium']['windows']['java'] : node['selenium']['unix']['java'] + java = node['selenium']['java'] validate_exec(%("#{java}" -version)) java end @@ -11,7 +11,7 @@ def validate_exec(cmd) end def selenium_home - platform_family?('windows') ? node['selenium']['windows']['home'] : node['selenium']['unix']['home'] + node['selenium']['home'] end def selenium_jar_link @@ -19,29 +19,22 @@ def selenium_jar_link end def selenium_windows_service(name, exec, args) - log_file = "#{selenium_home}/log/#{name}.log" nssm name do program exec args args.join(' ').gsub('"', '"""') - params( - AppDirectory: selenium_home, - AppStdout: log_file, - AppStderr: log_file, - AppRotateFiles: 1 - ) + params(AppDirectory: selenium_home) action :install end end # http://sqa.stackexchange.com/a/6267 def selenium_windows_gui_service(name, exec, args, username) - args << %(-log "#{selenium_home}/log/#{name}.log") cmd = "#{selenium_home}/bin/#{name}.cmd" file cmd do content %("#{exec}" #{args.join(' ')}) action :create - notifies :request, "windows_reboot[Reboot to start #{name}]" + notifies :request_reboot, "reboot[Reboot to start #{name}]" end startup_path = "C:\\Users\\#{username}\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup" @@ -68,24 +61,15 @@ def selenium_windows_firewall(name, port) end end -def selenium_autologon(username, password, domain = nil) +def selenium_autologon(username, password) case node['platform_family'] when 'windows' - # TODO: REPLACE WITH windows_autologin cookbook - registry_key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' do - values [ - { name: 'AutoAdminLogon', type: :string, data: '1' }, - { name: 'DefaultUsername', type: :string, data: username }, - { name: 'DefaultPassword', type: :string, data: password }, - { name: 'DefaultDomainName', type: :string, data: domain } - ] - action :create + windows_autologin username do + password password end when 'mac_os_x' - node.override['macosx_autologin']['username'] = username - node.override['macosx_autologin']['password'] = password - recipe_eval do - run_context.include_recipe 'macosx_autologin::default' + macosx_autologin username do + password password end end end @@ -138,23 +122,37 @@ def selenium_linux_service(name, exec, args, port, display) end end -def selenium_mac_service(name, exec, args, plist, username) - execute "reload #{name}" do - command "launchctl unload -w #{plist}; launchctl load -w #{plist}" - user username - action :nothing - returns [0, 112] # 112 not logged into gui - end +def log_path(log, username) + return if log.nil? - directory '/var/log/selenium' do + directory 'create log dir' do + path log[0, log.rindex('/')] mode '0755' + recursive true + not_if { ::File.exist?(log) } end - file "/var/log/selenium/#{name}.log" do + file 'create log file' do + path log mode '0664' user username action :touch + not_if { ::File.exist?(log) } end +end + +def selenium_mac_service(new_resource, exec, args, plist, username) + name = selenium_mac_domain(new_resource.servicename) + log = new_resource.log + + execute "reload #{name}" do + command "launchctl unload -w #{plist}; launchctl load -w #{plist}" + user username + action :nothing + returns [0, 112] # 112 not logged into gui + end + + log_path(log, username) template plist do source 'org.seleniumhq.plist.erb' diff --git a/metadata.rb b/metadata.rb index 95c5202..13e5b14 100644 --- a/metadata.rb +++ b/metadata.rb @@ -16,5 +16,7 @@ supports 'ubuntu' supports 'windows' -depends 'nssm', '~> 1.2' -depends 'macosx_autologin', '~> 3.0' +depends 'macosx_autologin', '>= 4.0' +depends 'nssm' +depends 'windows' +depends 'windows_autologin', '>= 3.0' diff --git a/providers/hub.rb b/providers/hub.rb index 6bedd2d..bd19298 100644 --- a/providers/hub.rb +++ b/providers/hub.rb @@ -42,7 +42,7 @@ def args selenium_windows_firewall(new_resource.servicename, new_resource.port) when 'mac_os_x' plist = "/Library/LaunchDaemons/#{selenium_mac_domain(new_resource.servicename)}.plist" - selenium_mac_service(selenium_mac_domain(new_resource.servicename), selenium_java_exec, args, plist, nil) + selenium_mac_service(new_resource, selenium_java_exec, args, plist, nil) else selenium_linux_service(new_resource.servicename, selenium_java_exec, args, new_resource.port, nil) end diff --git a/providers/node.rb b/providers/node.rb index 48b434d..580049d 100644 --- a/providers/node.rb +++ b/providers/node.rb @@ -4,23 +4,14 @@ def whyrun_supported? true end -def use_selenium2_syntax? - selenium_version = node['selenium']['url'][/standalone-(.*)\.jar/, 1] - Gem::Version.new(selenium_version) < Gem::Version.new('3') -end - def config config_file = "#{selenium_home}/config/#{new_resource.servicename}.json" template config_file do source 'node_config.erb' cookbook 'selenium' - variables( - resource: new_resource, - use_selenium2_syntax: use_selenium2_syntax? - ) + variables(resource: new_resource) if platform_family?('windows') - notifies :request, "windows_reboot[Reboot to start #{new_resource.servicename}]", - :delayed + notifies :request_reboot, "reboot[Reboot to start #{new_resource.servicename}]", :delayed end notifies :restart, "service[#{new_resource.servicename}]", :delayed unless platform_family?('windows', 'mac_os_x') if platform_family?('mac_os_x') @@ -35,11 +26,6 @@ def args args = [] args << new_resource.jvm_args unless new_resource.jvm_args.nil? args << %W(-jar "#{selenium_jar_link}" -role node -nodeConfig "#{config}") - - new_resource.additional_args.each do |arg| - args << arg - end - args.flatten! end @@ -53,21 +39,15 @@ def args case node['platform'] when 'windows' - unless run_context.loaded_recipe? 'windows::reboot_handler' - recipe_eval do - run_context.include_recipe 'windows::reboot_handler' - end - end - selenium_windows_gui_service(new_resource.servicename, selenium_java_exec, args, new_resource.username) - selenium_autologon(new_resource.username, new_resource.password, new_resource.domain) + selenium_autologon(new_resource.username, new_resource.password) selenium_windows_firewall(new_resource.servicename, new_resource.port) - windows_reboot "Reboot to start #{new_resource.servicename}" do - reason "Reboot to start #{new_resource.servicename}" - timeout node['windows']['reboot_timeout'] + reboot "Reboot to start #{new_resource.servicename}" do action :nothing + reason 'Need to reboot when the run completes successfully.' + delay_mins 1 end when 'mac_os_x' plist = if new_resource.username && new_resource.password @@ -76,9 +56,7 @@ def args "/Library/LaunchDaemons/#{selenium_mac_domain(new_resource.servicename)}.plist" end - selenium_mac_service( - selenium_mac_domain(new_resource.servicename), selenium_java_exec, args, plist, new_resource.username - ) + selenium_mac_service(new_resource, selenium_java_exec, args, plist, new_resource.username) selenium_autologon(new_resource.username, new_resource.password) execute "Reboot to start #{selenium_mac_domain(new_resource.servicename)}" do diff --git a/recipes/hub.rb b/recipes/hub.rb index 01e3a2f..f898c37 100644 --- a/recipes/hub.rb +++ b/recipes/hub.rb @@ -3,15 +3,17 @@ port node['selenium']['hub']['port'] jvm_args node['selenium']['hub']['jvm_args'] newSessionWaitTimeout node['selenium']['hub']['newSessionWaitTimeout'] - servlets node['selenium']['hub']['servlets'] prioritizer node['selenium']['hub']['prioritizer'] + servlets node['selenium']['hub']['servlets'] + withoutServlets node['selenium']['hub']['withoutServlets'] capabilityMatcher node['selenium']['hub']['capabilityMatcher'] throwOnCapabilityNotPresent node['selenium']['hub']['throwOnCapabilityNotPresent'] - nodePolling node['selenium']['hub']['nodePolling'] cleanUpCycle node['selenium']['hub']['cleanUpCycle'] + debug node['selenium']['hub']['debug'] timeout node['selenium']['hub']['timeout'] browserTimeout node['selenium']['hub']['browserTimeout'] maxSession node['selenium']['hub']['maxSession'] jettyMaxThreads node['selenium']['hub']['jettyMaxThreads'] + log node['selenium']['hub']['log'] action :install end diff --git a/recipes/node.rb b/recipes/node.rb index 3565fc8..eec3690 100644 --- a/recipes/node.rb +++ b/recipes/node.rb @@ -6,12 +6,19 @@ maxSession node['selenium']['node']['maxSession'] register node['selenium']['node']['register'] registerCycle node['selenium']['node']['registerCycle'] - hubPort node['selenium']['node']['hubPort'] - hubHost node['selenium']['node']['hubHost'] + hub node['selenium']['node']['hub'] capabilities node['selenium']['node']['capabilities'] - additional_args node['selenium']['node']['additional_args'] - display node['selenium']['node']['display'] - domain node['selenium']['node']['domain'] + servlets node['selenium']['node']['servlets'] + withoutServlets node['selenium']['node']['withoutServlets'] + nodeStatusCheckTimeout node['selenium']['node']['nodeStatusCheckTimeout'] + nodePolling node['selenium']['node']['nodePolling'] + unregisterIfStillDownAfter node['selenium']['node']['unregisterIfStillDownAfter'] + downPollingLimit node['selenium']['node']['downPollingLimit'] + debug node['selenium']['node']['debug'] + timeout node['selenium']['node']['timeout'] + browserTimeout node['selenium']['node']['browserTimeout'] + jettyMaxThreads node['selenium']['node']['jettyMaxThreads'] + log node['selenium']['node']['log'] username node['selenium']['node']['username'] password node['selenium']['node']['password'] action :install diff --git a/resources/hub.rb b/resources/hub.rb index 436fff6..feaef44 100644 --- a/resources/hub.rb +++ b/resources/hub.rb @@ -2,19 +2,19 @@ default_action :install attribute :servicename, kind_of: String, name_attribute: true -attribute :host, kind_of: String, default: node['selenium']['hub']['host'] -attribute :port, kind_of: Integer, default: node['selenium']['hub']['port'] -attribute :jvm_args, kind_of: String, default: node['selenium']['hub']['jvm_args'] -attribute :newSessionWaitTimeout, kind_of: Integer, default: node['selenium']['hub']['newSessionWaitTimeout'] -attribute :servlets, kind_of: Array, default: node['selenium']['hub']['servlets'] -attribute :prioritizer, kind_of: [Class, String, Symbol], default: node['selenium']['hub']['prioritizer'] -attribute :capabilityMatcher, kind_of: String, default: node['selenium']['hub']['capabilityMatcher'] -attribute :throwOnCapabilityNotPresent, - kind_of: [TrueClass, FalseClass], - default: node['selenium']['hub']['throwOnCapabilityNotPresent'] -attribute :nodePolling, kind_of: Integer, default: node['selenium']['hub']['nodePolling'] -attribute :cleanUpCycle, kind_of: Integer, default: node['selenium']['hub']['cleanUpCycle'] -attribute :timeout, kind_of: Integer, default: node['selenium']['hub']['timeout'] -attribute :browserTimeout, kind_of: Integer, default: node['selenium']['hub']['browserTimeout'] -attribute :maxSession, kind_of: Integer, default: node['selenium']['hub']['maxSession'] -attribute :jettyMaxThreads, kind_of: Integer, default: node['selenium']['hub']['jettyMaxThreads'] +attribute :host, kind_of: [String, NilClass] +attribute :port, kind_of: Integer, default: 4444 +attribute :jvm_args, kind_of: [String, NilClass] +attribute :newSessionWaitTimeout, kind_of: Integer, default: -1 +attribute :prioritizer, kind_of: [Class, String, Symbol, NilClass] +attribute :servlets, kind_of: Array, default: [] +attribute :withoutServlets, kind_of: Array, default: [] +attribute :capabilityMatcher, kind_of: String, default: 'org.openqa.grid.internal.utils.DefaultCapabilityMatcher' +attribute :throwOnCapabilityNotPresent, kind_of: [TrueClass, FalseClass], default: true +attribute :cleanUpCycle, kind_of: Integer, default: 5000 +attribute :debug, kind_of: [TrueClass, FalseClass], default: false +attribute :timeout, kind_of: Integer, default: 1800 +attribute :browserTimeout, kind_of: Integer, default: 0 +attribute :maxSession, kind_of: Integer, default: 5 +attribute :jettyMaxThreads, kind_of: Integer, default: -1 +attribute :log, kind_of: [String, NilClass] diff --git a/resources/node.rb b/resources/node.rb index 473950b..2471c5a 100644 --- a/resources/node.rb +++ b/resources/node.rb @@ -2,24 +2,30 @@ default_action :install attribute :servicename, kind_of: String, name_attribute: true -attribute :host, kind_of: String, default: node['selenium']['node']['host'] -attribute :port, kind_of: Integer, default: node['selenium']['node']['port'] -attribute :jvm_args, kind_of: String, default: node['selenium']['node']['jvm_args'] -attribute :proxy, kind_of: String, default: node['selenium']['node']['proxy'] -attribute :maxSession, kind_of: Integer, default: node['selenium']['node']['maxSession'] -attribute :register, kind_of: [TrueClass, FalseClass], default: node['selenium']['node']['register'] -attribute :registerCycle, kind_of: Integer, default: node['selenium']['node']['registerCycle'] -attribute :hubPort, kind_of: Integer, default: node['selenium']['node']['hubPort'] -attribute :hubHost, kind_of: String, default: node['selenium']['node']['hubHost'] -attribute :capabilities, kind_of: [Array, Hash], default: node['selenium']['node']['capabilities'] -attribute :additional_args, kind_of: [Array, Hash], default: node['selenium']['node']['additional_args'] +attribute :host, kind_of: [String, NilClass] +attribute :port, kind_of: Integer, default: 5555 +attribute :jvm_args, kind_of: [String, NilClass] +attribute :proxy, kind_of: String, default: 'org.openqa.grid.selenium.proxy.DefaultRemoteProxy' +attribute :maxSession, kind_of: Integer, default: 5 +attribute :register, kind_of: [TrueClass, FalseClass], default: true +attribute :registerCycle, kind_of: Integer, default: 5000 +attribute :nodeStatusCheckTimeout, kind_of: Integer, default: 5000 +attribute :nodePolling, kind_of: Integer, default: 5000 +attribute :unregisterIfStillDownAfter, kind_of: Integer, default: 60_000 +attribute :downPollingLimit, kind_of: Integer, default: 2 +attribute :debug, kind_of: [TrueClass, FalseClass], default: false +attribute :servlets, kind_of: Array, default: [] +attribute :withoutServlets, kind_of: Array, default: [] +attribute :timeout, kind_of: Integer, default: 1800 +attribute :browserTimeout, kind_of: Integer, default: 0 +attribute :jettyMaxThreads, kind_of: Integer, default: -1 +attribute :log, kind_of: [String, NilClass] +attribute :hub, kind_of: String, default: 'http://localhost:4444' +attribute :capabilities, kind_of: [Array, Hash], default: [] # linux only - DISPLAY must match running instance of Xvfb, x11vnc or equivalent -attribute :display, kind_of: String, default: node['selenium']['node']['display'] - -# windows only -attribute :domain, kind_of: String, default: node['selenium']['node']['domain'] +attribute :display, kind_of: String, default: ':0' # mac/windows only - set username/password to run service in gui or leave nil to run service in background -attribute :username, kind_of: String, default: node['selenium']['node']['username'] -attribute :password, kind_of: String, default: node['selenium']['node']['password'] +attribute :username, kind_of: [String, NilClass], default: nil +attribute :password, kind_of: [String, NilClass], default: nil diff --git a/spec/unit/default_spec.rb b/spec/unit/default_spec.rb index 9364ca2..32385c1 100644 --- a/spec/unit/default_spec.rb +++ b/spec/unit/default_spec.rb @@ -6,7 +6,7 @@ ChefSpec::SoloRunner.new(platform: 'windows', version: '2008R2') do |node| ENV['SYSTEMDRIVE'] = 'C:' node.override['selenium']['url'] = - 'https://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar' + 'https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar' end.converge(described_recipe) end @@ -31,12 +31,12 @@ end it 'downloads jar' do - expect(chef_run).to create_remote_file('C:/selenium/server/selenium-server-standalone-2.45.0.jar') + expect(chef_run).to create_remote_file('C:/selenium/server/selenium-server-standalone-3.0.1.jar') end it 'creates link to jar' do expect(chef_run).to create_link('C:/selenium/server/selenium-server-standalone.jar').with( - to: 'C:/selenium/server/selenium-server-standalone-2.45.0.jar' + to: 'C:/selenium/server/selenium-server-standalone-3.0.1.jar' ) end end @@ -45,7 +45,7 @@ let(:chef_run) do ChefSpec::SoloRunner.new(platform: 'centos', version: '7.0') do |node| node.override['selenium']['url'] = - 'https://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar' + 'https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar' end.converge(described_recipe) end @@ -70,14 +70,14 @@ end it 'downloads jar' do - expect(chef_run).to create_remote_file('/opt/selenium/server/selenium-server-standalone-2.45.0.jar').with( - source: 'https://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar' + expect(chef_run).to create_remote_file('/opt/selenium/server/selenium-server-standalone-3.0.1.jar').with( + source: 'https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar' ) end it 'creates link to jar' do expect(chef_run).to create_link('/opt/selenium/server/selenium-server-standalone.jar').with( - to: '/opt/selenium/server/selenium-server-standalone-2.45.0.jar' + to: '/opt/selenium/server/selenium-server-standalone-3.0.1.jar' ) end end @@ -86,7 +86,7 @@ let(:chef_run) do ChefSpec::SoloRunner.new(platform: 'mac_os_x', version: '10.10') do |node| node.override['selenium']['url'] = - 'https://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar' + 'https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar' end.converge(described_recipe) end @@ -111,12 +111,12 @@ end it 'downloads jar' do - expect(chef_run).to create_remote_file('/opt/selenium/server/selenium-server-standalone-2.45.0.jar') + expect(chef_run).to create_remote_file('/opt/selenium/server/selenium-server-standalone-3.0.1.jar') end it 'creates link to jar' do expect(chef_run).to create_link('/opt/selenium/server/selenium-server-standalone.jar').with( - to: '/opt/selenium/server/selenium-server-standalone-2.45.0.jar' + to: '/opt/selenium/server/selenium-server-standalone-3.0.1.jar' ) end end diff --git a/spec/unit/hub_spec.rb b/spec/unit/hub_spec.rb index 9459631..f5f2e3d 100644 --- a/spec/unit/hub_spec.rb +++ b/spec/unit/hub_spec.rb @@ -12,7 +12,7 @@ ChefSpec::SoloRunner.new(platform: 'windows', version: '2008R2', step_into: ['selenium_hub']) do |node| ENV['SYSTEMDRIVE'] = 'C:' node.override['selenium']['url'] = - 'https://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar' + 'https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar' node.override['java']['windows']['url'] = 'http://ignore/jdk-windows-64x.tar.gz' stub_command('netsh advfirewall firewall show rule name="selenium_hub" > nul').and_return(false) end.converge(described_recipe) @@ -35,10 +35,7 @@ args: '-jar """C:/selenium/server/selenium-server-standalone.jar"""'\ ' -role hub -hubConfig """C:/selenium/config/selenium_hub.json"""', params: { - AppDirectory: 'C:/selenium', - AppStdout: 'C:/selenium/log/selenium_hub.log', - AppStderr: 'C:/selenium/log/selenium_hub.log', - AppRotateFiles: 1 + AppDirectory: 'C:/selenium' } ) end @@ -48,7 +45,7 @@ end it 'reboots windows server' do - expect(chef_run).to_not request_windows_reboot('Reboot to start selenium_hub') + expect(chef_run).to_not request_reboot('Reboot to start selenium_hub') end end @@ -56,7 +53,7 @@ let(:chef_run) do ChefSpec::SoloRunner.new(platform: 'centos', version: '7.0', step_into: ['selenium_hub']) do |node| node.override['selenium']['url'] = - 'https://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar' + 'https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar' allow_any_instance_of(Chef::Provider).to receive(:selenium_systype).and_return('systemd') end.converge(described_recipe) end @@ -102,7 +99,8 @@ let(:chef_run) do ChefSpec::SoloRunner.new(platform: 'mac_os_x', version: '10.10', step_into: ['selenium_hub']) do |node| node.override['selenium']['url'] = - 'https://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar' + 'https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar' + node.override['selenium']['hub']['log'] = '/var/log/selenium/org.seleniumhq.selenium_hub.log' allow_any_instance_of(Chef::Recipe).to receive(:java_version_on_macosx?).and_return(false) end.converge(described_recipe) end diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb index 488737c..10e732e 100644 --- a/spec/unit/node_spec.rb +++ b/spec/unit/node_spec.rb @@ -18,7 +18,7 @@ ) do |node| ENV['SYSTEMDRIVE'] = 'C:' node.override['selenium']['url'] = - 'https://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar' + 'https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar' node.override['java']['windows']['url'] = 'http://ignore/jdk-windows-64x.tar.gz' node.override['selenium_test']['username'] = 'vagrant' node.override['selenium_test']['password'] = 'vagrant' @@ -41,10 +41,8 @@ ) end - it 'creates auto login registry_key' do - expect(chef_run).to create_registry_key( - 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' - ) + it 'sets up autologin' do + expect(chef_run).to enable_windows_autologin('vagrant') end it 'creates startup dir' do @@ -60,8 +58,7 @@ it 'creates selenium foreground command' do expect(chef_run).to create_file('C:/selenium/bin/selenium_node.cmd').with( content: '"C:\java\bin\java.exe" -jar "C:/selenium/server/selenium-server-standalone.jar" '\ - '-role node -nodeConfig "C:/selenium/config/selenium_node.json" '\ - '-log "C:/selenium/log/selenium_node.log"' + '-role node -nodeConfig "C:/selenium/config/selenium_node.json"' ) end @@ -70,7 +67,7 @@ end it 'reboots windows server' do - expect(chef_run).to_not request_windows_reboot('Reboot to start selenium_node') + expect(chef_run).to_not request_reboot('Reboot to start selenium_node') end end @@ -80,7 +77,7 @@ file_cache_path: '/var/chef/cache', platform: 'centos', version: '7.0', step_into: ['selenium_node'] ) do |node| node.override['selenium']['url'] = - 'https://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar' + 'https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar' allow_any_instance_of(Chef::Recipe).to receive(:firefox_version).and_return('33.0.0') allow_any_instance_of(Chef::Recipe).to receive(:chrome_version).and_return('39.0.0.0') allow_any_instance_of(Chef::Provider).to receive(:selenium_systype).and_return('systemd') @@ -121,31 +118,13 @@ end end - context 'selenium 2' do - let(:chef_run) do - ChefSpec::SoloRunner.new( - file_cache_path: '/var/chef/cache', platform: 'centos', version: '7.0', step_into: ['selenium_node'] - ) do |node| - node.override['selenium']['url'] = - 'https://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar' - allow_any_instance_of(Chef::Recipe).to receive(:firefox_version).and_return('33.0.0') - allow_any_instance_of(Chef::Recipe).to receive(:chrome_version).and_return('39.0.0.0') - allow_any_instance_of(Chef::Provider).to receive(:selenium_systype).and_return('systemd') - end.converge(described_recipe) - end - - it 'uses selenium version 2 syntax for config file' do - expect(chef_run).to render_file('/opt/selenium/config/selenium_node.json').with_content(/configuration/) - end - end - context 'selenium 3' do let(:chef_run) do ChefSpec::SoloRunner.new( file_cache_path: '/var/chef/cache', platform: 'centos', version: '7.0', step_into: ['selenium_node'] ) do |node| node.override['selenium']['url'] = - 'https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.0.jar' + 'https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar' allow_any_instance_of(Chef::Recipe).to receive(:firefox_version).and_return('33.0.0') allow_any_instance_of(Chef::Recipe).to receive(:chrome_version).and_return('39.0.0.0') allow_any_instance_of(Chef::Provider).to receive(:selenium_systype).and_return('systemd') @@ -154,7 +133,6 @@ it 'uses selenium version 3 syntax for config file' do expect(chef_run).to render_file('/opt/selenium/config/selenium_node.json') - expect(chef_run).not_to render_file('/opt/selenium/config/selenium_node.json').with_content(/"configuration"/) end end end diff --git a/templates/default/hub_config.erb b/templates/default/hub_config.erb index d4a2952..a626687 100644 --- a/templates/default/hub_config.erb +++ b/templates/default/hub_config.erb @@ -1,15 +1,24 @@ { - "host": <%= @resource.host %>, - "port": <%= @resource.port %>, +<% if @resource.host %> + "host": "<%= @resource.host %>", +<% end %> "newSessionWaitTimeout": <%= @resource.newSessionWaitTimeout %>, +<% if @resource.prioritizer %> + "prioritizer": <%= @resource.prioritizer %>, +<% end %> "servlets": <%= @resource.servlets %>, - "prioritizer": <%= @resource.prioritizer %>, + "withoutServlets": <%= @resource.withoutServlets %>, "capabilityMatcher": "<%= @resource.capabilityMatcher %>", "throwOnCapabilityNotPresent": <%= @resource.throwOnCapabilityNotPresent %>, - "nodePolling": <%= @resource.nodePolling %>, "cleanUpCycle": <%= @resource.cleanUpCycle %>, "timeout": <%= @resource.timeout %>, + "debug": <%= @resource.debug %>, + "timeout": <%= @resource.timeout %>, "browserTimeout": <%= @resource.browserTimeout %>, "maxSession": <%= @resource.maxSession %>, - "jettyMaxThreads": <%= @resource.jettyMaxThreads %> + "jettyMaxThreads": <%= @resource.jettyMaxThreads %>, +<% if @resource.log %> + "log": "<%= @resource.log %>", +<% end %> + "port": <%= @resource.port %> } diff --git a/templates/default/node_config.erb b/templates/default/node_config.erb index 7ca69b5..5987139 100644 --- a/templates/default/node_config.erb +++ b/templates/default/node_config.erb @@ -1,18 +1,26 @@ { "capabilities": <%= JSON.pretty_generate(@resource.capabilities) %>, - <% if @use_selenium2_syntax %> - "configuration": - { - <% end %> - "proxy": "<%= @resource.proxy %>", - "maxSession": <%= @resource.maxSession %>, - "port": <%= @resource.port %>, - "host": "<%= @resource.host %>", - "register": <%= @resource.register %>, - "registerCycle": <%= @resource.registerCycle %>, - "hubPort": <%= @resource.hubPort %>, - "hubHost": "<%= @resource.hubHost %>" -<% if @use_selenium2_syntax %> - } + "proxy": "<%= @resource.proxy %>", + "maxSession": <%= @resource.maxSession %>, + "port": <%= @resource.port %>, +<% if @resource.host %> + "host": "<%= @resource.host %>", <% end %> + "register": <%= @resource.register %>, + "registerCycle": <%= @resource.registerCycle %>, + "servlets": <%= @resource.servlets %>, + "withoutServlets": <%= @resource.withoutServlets %>, + "timeout": <%= @resource.timeout %>, + "debug": <%= @resource.debug %>, + "timeout": <%= @resource.timeout %>, + "browserTimeout": <%= @resource.browserTimeout %>, + "jettyMaxThreads": <%= @resource.jettyMaxThreads %>, + "nodeStatusCheckTimeout": <%= @resource.nodeStatusCheckTimeout %>, + "nodePolling": <%= @resource.nodePolling %>, + "unregisterIfStillDownAfter": <%= @resource.unregisterIfStillDownAfter %>, + "downPollingLimit": <%= @resource.downPollingLimit %>, +<% if @resource.log %> + "log": "<%= @resource.log %>", +<% end %> + "hub": "<%= @resource.hub %>" } diff --git a/test/fixtures/cookbooks/selenium_test/metadata.rb b/test/fixtures/cookbooks/selenium_test/metadata.rb index d4a62fd..f677a55 100644 --- a/test/fixtures/cookbooks/selenium_test/metadata.rb +++ b/test/fixtures/cookbooks/selenium_test/metadata.rb @@ -8,10 +8,9 @@ depends 'selenium' +depends 'dmg' +depends 'geckodriver' depends 'java_se', '~> 8.0' depends 'mozilla_firefox' - -depends 'xvfb' depends 'windows_screenresolution' - -depends 'dmg' +depends 'xvfb' diff --git a/test/fixtures/cookbooks/selenium_test/recipes/node.rb b/test/fixtures/cookbooks/selenium_test/recipes/node.rb index 0eda37a..f72d9e8 100644 --- a/test/fixtures/cookbooks/selenium_test/recipes/node.rb +++ b/test/fixtures/cookbooks/selenium_test/recipes/node.rb @@ -5,6 +5,7 @@ capabilities = [] include_recipe 'mozilla_firefox' +include_recipe 'geckodriver' capabilities << { browserName: 'firefox', diff --git a/test/integration/default/serverspec/default_spec.rb b/test/integration/default/serverspec/default_spec.rb index a98a59c..73d3f11 100644 --- a/test/integration/default/serverspec/default_spec.rb +++ b/test/integration/default/serverspec/default_spec.rb @@ -1,7 +1,7 @@ require 'serverspec_helper' describe 'selenium::default' do - version = '2.53.1' + version = '3.0.1' if os[:family] == 'windows' describe file('C:/selenium/config') do