This commit is contained in:
Fredrik Wollsén 2018-06-19 10:39:55 +03:00
Родитель d722f37bcc
Коммит ab95d7406b
4 изменённых файлов: 36 добавлений и 20 удалений

Просмотреть файл

@ -3,6 +3,11 @@ jobs:
build:
docker:
- image: circleci/node:latest-browsers
environment:
FIREFOX_BIN: /home/circleci/checkout/firefox-release/firefox-bin
FIREFOX_AURORA_BIN: /home/circleci/checkout/firefox-beta/firefox-bin
FIREFOX_DEVELOPER_BIN: /home/circleci/checkout/firefox-devedition/firefox-bin
FIREFOX_NIGHTLY_BIN: /home/circleci/checkout/firefox-nightly/firefox-bin
working_directory: ~/checkout
@ -12,7 +17,7 @@ jobs:
# Download and cache dependencies (update the cache keys to force a newer version)
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}-20180618
- dependencies-and-browsers-{{ checksum "package.json" }}-20180619
- run:
name: Install dependencies
@ -21,14 +26,12 @@ jobs:
- run:
name: Install different versions of Firefox
command: |
./node_modules/.bin/get-firefox -b release -p linux -e
mv ./firefox ./firefox-release
./node_modules/.bin/get-firefox -b beta -p linux -e
mv ./firefox ./firefox-beta
./node_modules/.bin/get-firefox -b devedition -p linux -e
mv ./firefox ./firefox-devedition
./node_modules/.bin/get-firefox -b nightly -p linux -e
mv ./firefox ./firefox-nightly
[ ! -d "./firefox-release" ] && npx get-firefox -b release -p linux -e && mv ./firefox ./firefox-release || true
[ ! -d "./firefox-beta" ] && npx get-firefox -b beta -p linux -e && mv ./firefox ./firefox-beta || true
[ ! -d "./firefox-devedition" ] && npx get-firefox -b devedition -p linux -e && mv ./firefox ./firefox-devedition || true
[ ! -d "./firefox-nightly" ] && npx get-firefox -b nightly -p linux -e && mv ./firefox ./firefox-nightly || true
# Prevent any tests from using the default installed version of Firefox
sudo rm /usr/bin/firefox || true
- save_cache:
paths:
@ -38,7 +41,7 @@ jobs:
- firefox-beta
- firefox-release
- firefox-unbranded-release
key: v1-dependencies-{{ checksum "package.json" }}-20180618
key: dependencies-and-browsers-{{ checksum "package.json" }}-20180619
- run:
name: Reveal which Firefox versions are installed
@ -60,23 +63,27 @@ jobs:
- store_artifacts:
path: "dist"
- run:
name: Unit tests
command: npm run test:unit
# Firefox Release not yet at 61.0a1 which is required by the template
#- run:
# name: Test with Firefox Release
# command: FIREFOX_BINARY=/home/circleci/checkout/firefox-release/firefox-bin npm run test
# name: Functional tests with Firefox Release
# command: FIREFOX_BINARY=/home/circleci/checkout/firefox-release/firefox-bin npm run test:func
# Utils v5 does not work with Firefox Beta #200
#- run:
# name: Test with Firefox Beta
# command: FIREFOX_BINARY=/home/circleci/checkout/firefox-beta/firefox-bin npm run test
# name: Functional tests with Firefox Beta
# command: FIREFOX_BINARY=/home/circleci/checkout/firefox-beta/firefox-bin npm run test:func
- run:
name: Test with Firefox Developer Edition
command: FIREFOX_BINARY=/home/circleci/checkout/firefox-devedition/firefox-bin FIREFOX_DEVELOPER_BIN=/home/circleci/checkout/firefox-devedition/firefox-bin npm run test
name: Functional tests with Firefox Developer Edition
command: FIREFOX_BINARY=/home/circleci/checkout/firefox-devedition/firefox-bin npm run test:func
- run:
name: Test with Firefox Nightly
command: FIREFOX_BINARY=/home/circleci/checkout/firefox-nightly/firefox-bin npm run test
name: Functional tests with Firefox Nightly
command: FIREFOX_BINARY=/home/circleci/checkout/firefox-nightly/firefox-bin npm run test:func
- store_test_results:
path: "test/coverage"

1
.gitignore поставляемый
Просмотреть файл

@ -2,3 +2,4 @@ dist/*
node_modules/
.env
test/coverage
/firefox-*

Просмотреть файл

@ -117,6 +117,14 @@ Runs unit tests using Karma.
Code at [/test/unit/](/test/unit/).
Note: [The karma firefox launcher](https://github.com/karma-runner/karma-firefox-launcher) expects that the firefox binaries are located in slightly different places than `web-ext`. Example on how to workaround this on OSX:
```shell
cd /Applications/
ln -s FirefoxBeta.app FirefoxAurora.app
ln -s Firefox\ Nightly.app FirefoxNightly.app
```
### Functional tests
```shell

Просмотреть файл

@ -10,9 +10,9 @@ module.exports = function(config) {
singleRun: true,
browsers: [
// "Firefox",
// "FirefoxAurora", // Firefox Beta
"FirefoxDeveloper",
// "FirefoxAurora",
// "FirefoxNightly",
"FirefoxNightly",
],
frameworks: ["mocha", "chai"],
reporters,