Skip to content

Commit b8c02ca

Browse files
authored
Replace SauceLabs with BrowserStack (#171)
1 parent 25b9bf0 commit b8c02ca

11 files changed

+581
-557
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@
2525
/.node_modules.ember-try/
2626
/bower.json.ember-try
2727
/package.json.ember-try
28+
29+
# BrowserStack
30+
/*.pid
31+
/*.log

.travis.yml

+20-20
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ matrix:
88
- env: TEST="API"
99
php: 5.6
1010
- env: TEST="EMBER"
11-
- env: TEST="SAUCE"
12-
allow_failures:
13-
- env: TEST="SAUCE"
11+
- env: TEST="BROWSER"
1412

1513
dist: trusty
1614
sudo: false
@@ -21,36 +19,38 @@ addons:
2119
cache:
2220
yarn: true
2321

22+
env:
23+
global:
24+
- "BROWSERSTACK_USERNAME=jeldrikhanschke1"
25+
- "BROWSERSTACK_ACCESS_KEY=xaM9Uxurv2GyxFLKQXgj"
26+
2427
before_install:
25-
- if [ "$TEST" == "API" ]; then export TEST_API=true; else export TEST_API=false; fi
26-
- if [ "$TEST" == "EMBER" ]; then export TEST_EMBER=true; else export TEST_EMBER=false; fi
27-
- if [ "$TEST" == "SAUCE" ]; then export TEST_SAUCE=true; else export TEST_SAUCE=false; fi
28-
# provide yarn and bower if ember build is tested
29-
- if $TEST_EMBER || $TEST_SAUCE; then curl -o- -L https://yarnpkg.com/install.sh | bash; fi
30-
- if $TEST_EMBER || $TEST_SAUCE; then export PATH=$HOME/.yarn/bin:$PATH; fi
28+
# provide yarn if ember build is tested
29+
- if [ $TEST = "EMBER" ] || [ $TEST = "BROWSER" ]; then curl -o- -L https://yarnpkg.com/install.sh | bash; fi
30+
- if [ $TEST = "EMBER" ] || [ $TEST = "BROWSER" ]; then export PATH=$HOME/.yarn/bin:$PATH; fi
3131

3232
install:
3333
# install dependencies for client
34-
- if $TEST_EMBER || $TEST_SAUCE; then yarn install --no-interactive; fi
34+
- if [ $TEST = "EMBER" ] || [ $TEST = "BROWSER" ]; then yarn install --no-interactive; fi
3535
# install dependencies for api
36-
- if $TEST_API; then cd api/ && composer install && cd ..; fi
36+
- if [ $TEST = "API" ]; then cd api/ && composer install && cd ..; fi
3737

3838
before_script:
3939
# http://php.net/manual/de/ini.core.php#ini.always-populate-raw-post-data
40-
- if $TEST_API; then echo 'always_populate_raw_post_data = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
41-
# create a sauce tunnel
42-
- if $TEST_SAUCE; then node_modules/ember-cli/bin/ember sauce:connect; fi
40+
- if [ $TEST = "API" ]; then echo 'always_populate_raw_post_data = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
41+
# create a browser stack tunnel for cross-browser testing
42+
- if [ $TEST = "BROWSER" ]; then node_modules/ember-cli/bin/ember browserstack:connect; fi
4343

4444
script:
4545
# run frontend and integration tests
46-
- if $TEST_EMBER; then yarn run lint:hbs; fi
47-
- if $TEST_EMBER; then yarn run lint:js; fi
48-
- if $TEST_EMBER; then yarn test; fi
46+
- if [ $TEST = "EMBER" ]; then yarn run lint:hbs; fi
47+
- if [ $TEST = "EMBER" ]; then yarn run lint:js; fi
48+
- if [ $TEST = "EMBER" ]; then yarn test; fi
4949
# test against different browsers using sauce lab
50-
- if $TEST_SAUCE; then node_modules/ember-cli/bin/ember test --launch='SL_chrome,SL_firefox,SL_edge,SL_ie,SL_safari' --test-port 8080; fi
50+
- if [ $TEST = "BROWSER" ]; then yarn test --config-file testem.browserstack.js; fi
5151
# run api tests with composer
52-
- if $TEST_API; then cd api/ && ./vendor/bin/codecept run && cd ..; fi
52+
- if [ $TEST = "API" ]; then cd api/ && ./vendor/bin/codecept run && cd ..; fi
5353

5454
after_script:
5555
# destroy the sauce tunnel
56-
- if $TEST_SAUCE; then node_modules/ember-cli/bin/ember sauce:disconnect; fi
56+
- if [ $TEST = "BROWSER" ]; then node_modules/ember-cli/bin/ember browserstack:disconnect; fi

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
[![Code Climate](https://codeclimate.com/github/jelhan/croodle/badges/gpa.svg)](https://codeclimate.com/github/jelhan/croodle)
55
[![devDependency Status](https://david-dm.org/jelhan/croodle/dev-status.svg)](https://david-dm.org/jelhan/croodle?type=dev)
66

7-
[![Sauce Test Status](https://saucelabs.com/browser-matrix/jelhan.svg)](https://saucelabs.com/u/jelhan)
8-
97
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.
108

119
This is an alpha version. Changes could brake backward compatibility. Also it is not well tested and some features are missing. It is not ment for productive use yet.
@@ -96,6 +94,14 @@ directory to `/api` and execute `./vendor/bin/codecept run`. You have
9694
to install composer development requirements before (`composer install`
9795
without `--no-dev` option).
9896

97+
## Credits
98+
99+
Continous Integration powered by<br>
100+
<a href="https://travis-ci.com/"><img src="https://travis-ci.com/images/logos/TravisCI-Full-Color.png" height="50"></a>
101+
102+
Cross-browser testing provided by<br>
103+
<a href="https://www.browserstack.com"><img src="docs/Browserstack-logo.svg" height="50"></a>
104+
99105
## License
100106

101107
croodle is [MIT Licensed](https://github.com/jelhan/croodle/blob/master/LICENSE).

docs/Browserstack-logo.svg

+90
Loading

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"ember-cli-app-version": "^3.2.0",
3030
"ember-cli-babel": "^6.16.0",
3131
"ember-cli-browser-navigation-button-test-helper": "^0.1.1",
32+
"ember-cli-browserstack": "^0.0.7",
3233
"ember-cli-chart": "^3.3.1",
3334
"ember-cli-clipboard": "^0.8.0",
3435
"ember-cli-content-security-policy": "^1.0.0",
@@ -44,7 +45,6 @@
4445
"ember-cli-page-object": "^1.11.0",
4546
"ember-cli-release": "^0.2.9",
4647
"ember-cli-sass": "^8.0.1",
47-
"ember-cli-sauce": "^1.6.0",
4848
"ember-cli-sri": "^2.1.1",
4949
"ember-cli-template-lint": "^1.0.0-beta.1",
5050
"ember-cli-uglify": "^2.1.0",

testem.browserstack.js

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
/* eslint-env node */
2+
module.exports = {
3+
'test_page': 'tests/index.html?hidepassed',
4+
'disable_watching': true,
5+
'parallel': 5,
6+
browser_start_timeout: 2000,
7+
browser_disconnect_timeout: 120,
8+
'launch_in_ci': [
9+
'BS_IE_11',
10+
'BS_MS_Edge',
11+
'BS_Safari_Current',
12+
],
13+
14+
'launch_in_dev': [
15+
'Chrome'
16+
],
17+
18+
launchers: {
19+
BS_Chrome_Current: {
20+
exe: 'node_modules/.bin/browserstack-launch',
21+
args: [
22+
'--os',
23+
'Windows',
24+
'--osv',
25+
'10',
26+
'--b',
27+
'chrome',
28+
'--bv',
29+
'latest',
30+
'-t',
31+
'1200',
32+
'--u',
33+
'<url>',
34+
],
35+
protocol: 'browser',
36+
},
37+
BS_Firefox_Current: {
38+
exe: 'node_modules/.bin/browserstack-launch',
39+
args: [
40+
'--os',
41+
'Windows',
42+
'--osv',
43+
'10',
44+
'--b',
45+
'firefox',
46+
'--bv',
47+
'latest',
48+
'-t',
49+
'1200',
50+
'--u',
51+
'<url>',
52+
],
53+
protocol: 'browser',
54+
},
55+
BS_Safari_Current: {
56+
exe: 'node_modules/.bin/browserstack-launch',
57+
args: [
58+
'--os',
59+
'OS X',
60+
'--osv',
61+
'Mojave',
62+
'--b',
63+
'safari',
64+
'--bv',
65+
'latest',
66+
'-t',
67+
'1200',
68+
'--u',
69+
'<url>',
70+
],
71+
protocol: 'browser',
72+
},
73+
BS_Safari_Last: {
74+
exe: 'node_modules/.bin/browserstack-launch',
75+
args: [
76+
'--os',
77+
'OS X',
78+
'--osv',
79+
'High Sierra',
80+
'--b',
81+
'safari',
82+
'--bv',
83+
'latest',
84+
'-t',
85+
'1200',
86+
'--u',
87+
'<url>',
88+
],
89+
protocol: 'browser',
90+
},
91+
BS_MS_Edge: {
92+
exe: 'node_modules/.bin/browserstack-launch',
93+
args: [
94+
'--os',
95+
'Windows',
96+
'--osv',
97+
'10',
98+
'--b',
99+
'edge',
100+
'--bv',
101+
'latest',
102+
'-t',
103+
'1200',
104+
'--u',
105+
'<url>',
106+
],
107+
protocol: 'browser',
108+
},
109+
BS_IE_11: {
110+
exe: 'node_modules/.bin/browserstack-launch',
111+
args: [
112+
'--os',
113+
'Windows',
114+
'--osv',
115+
'10',
116+
'--b',
117+
'ie',
118+
'--bv',
119+
'11.0',
120+
'-t',
121+
'1500',
122+
'--u',
123+
'<url>&legacy=true',
124+
],
125+
protocol: 'browser',
126+
},
127+
}
128+
};

tests/acceptance/create-a-poll-test.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,8 @@ module('Acceptance | create a poll', function(hooks) {
593593

594594
test('create a poll and using back button (find a date)', async function(assert) {
595595
let days = [
596-
'2016-01-02',
597-
'2016-01-13',
596+
moment('2016-01-02'),
597+
moment('2016-01-13'),
598598
];
599599
const dayFormat = moment.localeData().longDateFormat('LLLL')
600600
.replace(
@@ -614,13 +614,13 @@ module('Acceptance | create a poll', function(hooks) {
614614
assert.equal(currentRouteName(), 'create.options');
615615

616616
await pageCreateOptions.selectDates(
617-
days.map((day) => new Date(day))
617+
days.map((_) => _.toDate())
618618
);
619619
await pageCreateOptions.next();
620620
assert.equal(currentRouteName(), 'create.options-datetime');
621621
assert.deepEqual(
622622
pageCreateOptionsDatetime.days().labels,
623-
days.map((day) => moment(day).format(dayFormat)),
623+
days.map((_) => _.format(dayFormat)),
624624
'time inputs having days as label'
625625
);
626626

@@ -629,7 +629,7 @@ module('Acceptance | create a poll', function(hooks) {
629629
assert.equal(currentRouteName(), 'create.options');
630630
assert.deepEqual(
631631
findAll('.ember-power-calendar-day--selected').map((el) => el.dataset.date),
632-
days,
632+
days.map((_) => _.format('YYYY-MM-DD')),
633633
'days are still present after back button is used'
634634
);
635635

@@ -658,8 +658,8 @@ module('Acceptance | create a poll', function(hooks) {
658658
assert.deepEqual(
659659
pagePollParticipation.options().labels,
660660
[
661-
moment(days[0]).format(dayFormat),
662-
moment(days[1]).hour(10).minute(0).format('LLLL')
661+
days[0].format(dayFormat),
662+
days[1].clone().hour(10).minute(0).format('LLLL')
663663
],
664664
'options are correctly labeled'
665665
);

0 commit comments

Comments
 (0)