End to end Chef acceptance tests
- vagrant nodes (chef-metal)
- firefox
- knife exec
- headless browser
- additional browser support (chrome, ie)
- ec2 nodes
- docker nodes
- saucelabs integration
- test-kitchen (kitchen-metal)
First you will need a running Enterprise Chef server up and running. Check out ec-metal for starting up EC HA.
Copy test-config.template.yml to test-config.yml
Set app_host
to the chef server front-end url.
Set search_host
to the active search node url.
Set driver
to selenium. No other are drivers currently supported.
Set browser
to firefox.
Set wait_time
to 5. Good starting point.
Temporary: Create a user with username chef
and password password
. Create an org -- any name will do.
rake bundle # use binstubs
rake
- each spec may have isolated cookbooks and misc files
- configuration feature to either "sign up" a main user or use an existing account
- improve dynamic knife execution. Should generate a knife file with static content
- knife opc setup and cleanup support (pivotal)
- continue refactoring env vars usage
- some actions should be able to accept a string value or a factory object
- refactor shared app objects like modals and the grid canvas objects
- improve window handlers
- figure out best approach to preloading all page objects for each spec
- reorganize specs (features and scenarios) appropriately
- refactor atrocious util library
- add custom matcher for grid/find objects. LAME! expect(data_bags_page.find_data_bag(bag).text).to eq(bag.name)
- fix grid selectors (handle empty alerts)
- lock down gem versions
- rspec
- junit - coming soon
Some tests will need nodes in order to validate certain features. This is handled dynamically with chef-metal. The example currently used is weak, but shows that we can provision nodes during a test run using data collected from the tests.
During development of new pages and objects you'll find yourself in change-run-change-run mode. For UI tests, this is incredibly painful. This project comes equipped with a runtime console environment.
Run rake console
and let it load (using the test-config options)
require 'pages/login'
p = Page::Login.new
p.load
links = all('a')
chef-acceptance uses many tools
- Selenium Webdriver
- Capybara
- SitePrism
- FactoryGirl
- Faker
Automated environment maintenance is yet to be implemented and included as part of this project. For now, you can use knife-opc and the provided helper scripts.
- copy the pivotal.pem file from the chef server to
work/pivotal.pem
- create
work/knife-opc.rb
- content example below
#knife-opc.rb
node_name 'pivotal'
client_key 'pivotal.pem'
chef_server_root 'https://<chef-server-url>'
- cd to the scripts dir-- cuz I'm lazy
./delete_all_orgs.sh
Sayonara orgs!
The delete_all_users will respectfully not delete the pivotal user or ponyville users.