Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

selenium (46) Versions 2.3.0

Installs/Configures Selenium

Policyfile
Berkshelf
Knife
cookbook 'selenium', '= 2.3.0', :supermarket
cookbook 'selenium', '= 2.3.0'
knife supermarket install selenium
knife supermarket download selenium
README
Dependencies
Changelog
Quality 100%

Selenium Cookbook

Cookbook Version
Build Status
GitHub Issues

This cookbook installs and configures Selenium and WebDriver components (http://www.seleniumhq.org/).

This cookbook comes with the following Resource/Providers:

Roadmap

Requirements

  • Chef 11.14 or higher (sensitive resource introduced)

Platforms

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

Cookbooks

These cookbooks are referenced with suggests, so be sure to depend on cookbooks that apply:

  • windows
  • nssm - Required for Windows services only (e.g. Hub, PhantomJS, and HtmlUnit running in background)

Usage

See selenium_test
cookbook for working cross platform examples. Note that provided examples in this cookbook have passwords
unencrypted for simplicity.

selenium_hub

Installs and configures selenium-grid hubs.

Requirements

  • Java must be installed outside of this cookbook.

Example

Install selenium-grid hub
selenium_hub 'selenium_hub' do
  action :install
end

Attributes

This is a partial list of attributes available. See
hub
resource for the complete listing of attributes.

  • name - Name attribute. The name of the service.
  • host - Hostname. Defaults to null.
  • port - Port. Defaults to 4444.

selenium_node

Installs and configures selenium-grid nodes with support for
ChromeDriver,
FirefoxDriver,
HtmlUnitDriver, and
InternetExplorerDriver.

Requirements

  • Java must be installed outside of this cookbook.
  • Browsers (e.g., chrome, firefox, etc...) 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 (with the exception of HtmlUnitDriver) 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.

Example

Install selenium-grid node with Chrome, Firefox, HtmlUnit and Internet Explorer capability
selenium_node 'selenium_node' do
  username 'Administrator' if platform?('windows')
  password 'password' if platform?('windows')
  capabilities [
    {
      browserName: 'chrome',
      maxInstances: 5,
      seleniumProtocol: 'WebDriver'
    },
    {
      browserName: 'firefox',
      maxInstances: 5,
      seleniumProtocol: 'WebDriver'
    },
    {
      browserName: 'htmlunit',
      maxInstances: 1,
      platform: 'ANY',
      seleniumProtocol: 'WebDriver'
    },
    {
      browserName: 'internet explorer',
      maxInstances: 1,
      seleniumProtocol: 'WebDriver'
    }
  ]
  action :install
end

Attributes

This is a partial list of attributes available. See
node
resource for the complete listing of attributes.

  • name - Name attribute. The name of the service or Windows foreground startup script.
  • host - Hostname. Defaults to null.
  • port - Port. Defaults to 5555.
  • hubHost - Selenium-grid hub hostname. Defaults to ip.
  • hubPort - Selenium-grid hub port. Defaults to 4444.
  • capabilities - The following drivers are supported and installed based on capabilities:
  • Mac OS X/Windows only - Set both username and password to run as a GUI service or leave nil to run service in background:
    • username - Defaults to nil.
    • password - Defaults to 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. Defaults to nil.

selenium_phantomjs

Installs and configures PhantomJS as a selenium-grid node or as a standalone server via
GhostDriver (Mac OS X is not supported).

Requirements

  • PhantomJS must be installed outside of this cookbook.
  • Windows nodes have the option to run as a GUI service and that requires a username and password to automatically login. Note that Windows password is stored unencrypted under windows registry HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.

Examples

Install PhantomJS as a selenium-grid node
selenium_phantomjs 'selenium_phantomjs' do
  action :install
end
Install PhantomJS as a standalone server by setting webdriverSeleniumGridHub to false
selenium_phantomjs 'selenium_phantomjs_nogrid' do
  webdriverSeleniumGridHub false
  action :install
end

Attributes

This is a partial list of attributes available. See
phantomjs
resource for the complete listing of attributes.

  • name - Name attribute. The name of the service or Windows foreground startup script.
  • webdriver - Webdriver ip:port. Defaults to #{node['ipaddress']}:8910.
  • webdriverSeleniumGridHub - Webdriver selenium-grid hub url. Set to false to install PhantomJS as a standalone service. Defaults to http://#{node['ipaddress']}:4444.
  • Windows only - Set both username and password to run as a GUI service or leave nil to run service in background:
    • username - Defaults to nil.
    • password - Defaults to nil. Note that Windows password is stored unencrypted under windows registry HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.
    • domain - Optional. Defaults to nil.

ChefSpec Matchers

The Selenium 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)
  • install_selenium_phantomjs(resource_name)

Getting Help

Contributing

Please refer to CONTRIBUTING.

License

MIT - see the accompanying LICENSE file for details.

Changelog

2.3.0 - 6/5/2015

  • Add support for Mac OS X (Chef 11.14 or higher required)

2.2.6 - 5/26/2015

  • Fix #11 chromedriver version does not update
  • Update ChromeDriver from 2.14 to 2.15

2.2.5 - 5/1/2015

  • Fix #10 'failed to allocate memory' exception on Windows 2008

2.2.4 - 4/12/2015

  • Fix selenium_node provider depends on windows
  • Set Windows display resolution in selenium_test cookbook

2.2.3 - 3/23/2015

  • Wrap host and hubHost in quotes in node config
  • Update IE driver from 2.44.0 to 2.45.0

2.2.2 - 2/26/2015

  • Firefox 36 breaks WebDriver 2.44.0

2.2.1 - 2/18/2015

  • Update ChromeDriver from 2.12 to 2.14

2.2.0 - 2/5/2015

  • Make Windows service an option for HtmlUnit and PhantomJS

2.1.0 - 2/2/2015

  • Support HtmlUnit

2.0.0 - 2/2/2015

  • Replace PhantomJS attributes

1.0.0 - 2/1/2015

  • Initial release

Foodcritic Metric
            

2.3.0 passed this metric