Configure build script to run e2e

jh-changes
Shin'ya Ueoka 5 years ago
parent b04eecce7f
commit 69bfd59531
  1. 18
      .circleci/config.yml
  2. 1
      .gitignore
  3. 6
      package.json

@ -6,6 +6,7 @@ executors:
- image: circleci/node:10-stretch-browsers - image: circleci/node:10-stretch-browsers
environment: environment:
- FIREFOX_VERSION: "60.0esr" - FIREFOX_VERSION: "60.0esr"
- GECKODRIVER_VERSION: "0.24.0"
working_directory: ~ working_directory: ~
commands: commands:
@ -29,6 +30,18 @@ commands:
- ~/firefox - ~/firefox
- run: echo 'export PATH=~/firefox/$FIREFOX_VERSION:$PATH' >> $BASH_ENV - run: echo 'export PATH=~/firefox/$FIREFOX_VERSION:$PATH' >> $BASH_ENV
install_geckodriver:
steps:
- run:
name: Install geckodriver
command: |
mkdir -p geckodriver
url=https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz
curl -sSLf "$url" | tar -C geckodriver xvf -
echo 'export PATH=~/geckodriver/$GECKODRIVER_VERSION:$PATH' >> $BASH_ENV
setup_npm: setup_npm:
steps: steps:
- restore_cache: - restore_cache:
@ -61,10 +74,9 @@ jobs:
- checkout - checkout
- setup_npm - setup_npm
- run: npm run build - run: npm run build
- run: npm run ambassador:build
- run: - run:
name: Run web server name: Run geckodriver
command: node e2e/web-server command: geckodriver
background: true background: true
- run: npm run test:e2e - run: npm run test:e2e

1
.gitignore vendored

@ -1,5 +1,4 @@
/node_modules/ /node_modules/
/build/ /build/
/e2e/ambassador/build/
*.zip *.zip
lanthan-driver.log lanthan-driver.log

@ -5,11 +5,9 @@
"start": "webpack --mode development -w --debug --devtool inline-source-map", "start": "webpack --mode development -w --debug --devtool inline-source-map",
"build": "NODE_ENV=production webpack --mode production --progress --display-error-details", "build": "NODE_ENV=production webpack --mode production --progress --display-error-details",
"package": "npm run build && script/package.sh", "package": "npm run build && script/package.sh",
"lint": "eslint --ext .jsx,.js src e2e/ambassador/src", "lint": "eslint --ext .jsx,.js src",
"test": "karma start", "test": "karma start",
"test:e2e": "karma start e2e/karma.conf.js", "test:e2e": "mocha --timeout 5000 e2e"
"ambassador:start": "webpack --mode production -w --debug --context e2e/ambassador --config e2e/ambassador/webpack.config.js --devtool inline-source-map",
"ambassador:build": "webpack --mode production --context e2e/ambassador --config e2e/ambassador/webpack.config.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",