Skip to content

Commit 89da4a8

Browse files
committed
update e2e test script
1 parent 18049d1 commit 89da4a8

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

build/e2e.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# use a different port to avoid conflicting with npm run serve
2+
PORT=8082
3+
4+
# serve example
5+
./node_modules/.bin/webpack-dev-server \
6+
--quiet --hot --history-api-fallback\
7+
--config example/webpack.config.js \
8+
--content-base example \
9+
--host 0.0.0.0 \
10+
--port $PORT &
11+
12+
# run e2e tests, make sure to kill the server no matter pass or fail
13+
PORT=$PORT ./node_modules/.bin/nightwatch \
14+
-c build/nightwatch.local.json \
15+
-e chrome,firefox \
16+
&& kill $! || (kill $! && exit 1)

build/release.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,21 @@ echo # (optional) move to a new line
66
if [[ $REPLY =~ ^[Yy]$ ]]
77
then
88
echo "Releasing $VERSION ..."
9+
# unit tests
10+
npm run test 2>/dev/null
11+
12+
# e2e tests
13+
npm run e2e-local 2>/dev/null
14+
15+
# build
916
VERSION=$VERSION npm run build
17+
18+
# # commit
1019
git add -A
1120
git commit -m "[build] $VERSION"
1221
npm version $VERSION --message "[release] $VERSION"
22+
23+
# # publish
1324
git push origin refs/tags/v$VERSION
1425
git push
1526
npm publish

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"build": "webpack --config build/webpack.build.dev.config.js && webpack --config build/webpack.build.min.config.js",
1111
"serve": "webpack-dev-server --quiet --hot --config example/webpack.config.js --content-base example --history-api-fallback --host 0.0.0.0",
1212
"serve-test": "webpack-dev-server --quiet --config test/unit/webpack.config.js --content-base test/unit --history-api-fallback --host 0.0.0.0 --port 8081",
13-
"e2e-local": "nightwatch -c build/nightwatch.local.json -e chrome,firefox",
1413
"e2e-sauce": "nightwatch -c build/nightwatch.sauce.json -e chrome,firefox,ie10,ie11",
15-
"release": "npm run test && npm run e2e-local && bash ./build/release.sh"
14+
"e2e-local": "bash ./build/e2e.sh",
15+
"release": "bash ./build/release.sh"
1616
},
1717
"repository": {
1818
"type": "git",

test/e2e/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* global router */
22

3-
var base = 'http://localhost:8080'
3+
var base = 'http://localhost:' + (process.env.PORT || 8080)
44

55
module.exports = {
66
'vue-router e2e tests': function (browser) {

0 commit comments

Comments
 (0)