forked from admc/wd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (59 loc) · 2.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
TEST_DIR = test/common test/unit test/local test/saucelabs test/ghostdriver
DEFAULT:
@echo
@echo ' make test -> run the unit and local tests (start selenium with chromedriver first).'
@echo ' make test_unit -> run the unit tests'
@echo ' make test_local -> run the local tests (start selenium with chromedriver first).'
@echo ' make test_saucelabs -> run the saucelabs tests (configure username/access_key first).'
@echo ' make test_ghostdriver -> run the ghostdriver tests (start ghostdriver first).'
@echo ' make test_coverage -> generate test coverage (install jscoverage first).'
@echo ' build_mapping -> build the mapping (implemented only).'
@echo ' build_full_mapping -> build the mapping (full).'
@echo
# run unit and local tests, start selenium server first
test:
./node_modules/.bin/mocha \
test/unit/*-test.js \
test/local/*-test.js
# run unit tests
test_unit:
./node_modules/.bin/mocha test/unit/*-test.js
# run local tests, start selenium server first
test_local:
./node_modules/.bin/mocha test/local/*-test.js
# run saucelabs test, configure username/key first
test_saucelabs:
./node_modules/.bin/mocha test/saucelabs/*-test.js
# run ghostdriver test, start ghostdriver first
test_ghostdriver:
./node_modules/.bin/mocha test/ghostdriver/*-test.js
# run test coverage, install jscoverage first
test_coverage:
rm -rf lib-cov
jscoverage --no-highlight lib lib-cov --exclude=bin.js
WD_COV=1 ./node_modules/.bin/mocha --reporter html-cov \
test/unit/*-test.js \
test/local/*-test.js \
test/saucelabs/*-test.js \
> coverage.html
_dox:
@mkdir -p tmp
@./node_modules/.bin/dox -r < lib/webdriver.js > tmp/webdriver-dox.json
@./node_modules/.bin/dox -r < lib/element.js > tmp/element-dox.json
# build the mapping (implemented only)
build_mapping: _dox
@node doc/mapping-builder.js
# build the mapping (full)
build_full_mapping: _dox
@node doc/mapping-builder.js full
.PHONY: \
test \
DEFAULT \
test_unit \
test_local \
test_saucelabs \
test_coverage \
test_ghostdriver \
build_mapping \
build_full_mapping \
_dox