local_browser_tests.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/bash
  2. while true; do
  3. read -p "Do you wish to drop the database and 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. export RAILS_SERVE_STATIC_FILES=true
  13. export ZAMMAD_SETTING_TTL=15
  14. export Z_LOCALES=en-us:de-de
  15. bundle install
  16. rm -rf tmp/screenshot*
  17. rm -rf tmp/cache*
  18. rm -f public/assets/*.css*
  19. rm -f public/assets/*.js*
  20. echo "rake assets:precompile"
  21. time rake assets:precompile
  22. echo "rake db:drop"
  23. time rake db:drop
  24. echo "rake db:create"
  25. time rake db:create
  26. echo "rake db:migrate"
  27. time rake db:migrate
  28. echo "rake db:seed"
  29. time rake db:seed
  30. # set system to develop mode
  31. rails r "Setting.set('developer_mode', true)"
  32. pumactl --pidfile tmp/pids/puma.pid stop
  33. script/websocket-server.rb stop
  34. #rails s puma -d --pid tmp/pids/puma.pid --bind 0.0.0.0 --port 4445
  35. rails s puma --pid tmp/pids/puma.pid --bind 0.0.0.0 --port 4445 &
  36. script/websocket-server.rb start -d
  37. script/scheduler.rb start
  38. sleep 16
  39. #export REMOTE_URL='http://medenhofer:765d0dd4-994b-4e15-9f89-13f3aedeb462@ondemand.saucelabs.com:80/wd/hub' BROWSER_OS='Windows 2012' BROWSER_VERSION=35 BROWSER=firefox
  40. #export REMOTE_URL='http://192.168.178.32:4444/wd/hub'
  41. #export REMOTE_URL='http://192.168.178.45:4444/wd/hub'
  42. #export REMOTE_URL='http://10.0.0.9:4444/wd/hub'
  43. #export REMOTE_URL='http://10.8.0.22:4449/wd/hub'
  44. export REMOTE_URL='http://localhost:4444/wd/hub'
  45. export RAILS_ENV=test
  46. echo "rake db:drop"
  47. time rake db:drop
  48. echo "rake db:create"
  49. time rake db:create
  50. echo "rake db:migrate"
  51. time rake db:migrate
  52. #rake test:browser["BROWSER_URL=http://10.8.0.6:3000"]
  53. rake test:browser["BROWSER_URL=http://localhost:4445"]
  54. #rake test:browser["BROWSER_URL=http://10.0.0.3:4445"]
  55. #rake test:browser["BROWSER_URL=http://localhost:4445 BROWSER=chrome"]
  56. script/scheduler.rb stop
  57. script/websocket-server.rb stop
  58. pumactl --pidfile tmp/pids/puma.pid stop
  59. rm -f public/assets/*.css*
  60. rm -f public/assets/*.js*