Skip to content

Commit

Permalink
switched to gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
sebv committed Jun 30, 2014
1 parent 651bd59 commit 47fa931
Show file tree
Hide file tree
Showing 32 changed files with 1,287 additions and 960 deletions.
34 changes: 18 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,30 @@ env:
- secure: "P6rr9zRzJfodqw7dCKZAQtBi8rcMwYAhXwyk27k+8tRbKdoMyxPDGByo1EEW\n39Y7W53gmXYgjb6FZcwwJ/d+yr6DpZuxbcGt75HmsHltJPTJB4OzXQCliod+\nMRw6VQmHdnZVMS2yHBc4OXrVfM99o4k2uNcq4dapgX8K3oflY5A="
- secure: "ZQggUDYRhdI8SCC+VkcKZ8AHV1KlnJzGhsBC2yIhWLJaog1nPR8mXsYrWI2H\njQCxT5aGDng2ho856P5M0LFRYN9Qv2g3XPclq+SjDZubbH9v7rjB0YYpntHz\nxP88ykl5T4wImDmA0j4fmYsdqJwW2XyDgKCk2mjiMJAvtkzbtCI="
- TIMEOUT=600000
# - HTTP_TIMEOUT=300000
- HTTP_RETRIES=10
- HTTP_RETRY_DELAY=10000
# - HTTP_TIMEOUT=60000
- HTTP_RETRIES=3
- HTTP_RETRY_DELAY=5000
- DEBUG_CONNECTION=1
- CONCURRENCY=1
- VERBOSE=1
- SAUCE_CONNECT_VERSION='4.3'
matrix:
- BROWSER=multi
- BROWSER=chrome
- BROWSER=firefox
- BROWSER=explorer
- BROWSER=iphone
- BROWSER=ipad
- CONFIG=unit
- CONFIG=multi
- CONFIG=chrome
- CONFIG=firefox
- CONFIG=explorer
- CONFIG=iphone
- CONFIG=ipad
matrix:
include:
- node_js: "0.11"
env: BROWSER=chrome
# moving android in one job at the end cause it is superslow
- node_js: "0.10"
env: BROWSER=all_androids
env: CONFIG=chrome_e2e
allow_failures:
- node_js: "0.11"
env: BROWSER=chrome
env: CONFIG=chrome_e2e
before_script:
- "make setup_sauce_connect"
- npm install -g gulp mocha bdd-with-opts
- npm update
script:
- "make test_travis"
- "gulp travis --config $CONFIG --sauce"
166 changes: 35 additions & 131 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
TEST_DIR = test/common test/unit test/local test/saucelabs test/ghostdriver
BROWSER = $(shell node test/helpers/make-tool env BROWSER)
BROWSER_SKIP = $(shell node test/helpers/make-tool env BROWSER_SKIP)
MULTI = $(shell node test/helpers/make-tool env MULTI)
MOBILE = $(shell node test/helpers/make-tool env MOBILE)
SHORT = $(shell node test/helpers/make-tool env SHORT)

DEFAULT:
@echo
@echo ' make jshint -> jshint code.'
@echo ' make test -> run all local tests (start selenium with chromedriver first).'
@echo ' make test_sauce -> run sauce tests (start sauce connect first).'
@echo ' make test_mobile_sauce -> run mobile sauce tests (start sauce connect first).'
@echo ' make test_unit -> run the unit tests'
@echo ' make test_midway -> run the midway tests (start selenium with chromedriver first).'
@echo ' make test_midway_mobile -> run the mobile midway tests (seteup ios and android driver first).'
@echo ' make test_e2e -> run the e2e tests (start selenium with chromedriver first).'
@echo ' make test_midway_sauce_connect -> run the midway tests using sauce connect.'
@echo ' make test_midway_mobile_sauce_connect -> run the midway mobile tests using sauce connect.'
@echo ' make test_e2e_sauce -> run the e2e tests on sauce.'
@echo ' mapping -> build the mapping (implemented only).'
@echo ' full_mapping -> build the mapping (full).'
@echo ' unsupported_mapping -> build the mapping (unsupported).'
Expand All @@ -30,93 +13,40 @@ DEFAULT:
@echo ' test_ios test_iphone test_ipad'
@echo ' test_android test_android_phone test_android_tablet'

jshint:
./node_modules/.bin/jshint lib test browser-scripts

test:
make jshint
BROWSER=multi make test_unit test_midway
BROWSER=chrome make test_midway test_e2e
BROWSER=firefox make test_midway test_e2e

test_sauce:
BROWSER=multi make test_unit test_midway_sauce_connect
BROWSER=chrome make test_midway_sauce_connect test_e2e_sauce
BROWSER=firefox make test_midway_sauce_connect test_e2e_sauce

test_unit:
SAUCE_USERNAME= SAUCE_ACCESS_KEY= ./node_modules/.bin/mocha test/specs/*-specs.js

test_midway:
ifeq ($(MULTI),true)
./node_modules/.bin/mocha test/midway/*-specs.js -g '@multi'
else ifeq ($(SHORT),true)
./node_modules/.bin/mocha \
test/midway/api-*-specs.js \
test/midway/element-specs.js \
test/midway/asserters-specs.js \
-g "@skip-${BROWSER_SKIP}|@multi" -i
else
./node_modules/.bin/mocha \
test/midway/*-specs.js -g \
test/midway/suffixes/*-specs.js \
-g "@skip-${BROWSER_SKIP}|@multi" -i
endif

test_midway_mobile:
./node_modules/.bin/mocha \
test/midway/api-nav-specs.js \
test/midway/api-el-specs.js \
test/midway/api-exec-specs.js \
test/midway/mobile-specs.js \
-g "@skip-${BROWSER_SKIP}" -i

test_e2e:
./node_modules/.bin/mocha test/e2e/*-specs.js -g "@skip-${BROWSER_SKIP}|@multi" -i

test_midway_sauce_connect:
SAUCE_CONNECT=1 SAUCE_JOB_ID=`git rev-parse --short HEAD` make test_midway

test_midway_mobile_sauce_connect:
SAUCE_CONNECT=1 SAUCE_JOB_ID=`git rev-parse --short HEAD` make test_midway_mobile

# run saucelabs test, configure username/key first
test_e2e_sauce:
SAUCE=1 SAUCE_JOB_ID=`git rev-parse --short HEAD` make test_e2e

test_mobile_sauce:
BROWSER=android make test_midway_mobile_sauce_connect
BROWSER=ios make test_midway_mobile_sauce_connect

test_travis:
ifeq ($(MULTI),true)
make jshint
make test_unit
ifneq ($(TRAVIS_PULL_REQUEST),false)
@echo 'Skipping Sauce Labs tests as this is a pull request'
else
@echo make test_midway_sauce_connect
endif
else
ifneq ($(TRAVIS_PULL_REQUEST),false)
@echo 'Skipping Sauce Labs tests as this is a pull request'
else
ifeq ($(BROWSER),all_androids)
BROWSER=android_tablet make test_midway_mobile_sauce_connect
BROWSER=android_phone make test_midway_mobile_sauce_connect
else ifeq ($(MOBILE),true)
make test_midway_mobile_sauce_connect
else
make test_midway_sauce_connect
make test_e2e_sauce
endif
endif
endif


test_coverage:
rm -rf coverage
./node_modules/.bin/istanbul cover test/coverage/run_tests.js --
# test_sauce:
# BROWSER=multi make test_unit test_midway_sauce_connect
# BROWSER=chrome make test_midway_sauce_connect test_e2e_sauce
# BROWSER=firefox make test_midway_sauce_connect test_e2e_sauce


# test_travis:
# ifeq ($(MULTI),true)
# make jshint
# make test_unit
# ifneq ($(TRAVIS_PULL_REQUEST),false)
# @echo 'Skipping Sauce Labs tests as this is a pull request'
# else
# @echo make test_midway_sauce_connect
# endif
# else
# ifneq ($(TRAVIS_PULL_REQUEST),false)
# @echo 'Skipping Sauce Labs tests as this is a pull request'
# else
# ifeq ($(BROWSER),all_androids)
# BROWSER=android_tablet make test_midway_mobile_sauce_connect
# BROWSER=android_phone make test_midway_mobile_sauce_connect
# else ifeq ($(MOBILE),true)
# make test_midway_mobile_sauce_connect
# else
# make test_midway_sauce_connect
# make test_e2e_sauce
# endif
# endif
# endif

# test_coverage:
# rm -rf coverage
# ./node_modules/.bin/istanbul cover test/coverage/run_tests.js --

_dox:
@mkdir -p tmp
Expand All @@ -139,35 +69,9 @@ full_mapping: _dox
unsupported_mapping: _dox
@node doc/mapping-builder.js unsupported

setup_sauce_connect:
ifneq ($(TRAVIS_PULL_REQUEST),false)
@echo 'Skipping Sauce Connect setup as this is a pull request'
else
./node_modules/.bin/install_sauce_connect
./node_modules/.bin/travis_start_sauce_connect
endif

.PHONY: \
DEFAULT \
jshint \
test \
test_sauce \
test_unit \
test_midway \
test_e2e \
test_midway_sauce_connect \
test_e2e_sauce \
test_mobile \
test_ios \
test_ipad \
test_iphone \
test_android \
test_android_phone \
test_android_tablet \
test_travis \
test_coverage \
mapping \
full_mapping \
unsupported_mapping \
_dox \
setup_sauce_connect
_dox
Loading

0 comments on commit 47fa931

Please sign in to comment.