install_cypress.sh 658B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. . bash_library.sh # source bash_library.sh
  3. # install nodjs if not installed
  4. (
  5. log "verify if nodjs is installed"
  6. dpkg -l | grep '^ii' | grep 'nodejs\s'
  7. if [ $? -eq 0 ]; then
  8. log "nodjs is installed"
  9. else
  10. log "install nodejs"
  11. sudo apt install curl
  12. curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
  13. sudo apt install -y nodejs
  14. fi
  15. )
  16. # install Cypress
  17. (
  18. log "go to functionnal_tests subdir.."
  19. cd functionnal_tests || exit 1;
  20. log "check if package.json exist"
  21. if [ ! -f package.json ]; then
  22. log "run npm init"
  23. npm init -y
  24. fi
  25. log "install cypress"
  26. npm install cypress --save-dev
  27. )