All Projects → dhoer → chef-selenium

dhoer / chef-selenium

Licence: MIT license
Chef cookbook to install and configure Selenium

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to chef-selenium

Docker Selenium
Docker images for the Selenium Grid Server
Stars: ✭ 5,476 (+32111.76%)
Mutual labels:  selenium-grid, selenium-node
WebGrid
Decentralized, scalable and robust implementation of a selenium-grid equivalent. Based on the WebDriver specification by the W3C.
Stars: ✭ 17 (+0%)
Mutual labels:  selenium-grid, selenium-node
Kitchen Ec2
A Test Kitchen Driver for Amazon EC2
Stars: ✭ 211 (+1141.18%)
Mutual labels:  chef
samba
Development repository for the samba cookbook
Stars: ✭ 30 (+76.47%)
Mutual labels:  chef
chef-drone
Chef cookbook for Drone
Stars: ✭ 23 (+35.29%)
Mutual labels:  chef
Oh My Vpn
Setup your own OpenVPN server in 30 seconds!
Stars: ✭ 220 (+1194.12%)
Mutual labels:  chef
Azure-WinRM-Terraform
Example Terraform plan for provisioning a Windows Server on Azure with WinRM
Stars: ✭ 19 (+11.76%)
Mutual labels:  chef
Apt
Development repository for the apt cookbook
Stars: ✭ 201 (+1082.35%)
Mutual labels:  chef
delivery-truck
DEPRECATED: Delivery build cb for pipelines
Stars: ✭ 36 (+111.76%)
Mutual labels:  chef
apparmor
Development repository for the apparmor cookbook
Stars: ✭ 13 (-23.53%)
Mutual labels:  chef
SeleniumWebDriverWithCSharp
BDD with Selenium Webdriver and Specflow using C#
Stars: ✭ 22 (+29.41%)
Mutual labels:  selenium-grid
Windows
Development repository for Chef Cookbook windows
Stars: ✭ 251 (+1376.47%)
Mutual labels:  chef
Nodejs
Development repository for the nodejs cookbook
Stars: ✭ 225 (+1223.53%)
Mutual labels:  chef
cookbook-cq
Chef cookbook for Adobe CQ (aka AEM)
Stars: ✭ 20 (+17.65%)
Mutual labels:  chef
Chef Cookbook
Development repository for Chef cookbook RabbitMQ
Stars: ✭ 212 (+1147.06%)
Mutual labels:  chef
ohai
Development repository for Chef Cookbook ohai
Stars: ✭ 49 (+188.24%)
Mutual labels:  chef
Chef Bcpc
Bloomberg Clustered Private Cloud distribution
Stars: ✭ 205 (+1105.88%)
Mutual labels:  chef
Packer
Packer helpers and templates for Docker, IIS, SQL Server and Visual Studio on Windows and Ubuntu
Stars: ✭ 242 (+1323.53%)
Mutual labels:  chef
fmw-chef-cookbook
Official repository of samples that show how to use Chef to provision Oracle Fusion Middleware (FMW) products.
Stars: ✭ 43 (+152.94%)
Mutual labels:  chef
omnibus
Prepares a machine to be an Omnibus builder. ┬──┬◡ノ(° -°ノ)
Stars: ✭ 28 (+64.71%)
Mutual labels:  chef

Selenium Cookbook

Cookbook Version linux osx win

This cookbook installs and configures Selenium 3+ (http://www.seleniumhq.org/).

This cookbook comes with the following recipes:

  • default - Downloads and installs Selenium Standalone jar.
  • hub - Installs and configures a Selenium Hub as a service.
  • node - Installs and configures a Selenium Node as service on Linux and a GUI service on Mac OS X and Windows.

Resources selenium_hub and selenium_node are also available.

Usage

See selenium_grid cookbook that wraps selenium, browsers, drivers, and screenresolution cookbooks into one comprehensive cookbook.

Requirements

  • Java (not installed by this cookbook)
  • Chef 12.6+

Platforms

  • CentOS, Fedora, RedHat
  • Mac OS X
  • Debian, Ubuntu
  • Windows

Cookbooks

  • 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

default

Downloads and installs Selenium Standalone jar.

Attributes

  • node['selenium']['url'] - The download URL of Selenium Standalone jar.
  • node['selenium']['windows']['home'] - Home directory. Default #{ENV['SYSTEMDRIVE']}/selenium.
  • node['selenium']['windows']['java'] - Path to Java executable. Default #{ENV['SYSTEMDRIVE']}\\java\\bin\\java.exe.
  • node['selenium']['unix']['home'] - Home directory. Default /opt/selenium.
  • node['selenium']['unix']['java'] - Path to Java executable. Default /usr/bin/java.

hub

Installs and configures a Selenium Hub as a service.

Attributes

See selenium_hub 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.

  • Firefox browser must be installed outside of this cookbook.
  • Linux nodes without a physical monitor require a headless display (e.g., xvfb, 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.

Attributes

See selenium_hub resource attributes for description.

Example

Install Selenium Node with Firefox and HtmlUnit capabilities

node.override['selenium']['node']['username'] = 'vagrant' if platform?('windows', 'mac_os_x')
node.override['selenium']['node']['password'] = 'vagrant' if platform?('windows', 'mac_os_x')

node.override['selenium']['node']['capabilities'] = [
  {
    browserName: 'firefox',
    maxInstances: 5,
    seleniumProtocol: 'WebDriver'
  },
  {
    browserName: 'htmlunit',
    maxInstances: 1,
    platform: 'ANY',
    seleniumProtocol: 'WebDriver'
  }
]
  
include_recipe 'selenium::node'

Resources

selenium_hub

Installs and configures a Selenium Hub as a service.

Attributes

  • 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

Installs and configures a Selenium Node as a service.

Attributes

  • 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. Default [].
  • 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.

Example

Install Selenium Node with Firefox and HtmlUnit capabilities

selenium_node 'selenium_node' do
  username 'vagrant' if platform?('windows', 'mac_os_x')
  password 'vagrant' if platform?('windows', 'mac_os_x')
  capabilities [
    {
      browserName: 'firefox',
      maxInstances: 5,
      seleniumProtocol: 'WebDriver'
    },
    {
      browserName: 'htmlunit',
      maxInstances: 1,
      platform: 'ANY',
      seleniumProtocol: 'WebDriver'
    }
  ]
  action :install
end

ChefSpec Matchers

This cookbook includes custom ChefSpec matchers you can use to test your own cookbooks.

Example Matcher Usage

expect(chef_run).to install_selenium_hub('resource_name').with(
  port: '4444'
)

Selenium Cookbook Matchers

  • install_selenium_hub(resource_name)
  • install_selenium_node(resource_name)

Getting Help

Contributing

Please refer to CONTRIBUTING.

License

MIT - see the accompanying LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].