config.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. version: 2
  2. jobs:
  3. build:
  4. docker:
  5. - image: circleci/node:10.16-browsers
  6. environment:
  7. # Fix issue with selenium-server in containers.
  8. # See http://github.com/SeleniumHQ/docker-selenium/issues/87
  9. DBUS_SESSION_BUS_ADDRESS: /dev/null
  10. CHROME_REVISION: 652421
  11. CHROMEDRIVER_VERSION: 75.0.3770.90
  12. # To find this revision number:
  13. # 1. Find the exact chrome version you want: https://en.wikipedia.org/wiki/Google_Chrome_version_history
  14. # 2. Put that version in this tool: https://omahaproxy.appspot.com/
  15. # 3. Take the bumber from "Branch Base Position"
  16. # 4. Look for the closest number to that revision in the snapshots: https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Linux_x64/
  17. # CHROME 74 - 638880
  18. # CHROME 75 - 652421
  19. # CHROME 79 - 706915
  20. steps:
  21. - checkout
  22. - run:
  23. name: Install Dependencies
  24. command: |
  25. sudo apt-get update
  26. sudo apt-get install python-pip openjdk-8-jdk tcpdump
  27. # Install a specific version of Chrome (not latest)
  28. sudo rm -rf /opt/google
  29. sudo rm /usr/local/bin/chromedriver
  30. wget -q -O chrome.zip https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/${CHROME_REVISION}/chrome-linux.zip
  31. unzip chrome.zip
  32. rm chrome.zip
  33. sudo ln -sf ${PWD}/chrome-linux/chrome /usr/bin/chromium
  34. sudo ln -sf /usr/bin/chromium /usr/bin/chromium-browser
  35. sudo groupadd -r chrome && sudo useradd -r -g chrome -G audio,video chrome
  36. sudo mkdir -p /home/chrome/reports
  37. sudo chown -R chrome:chrome /home/chrome
  38. - restore_cache:
  39. key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}
  40. - run:
  41. name: NPM Install
  42. command: |
  43. npm i
  44. cd testapp && npm i
  45. - save_cache:
  46. key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}
  47. paths:
  48. - "node_modules"
  49. - "testapp/node_modules"
  50. - run:
  51. name: Lint
  52. command: ./node_modules/.bin/gulp lint
  53. - run:
  54. name: Selenium Start
  55. background: true
  56. command: |
  57. ./node_modules/.bin/webdriver-manager update --versions.standalone=3.141.59 --versions.chrome=${CHROMEDRIVER_VERSION} --versions.gecko=v0.26.0
  58. sudo cp ./node_modules/webdriver-manager/selenium/chromedriver_${CHROMEDRIVER_VERSION} /usr/local/bin/chromedriver
  59. ./node_modules/.bin/webdriver-manager start --versions.standalone=3.141.59 --versions.chrome=${CHROMEDRIVER_VERSION} --versions.gecko=v0.26.0
  60. - run:
  61. name: TestApp Start
  62. background: true
  63. command: |
  64. npm start
  65. - run:
  66. name: Test
  67. command: npm test