Skip to content

Commit 07a53a8

Browse files
committed
Merge branch 'develop' into testing
2 parents 5a382fd + 959949b commit 07a53a8

File tree

10 files changed

+537
-350
lines changed

10 files changed

+537
-350
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ cache:
77
directories:
88
- node_modules
99

10-
before_install: if [ "$TRAVIS_BRANCH" != "testing" ]; then unset SAUCE_USERNAME && unset SAUCE_ACCESS_KEY; fi
10+
before_install: if [ "$TRAVIS_BRANCH" != $SAUCE_BRANCH ]; then unset SAUCE_USERNAME && unset SAUCE_ACCESS_KEY; fi
1111
before_script: npm install -g grunt-cli
1212
after_success: "./travis-nightly.sh"
1313
after_failure: if [ "$GH_TOKEN" ]; then grunt gh-pages:crafty-distro-regression-tests; fi
1414

1515
env:
1616
global:
17+
- SAUCE_BRANCH=testing
1718
# GitHub token
1819
- secure: p6SeAGd+Gohr6XeDkb5JPSQBu88UxAjljSMK0BNLJQgr8GkoA3mSJWy4uX0YjNq93VX4UMFxr0D4MlkcWZpX+cdN8K9PpxOgTq8Ml1Ljs355zbX9U/CdY99okiwzHktY4qKXBPsHLiEuCBeJ6pxs/v7m9z88mkjwDSunJG7F1oo=
1920
# OpenSauce credentials: for pre-relase testing
2021
- secure: NO+7PK5P0XLGbnvdSDBlrlnzqM/hMTy3wxxAp8ZtzEuS2ZOXn8q0KjOO/cAs1NorG1SOl8+XfFZBTR5W504GrHYLP8fNkLJOAyKMfFeTojwQ+385ShVr/NejZFejsc+xJZymIeDsEzBZqosxPOi+8k7jljDK4mzLdKMpt8flWUw=
2122
- secure: iGO+VCkCq/26Dqrc6+G1nX8Dk+tTqhcINuiIVhxGtMARcY+WIzcyEK/cfXRaLnvIzIxQ0xUoGGnM9xe4DQT8L+BGzo8AGnVbzxITzceWTlhsFepcbOTgqOg0ZGMxQVQ6VBh888Cdks8KsOgtTNhzd+oVgcStsyxZPCVD/7VgNTE=
2223

2324
addons:
24-
sauce_connect: true
25+
sauce_connect:
26+
no_ssl_bump_domains: all

Gruntfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ module.exports = function (grunt) {
278278
grunt.registerTask('test-cloud-webdriver', ['webdriver:cloud']);
279279
grunt.registerTask('test-cloud', function() {
280280
// execute cloud tests only in travis, while on testing branch, with open sauce lab credentials
281-
if (process.env.TRAVIS && process.env.TRAVIS_BRANCH === "testing" &&
281+
var branch = process.env.TRAVIS_BRANCH;
282+
if (process.env.TRAVIS && branch === process.env.SAUCE_BRANCH &&
282283
process.env.SAUCE_USERNAME && process.env.SAUCE_ACCESS_KEY)
283284
grunt.task.run('connect', 'test-cloud-browser', 'test-cloud-webdriver');
284285
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"node-jsx": "^0.13.3",
5555
"node-resemble-js": "^0.1.1",
5656
"open": "^0.0.5",
57-
"phantomjs-prebuilt": "2.1.13",
57+
"phantomjs-prebuilt": "2.1.14",
5858
"q": "^1.4.1",
5959
"q-io": "^1.13.1",
6060
"qunitjs": "^2.0.1",

supported-browsers-webdriver.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[
2+
{
3+
"browserName": "internet explorer",
4+
"version": "9.0",
5+
"platform": "Windows 7"
6+
},
7+
{
8+
"browserName": "MicrosoftEdge",
9+
"version": "latest",
10+
"platform": "Windows 10"
11+
},
12+
{
13+
"browserName": "chrome",
14+
"version": "26.0",
15+
"platform": "Windows XP"
16+
},
17+
{
18+
"browserName": "chrome",
19+
"version": "beta",
20+
"platform": "Windows 10"
21+
},
22+
{
23+
"browserName": "safari",
24+
"version": "6.0",
25+
"platform": "OS X 10.8"
26+
},
27+
{
28+
"browserName": "safari",
29+
"version": "latest",
30+
"platform": "OS X 10.11"
31+
},
32+
{
33+
"browserName": "firefox",
34+
"version": "latest",
35+
"platform": "Linux"
36+
}
37+
]

supported-browsers.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
},
6161
{
6262
"browserName": "iphone",
63-
"version": "8.1",
63+
"version": "9.1",
6464
"deviceName": "iPhone Simulator",
6565
"platform": "OS X 10.10",
6666
"deviceOrientation": "landscape"

tests/index-headless.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** CRAFTY-JS **/
2-
GLOBAL.Crafty = require('../src/crafty-headless.js')();
2+
global.Crafty = require('../src/crafty-headless.js')();
33
Crafty.init();
44

55
/** COMMON TEST CODE **/

tests/time.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@
139139

140140
test("curTime", 1, function() {
141141
var startTime, lastKnownTime;
142+
142143
var framesTriggered = 0;
144+
143145
Crafty.e("").bind("EnterFrame", function(params) {
144146
framesTriggered++;
145147
if (!startTime) {
@@ -148,7 +150,6 @@
148150
lastKnownTime = params.gameTime;
149151
}
150152
});
151-
152153
setTimeout(function() {
153154
var endTime = lastKnownTime;
154155

tests/webdriver/index-webdriver-cloud.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exports.config = {
2121
'public': 'public'
2222
};
2323

24-
var browsers = require('../../supported-browsers.json');
24+
var browsers = require('../../supported-browsers-webdriver.json');
2525
browsers.forEach(function(capabilities) {
2626
for (var k in baseCapabilities)
2727
capabilities[k] = baseCapabilities[k];
@@ -30,7 +30,6 @@ exports.config = {
3030
capabilities.browserName, capabilities.version, capabilities.platform
3131
);
3232
});
33-
3433
return browsers;
3534
})(),
3635
updateJob: true,
@@ -43,5 +42,5 @@ exports.config = {
4342
onPrepare: require('./index-webdriver.js').onPrepare,
4443
before: require('./index-webdriver.js').before,
4544
after: require('./index-webdriver.js').after,
46-
onComplete: require('./index-webdriver.js').onComplete
45+
onComplete: require('./index-webdriver.js').onComplete,
4746
};

tests/webdriver/index-webdriver.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ var fs = require('fs'),
99

1010
// ADD ALL TESTS & RUN CONDITIONS HERE
1111
var tests = {
12-
'template-generic': true,
13-
'template-local': true,
14-
'template-crafty': true,
15-
'template-multi': true,
12+
// Problems with input capture in firefox driver
13+
'template-multi': function(browserName) { return browserName !== "firefox"; },
1614
'color/color-dom': true,
1715
'color/color-canvas': true,
18-
'color/color-webgl': function(browserName) { return browserName !== 'phantomjs'; }
16+
// neither phantomjs nor open sauce support webgl right now
17+
'color/color-webgl': function(browserName) { return false; }
1918
};
19+
2020
exports.specs = function() {
2121
return Object.keys(tests).map(function(t) {
2222
return 'tests/webdriver/' + t + '.js';
@@ -27,7 +27,7 @@ exports.exclude = function(browserName, version, platform) {
2727
runCondition;
2828
for (var test in tests) {
2929
runCondition = tests[test];
30-
if (runCondition !== true && !runCondition(browserName, version, platform))
30+
if (runCondition !== true && (runCondition === false || !runCondition(browserName, version, platform)))
3131
excluded.push('tests/webdriver/' + test + '.js');
3232
}
3333
return excluded;
@@ -43,13 +43,13 @@ function getRunId(capabilities) {
4343
// =====
4444
exports.onPrepare = function() {};
4545
exports.before = function() { // BEFORE RUNNING ANY TESTS, WITH GLOBALS AVAILABLE
46-
var capabilities = GLOBAL.browser.desiredCapabilities;
46+
var capabilities = global.browser.desiredCapabilities;
4747

4848
//TODO retry commands with webbriverio/lib/helpers.js/staleElementRetry if need arises (StaleElementReference)
49-
addGenericCommands(GLOBAL.browser);
50-
addBrowserSpecificCommands(GLOBAL.browser, capabilities);
51-
addTestSpecificCommands(GLOBAL.browser, GLOBAL.QUnit, getRunId(capabilities));
52-
return setBrowserSpecificConfig(GLOBAL.browser, capabilities);
49+
addGenericCommands(global.browser);
50+
addBrowserSpecificCommands(global.browser, capabilities);
51+
addTestSpecificCommands(global.browser, global.QUnit, getRunId(capabilities));
52+
return setBrowserSpecificConfig(global.browser, capabilities);
5353
};
5454
exports.after = function(failures, pid) {};
5555
exports.onComplete = function() {};
@@ -147,6 +147,9 @@ function addGenericCommands(client) {
147147

148148
// NON-STANDARD SCREENSHOT REGIONS PER PLATFORM
149149
var rotatedCrops = {};
150+
151+
// These platforms are no longer used, and the updated versions require different regions
152+
// TODO: update them and add the new platforms back to supported-platforms-webdriver
150153
rotatedCrops[getRunId({"browserName": "android", "version": "4.1", "platform": "Linux"})] = { x: 0, y: 98, w: 261, h: 196, stretchW: 320, stretchH: 240 };
151154
rotatedCrops[getRunId({"browserName": "android", "version": "5.1", "platform": "Linux"})] = { x: 0, y: 110, w: 261, h: 196, stretchW: 320, stretchH: 240 };
152155
// TODO: iphone 8.4 emulator currently changing screenshot region constantly, readd to supported-browsers and observe region in future
@@ -308,11 +311,14 @@ function addTestSpecificCommands(client, QUnit, runId) {
308311

309312
// WEBDRIVER COMMAND: TEST PAGE URL SHORTCUT
310313
client.addCommand("testUrl", function(testName, testScript) {
314+
311315
if (typeof testName === 'string' && typeof testScript === 'undefined') {
312316
testScript = testName;
313317
testName = undefined;
314318
}
315319

320+
console.log("\n# Starting " + (testName || currentTestName) + " test for " + runId);
321+
316322
if (typeof testScript === 'string') {
317323
var testFilePath = resultPath + (testName || currentTestName) + '.html',
318324
testFile = "<!DOCTYPE html>" + EOL +
@@ -330,10 +336,9 @@ function addTestSpecificCommands(client, QUnit, runId) {
330336
"</script>" + EOL +
331337
"</body>" + EOL +
332338
"</html>" + EOL;
333-
334-
return qfs.write(testFilePath, testFile, 'w+')
335-
.then(this.url.bind(this, testFilePath));
336-
} else {
339+
return qfs.write("./" + testFilePath, testFile, 'w+')
340+
.then(this.url.bind(this, "/" + testFilePath));
341+
} else {
337342
return this.url(testPath + currentTestPath + '.html');
338343
}
339344
});

0 commit comments

Comments
 (0)