Skip to content

Commit 4d4d754

Browse files
authored
Merge pull request #71 from canjs/saucelabs
Set up Sauce Labs
2 parents 2775682 + 30d67be commit 4d4d754

File tree

7 files changed

+106
-7
lines changed

7 files changed

+106
-7
lines changed

.editorconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33
end_of_line = LF
44
indent_style = tab
55
trim_trailing_whitespace = false
6-
insert_final_newline = true
6+
insert_final_newline = true
7+
8+
[{package.json,*.yml,*.md}]
9+
indent_style = space
10+
indent_size = 2

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
language: node_js
22
node_js: node
33
addons:
4-
firefox: '53.0'
4+
firefox: "53.0"
5+
sauce_connect: true
56
dist: xenial
67
services:
78
- xvfb
9+
before_script:
10+
- npm run http-server &
11+
- sleep 2
12+
script: npm run ci

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
},
1515
"license": "MIT",
1616
"scripts": {
17+
"ci": "npm run test && node test/test-saucelabs.js",
18+
"http-server": "http-server -p 3000 --silent",
1719
"preversion": "npm test && npm run build",
1820
"version": "git commit -am \"Update version number\" && git checkout -b release && git add -f dist/",
1921
"postpublish": "git push --tags && git checkout - && git branch -D release && git push",
20-
"testee": "testee test.html --browsers firefox",
22+
"testee": "testee test/test.html --browsers firefox",
2123
"test": "npm run detect-cycle && npm run jshint && npm run testee",
2224
"jshint": "jshint ./*.js --config",
2325
"release:patch": "npm version patch && npm publish",
@@ -51,10 +53,12 @@
5153
"devDependencies": {
5254
"can-make-map": "^1.0.0",
5355
"detect-cyclic-packages": "^1.1.0",
56+
"http-server": "^0.11.1",
5457
"jshint": "^2.9.1",
5558
"steal": "^1.11.8",
5659
"steal-qunit": "^2.0.0",
5760
"steal-tools": "^1.11.9",
61+
"test-saucelabs": "0.0.6",
5862
"testee": "^0.9.0"
5963
}
6064
}

test.html

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/test-ie.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>can-ajax</title>
6+
</head>
7+
<body>
8+
<div id="qunit-fixture"></div>
9+
<script
10+
src="../node_modules/steal/steal.js"
11+
main="can-ajax/can-ajax-test"
12+
></script>
13+
</body>
14+
</html>

test/test-saucelabs.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
"use strict";
2+
3+
var SauceLabs = require("test-saucelabs");
4+
5+
var maxDuration = 10800; // seconds, default 1800, max 10800
6+
var commandTimeout = 600; // seconds, default 300, max 600
7+
var idleTimeout = 1000; // seconds, default 90, max 1000
8+
9+
// https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities
10+
var platforms = [
11+
{
12+
browserName: "safari",
13+
platform: "OS X 10.13",
14+
version: "11"
15+
},
16+
{
17+
browserName: "MicrosoftEdge",
18+
platform: "Windows 10"
19+
},
20+
{
21+
browserName: "firefox",
22+
platform: "Windows 10",
23+
version: "latest"
24+
},
25+
{
26+
browserName: "googlechrome",
27+
platform: "Windows 10"
28+
},
29+
{
30+
browserName: "Safari",
31+
"appium-version": "1.12.1",
32+
platformName: "iOS",
33+
platformVersion: "12.2",
34+
deviceName: "iPhone XS Simulator"
35+
}
36+
];
37+
38+
SauceLabs({
39+
urls: [
40+
{
41+
name: "can-ajax",
42+
url: "http://localhost:3000/test/test-ie.html?hidepassed",
43+
platforms: [
44+
{
45+
browserName: "internet explorer",
46+
platform: "Windows 10",
47+
version: "11.0",
48+
maxDuration: maxDuration,
49+
commandTimeout: commandTimeout,
50+
idleTimeout: idleTimeout
51+
}
52+
]
53+
},
54+
{
55+
name: "can-ajax",
56+
url: "http://localhost:3000/test/test.html?hidepassed",
57+
platforms: platforms
58+
}
59+
],
60+
runInSeries: true,
61+
zeroAssertionsPass: false
62+
});

test/test.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>can-ajax</title>
6+
</head>
7+
<body>
8+
<div id="qunit-fixture"></div>
9+
<script
10+
src="../node_modules/steal/steal-sans-promises.js"
11+
main="can-ajax/can-ajax-test"
12+
></script>
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)