local_browser_tests.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. while true; do
  3. read -p "Do you wish to drop database ane execute all browser tests?" yn
  4. case $yn in
  5. [Yy]* ) echo "Start tests..."; break;;
  6. [Nn]* ) exit;;
  7. * ) echo "Please answer yes or no.";;
  8. esac
  9. done
  10. #export RAILS_ENV=test
  11. export RAILS_ENV=production
  12. bundle install
  13. rm -rf tmp/cache/file_store
  14. rm -f public/assets/*.css*
  15. rm -f public/assets/*.js*
  16. rake assets:precompile
  17. rake db:drop
  18. rake db:create
  19. rake db:migrate
  20. rake db:seed
  21. #thin stop
  22. pumactl --pidfile tmp/pids/puma.pid stop
  23. script/websocket-server.rb stop
  24. #thin start --threaded -d -p 4444
  25. pumactl start --pidfile tmp/pids/puma.pid -d -p 4444 -e $RAILS_ENV
  26. script/websocket-server.rb start -d
  27. sleep 15
  28. #export REMOTE_URL='http://medenhofer:765d0dd4-994b-4e15-9f89-13f3aedeb462@ondemand.saucelabs.com:80/wd/hub' BROWSER_OS='Windows 2012' BROWSER_VERSION=20 BROWSER=firefox
  29. rake test:browser["BROWSER_URL=http://localhost:4444"]
  30. #rake test:browser["BROWSER_URL=http://192.168.178.20:4444"]
  31. script/websocket-server.rb stop
  32. pumactl --pidfile tmp/pids/puma.pid stop
  33. #thin stop
  34. rm -f public/assets/*.css*
  35. rm -f public/assets/*.js*