Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Generate Capabilities #6

Closed
mhemesath opened this issue Mar 31, 2015 · 3 comments
Closed

Auto Generate Capabilities #6

mhemesath opened this issue Mar 31, 2015 · 3 comments

Comments

@mhemesath
Copy link
Contributor

If you are interested, I wrapped your cookbook and updated it to auto-install the browsers and build the capabilities. If this is something you are interested in I can contribute this work back. This allows me to create roles that activate a browser for a given selenium node. Making it super easy to add/remove browsers to a given node without changing any attributes.

caps = []
if node['selenium']['node']['chrome']
  include_recipe 'chrome::default'
  caps.push({
      browserName: 'chrome',
      maxInstances: 5,
      seleniumProtocol: 'WebDriver'
  })
end

if node['selenium']['node']['firefox']
  include_recipe "firefox::default"
  caps.push({
      browserName: 'firefox',
      maxInstances: 2,
      seleniumProtocol: 'WebDriver'
  })
end

selenium_node 'selenium_node' do
  hubHost node['selenium']['node']['hubHost']
  capabilities caps
  action :install
end
@dhoer
Copy link
Owner

dhoer commented Mar 31, 2015

This cookbook was designed with "Separation of Concerns" pattern in mind. While firefox and chrome maybe a dependency, it is not a direct dependency and therefore not a concern for this cookbook. This makes the cookbook very flexible with little need to fork it if your environment is different. So if java is baked into your image or you want to use chromium, that doesn't impact this cookbook.

@dhoer
Copy link
Owner

dhoer commented Mar 31, 2015

Does that explanation make sense?

@mhemesath
Copy link
Contributor Author

Yup, that makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants