Skip to content

Commit 6fe75cf

Browse files
committed
use Sauce Labs services to test against Chrome, Firefox, Internet Explorer, Microsoft Edge and Safari
1 parent e5c5198 commit 6fe75cf

File tree

4 files changed

+130
-19
lines changed

4 files changed

+130
-19
lines changed

.travis.yml

+43-18
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
---
22
language: php
3-
php:
4-
- 5.6
5-
- 7
3+
4+
matrix:
5+
include:
6+
- env: TEST_EMBER=true
7+
php: 7
8+
- env: TEST_EMBER=false
9+
php: 5.6
610

711
sudo: false
812

@@ -11,24 +15,45 @@ cache:
1115
- node_modules
1216

1317
before_install:
14-
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
15-
- "npm config set spin false"
16-
- "npm install -g npm@^2"
18+
- if $TEST_EMBER; then export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH; fi
19+
- if $TEST_EMBER; then npm config set spin false; fi
20+
- if $TEST_EMBER; then npm install -g npm@^2; fi
1721

1822
install:
19-
- npm install -g bower
20-
- npm install
21-
- npm prune
22-
- bower install
23-
- cd api/ && composer install --no-dev && cd .. # install non development composer requirements for api
23+
- if $TEST_EMBER; then npm install -g bower; fi
24+
- if $TEST_EMBER; then npm install; fi
25+
- if $TEST_EMBER; then npm prune; fi
26+
- if $TEST_EMBER; then bower install; fi
27+
# install non development composer requirements for api
28+
- if $TEST_EMBER; then cd api/ && composer install --no-dev && cd ..; fi
2429

2530
before_script:
26-
- ember server --live-reload=false & # Start a server so we can hit the fake API from integration tests
27-
- sleep 10 # wait for the server to be started
28-
- echo 'always_populate_raw_post_data = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini # http://php.net/manual/de/ini.core.php#ini.always-populate-raw-post-data
29-
- npm list # list all installed npm packages
31+
# Start a server so we can hit the API from integration tests
32+
- if $TEST_EMBER; then ember server --live-reload=false; fi &
33+
# wait for the server to be started
34+
- if $TEST_EMBER; then sleep 10; fi
35+
# http://php.net/manual/de/ini.core.php#ini.always-populate-raw-post-data
36+
- echo 'always_populate_raw_post_data = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
37+
# list all installed npm packages
38+
- if $TEST_EMBER; then npm list; fi
39+
# create a sauce tunnel
40+
- if $TEST_EMBER; then ember start-sauce-connect; fi
3041

3142
script:
32-
- npm test # run frontend and integration tests
33-
- cd api/ && composer install && cd .. # install development requirements for api to run api tests
34-
- cd api/ && ./vendor/bin/codecept run && cd .. # run api tests with codeception
43+
# run frontend and integration tests
44+
- if $TEST_EMBER; then npm test; fi
45+
# test against different browsers using sauce lab
46+
# we can not run the integration tests against api cause api is not available to test instance running at sauce lab
47+
# therefore we only run acceptance tests by filter
48+
# to do so we can not just add the launcher to testem ci configuration
49+
- if $TEST_EMBER; then ember test --launch='SL_chrome,SL_firefox,SL_edge,SL_ie,SL_safari' --test-port 8080 --filter 'Acceptance |'; fi
50+
# install development requirements for api to run api tests
51+
# not be done in install section cause otherwise integration tests would not fail
52+
# if api needs an dependency in production which is specified as development dependency
53+
- cd api/ && composer install && cd ..
54+
# run api tests with composer
55+
- cd api/ && ./vendor/bin/codecept run && cd ..
56+
57+
after_script:
58+
# destroy the sauce tunnel
59+
- if [$TEST_EMBER ]; then ember stop-sauce-connect; fi

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# croodle
22

33
[![Build Status](https://travis-ci.org/jelhan/croodle.svg?branch=master)](https://travis-ci.org/jelhan/croodle)
4+
[![Sauce Test Status](https://saucelabs.com/browser-matrix/jelhan.svg)](https://saucelabs.com/u/jelhan)
45

56
Croodle is a web application to schedule a date or to do a poll on a general topics. Stored content data like title and description, number and labels of options and available answers and names of users and there selections is encrypted/decrypted in the browser using 256 bits AES.
67

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"ember-cli-pretender": "0.3.2",
4646
"ember-cli-qunit": "^1.0.4",
4747
"ember-cli-release": "0.2.8",
48+
"ember-cli-sauce": "1.4.4",
4849
"ember-cli-sri": "^1.2.0",
4950
"ember-cli-uglify": "^1.2.0",
5051
"ember-cp-validations": "2.3.0",

testem.json

+85-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,91 @@
1212
"proxies": {
1313
"/": {
1414
"target": "http://localhost:4200",
15-
"onlyContentTypes": ["json"]
15+
"onlyContentTypes": [
16+
"json"
17+
]
18+
}
19+
},
20+
"launchers": {
21+
"SL_chrome": {
22+
"exe": "ember",
23+
"args": [
24+
"sauce:launch",
25+
"-b",
26+
"chrome",
27+
"-p",
28+
"Windows 10",
29+
"--vi",
30+
"public",
31+
"--at",
32+
"--no-ct",
33+
"--u"
34+
],
35+
"protocol": "browser"
36+
},
37+
"SL_firefox": {
38+
"exe": "ember",
39+
"args": [
40+
"sauce:launch",
41+
"-b",
42+
"firefox",
43+
"-p",
44+
"Windows 10",
45+
"--vi",
46+
"public",
47+
"--at",
48+
"--no-ct",
49+
"--u"
50+
],
51+
"protocol": "browser"
52+
},
53+
"SL_edge": {
54+
"exe": "ember",
55+
"args": [
56+
"sauce:launch",
57+
"-b",
58+
"microsoftedge",
59+
"--vi",
60+
"public",
61+
"--at",
62+
"--no-ct",
63+
"--u"
64+
],
65+
"protocol": "browser"
66+
},
67+
"SL_ie": {
68+
"exe": "ember",
69+
"args": [
70+
"sauce:launch",
71+
"-b",
72+
"internet explorer",
73+
"-v",
74+
"11",
75+
"-p",
76+
"Windows 10",
77+
"--vi",
78+
"public",
79+
"--at",
80+
"--no-ct",
81+
"--u"
82+
],
83+
"protocol": "browser"
84+
},
85+
"SL_safari": {
86+
"exe": "ember",
87+
"args": [
88+
"sauce:launch",
89+
"-b",
90+
"safari",
91+
"-v",
92+
"9",
93+
"--vi",
94+
"public",
95+
"--at",
96+
"--no-ct",
97+
"--u"
98+
],
99+
"protocol": "browser"
16100
}
17101
}
18102
}

0 commit comments

Comments
 (0)