UNPKG

2.41 kBYAMLView Raw
1version: 2
2jobs:
3 build:
4 docker:
5 - image: circleci/node:8.11-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 steps:
11 - checkout
12
13 - run:
14 name: Install Dependencies
15 command: |
16 sudo apt-get update
17 sudo apt-get install python-pip tcpdump
18
19 # Have to update firefox, default is ESR.
20 sudo pip install --upgrade pip
21 sudo pip install mozdownload mozinstall
22 mozdownload --version latest --destination firefox.tar.bz2
23 mozinstall firefox.tar.bz2
24 sudo cp -R firefox/* /opt/firefox/
25
26 # Latest chrome is already installed in the default container.
27 # curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
28 # sudo dpkg -i google-chrome.deb
29 # sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
30 # rm google-chrome.deb
31
32 - restore_cache:
33 key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}
34
35 - run: google-chrome --version
36
37 - run:
38 name: NPM Install
39 command: |
40 npm i
41 cd testapp && npm i
42
43 - save_cache:
44 key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}
45 paths:
46 - "node_modules"
47 - "testapp/node_modules"
48
49 - run:
50 name: Lint
51 command: ./node_modules/.bin/gulp lint
52
53 - run:
54 name: Selenium Start
55 background: true
56 command: |
57 ./node_modules/.bin/webdriver-manager update --versions.chrome=2.44
58 ./node_modules/.bin/webdriver-manager start --versions.chrome=2.44
59
60 - run:
61 name: TestApp Start
62 background: true
63 command: |
64 npm start
65
66 # Seems like the new circleci container no longer permits packet introspection on lo, even for root.
67 # - run:
68 # name: Extra tcp logging for BlockingProxy
69 # background: true
70 # command: sudo tcpdump -i lo 'tcp && dst localhost' -w $CIRCLE_ARTIFACTS/localdump.pcap
71
72 - run:
73 name: Test
74 command: npm test