test.sh 878 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. export PATH=$PATH:/opt/WebDriver/bin
  3. if [[ ${1} == "install" ]]; then
  4. /usr/bin/python3.8 -m venv sbase_env
  5. source sbase_env/bin/activate
  6. python --version
  7. python -m pip install --upgrade pip
  8. python -m pip install --upgrade -r requirements.txt
  9. seleniumbase download server
  10. seleniumbase install geckodriver
  11. seleniumbase install chromedriver
  12. deactivate
  13. exit
  14. elif [[ ${1} == "rmvm" ]]; then
  15. rm -rf sbase_env
  16. exit
  17. elif [[ ${1} == "grid-start" ]]; then
  18. source sbase_env/bin/activate
  19. seleniumbase grid-hub start
  20. seleniumbase grid-node start
  21. exit
  22. elif [[ ${1} == "grid-stop" ]]; then
  23. source sbase_env/bin/activate
  24. seleniumbase grid-hub stop
  25. seleniumbase grid-node stop
  26. exit
  27. fi
  28. source sbase_env/bin/activate
  29. python -m pytest test.py --dashboard --html=report.html --headless ${@}
  30. deactivate