Skip to content

Commit

Permalink
test: add End-2-End test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed Aug 12, 2019
1 parent 01db427 commit 7e7edcc
Show file tree
Hide file tree
Showing 10 changed files with 989 additions and 22 deletions.
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,25 @@ jobs:
name: Unit tests
command: yarn run test --maxWorkers=4

test_e2e:
<<: *defaults
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: End-2-End tests
command: |
yarn run website:build
yarn run test:e2e:saucelabs
workflows:
version: 2
ci:
jobs:
- test_build
- test_unit
- test_lint
- test_e2e
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_modules/
npm-debug.log
yarn-error.log
.DS_Store
.env

# Bundle build files
/dist
Expand Down
2 changes: 1 addition & 1 deletion examples/calendar-widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "1.0.0",
"private": true,
"scripts": {
"build": "rm -rf ./dist/ ./dist/ && rsync -r . ./dist/ && rsync -r ../../dist/ ./dist/"
"build": "rm -rf ./dist/ && mkdir dist && cp -r `ls -A | grep -v 'dist'` ./dist/ && cp ../../dist/* ./dist/"
}
}
2 changes: 1 addition & 1 deletion examples/media/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "1.0.0",
"private": true,
"scripts": {
"build": "rm -rf ./dist/ ./dist/ && rsync -r . ./dist/ && rsync -r ../../dist/ ./dist/"
"build": "rm -rf ./dist/ && mkdir dist && cp -r `ls -A | grep -v 'dist'` ./dist/ && cp ../../dist/* ./dist/"
}
}
2 changes: 1 addition & 1 deletion examples/tourism/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "1.0.0",
"private": true,
"scripts": {
"build": "rm -rf ./dist/ ./dist/ && rsync -r . ./dist/ && rsync -r ../../dist/ ./dist/"
"build": "rm -rf ./dist/ && mkdir dist && cp -r `ls -A | grep -v 'dist'` ./dist/ && cp ../../dist/* ./dist/"
}
}
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"type-check:watch": "yarn type-check --watch",
"test": "jest",
"test:watch": "jest --watch --bail",
"test:e2e": "yarn test:e2e:local",
"test:e2e:local": "wdio wdio.local.conf.js",
"test:e2e:saucelabs": "wdio wdio.saucelabs.conf.js",
"test:size": "bundlesize",
"test:argos": "argos upload functional-tests/screenshots --token $ARGOS_TOKEN || true",
"release": "./scripts/release/publish.js",
Expand Down Expand Up @@ -80,6 +83,13 @@
"@types/storybook__addon-actions": "^3.4.2",
"@typescript-eslint/eslint-plugin": "1.13.0",
"@typescript-eslint/parser": "1.13.0",
"@wdio/cli": "5.11.14",
"@wdio/jasmine-framework": "5.11.0",
"@wdio/local-runner": "5.11.14",
"@wdio/sauce-service": "5.11.1",
"@wdio/selenium-standalone-service": "5.11.2",
"@wdio/spec-reporter": "5.11.7",
"@wdio/static-server-service": "5.11.0",
"algoliasearch": "3.33.0",
"babel-eslint": "10.0.2",
"babel-jest": "24.8.0",
Expand All @@ -106,6 +116,7 @@
"eslint-plugin-prettier": "3.1.0",
"eslint-plugin-react": "7.14.3",
"inquirer": "6.5.1",
"instantsearch-e2e-tests": "algolia/instantsearch-e2e-tests#v1.0.0",
"jest": "24.8.0",
"jest-diff": "24.8.0",
"jest-environment-jsdom": "24.8.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/website/build-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ for example in examples/*; do
name=$(basename "$example")
echo "Building $name example..."

(cd "$example" && yarn && yarn build && rsync -r "dist/" "../../website/examples/$name/")
(cd "$example" && yarn && yarn build && cp -r "dist/" "../../website/examples/$name/")
fi
done
5 changes: 5 additions & 0 deletions wdio.local.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* eslint-disable import/no-commonjs, no-console */

const { local } = require('instantsearch-e2e-tests');

exports.config = local;
5 changes: 5 additions & 0 deletions wdio.saucelabs.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* eslint-disable import/no-commonjs, no-console */

const { saucelabs } = require('instantsearch-e2e-tests');

exports.config = saucelabs;
Loading

0 comments on commit 7e7edcc

Please sign in to comment.