local_browser_tests.sh 714 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. bundle install
  12. rm -rf tmp/cache/file_store
  13. rm -f public/assets/*.css*
  14. rm -f public/assets/*.js*
  15. #rake assets:precompile
  16. rake db:drop
  17. rake db:create
  18. rake db:migrate
  19. rake db:seed
  20. thin stop
  21. script/websocket-server.rb stop
  22. thin start --threaded -d -p 4444
  23. script/websocket-server.rb start -d
  24. sleep 15
  25. rake test:browser["BROWSER_URL=http://localhost:4444"]
  26. script/websocket-server.rb stop
  27. thin stop
  28. rm -f public/assets/*.css*
  29. rm -f public/assets/*.js*