updated browser configs so opening browsers on all platforms should be a bit better supported, added a ping that notifies the server when the tests started, fixed a 'globalLeak', removed the test-output from the repo
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ node_modules
|
||||
scripts/scratch*
|
||||
test/integration/yaml_suite/log
|
||||
test/integration/yaml_suite/tests
|
||||
test/browser_integration/test-output.xml
|
||||
|
||||
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -1,6 +0,0 @@
|
||||
[submodule "spec/es_api"]
|
||||
path = spec/es_api
|
||||
url = git@github.com:elasticsearch/elasticsearch-rest-api-spec.git
|
||||
[submodule "es_api_spec"]
|
||||
path = es_api_spec
|
||||
url = git@github.com:elasticsearch/elasticsearch-rest-api-spec.git
|
||||
29
Gruntfile.js
29
Gruntfile.js
@ -207,15 +207,36 @@ module.exports = function (grunt) {
|
||||
});
|
||||
|
||||
var browsers = {
|
||||
safari: 'Safari',
|
||||
chrome: 'Google Chrome',
|
||||
firefox: 'firefox'
|
||||
safari: {
|
||||
appName: 'Safari',
|
||||
executable: null
|
||||
},
|
||||
chrome: {
|
||||
appName: 'Google Chrome',
|
||||
executable: 'google-chrome'
|
||||
},
|
||||
chromium: {
|
||||
appName: null,
|
||||
executable: 'chromium-browser'
|
||||
},
|
||||
firefox: {
|
||||
appName: 'Firefox',
|
||||
executable: 'firefox'
|
||||
},
|
||||
opera: {
|
||||
appName: 'Firefox',
|
||||
executable: 'firefox'
|
||||
}
|
||||
};
|
||||
|
||||
// creates browser_tests:{{browser}} tasks, for the browsers listed directly above
|
||||
Object.keys(browsers).forEach(function (browser) {
|
||||
grunt.config.set('open_browser_tests.' + browser, {
|
||||
appName: browsers[browser]
|
||||
// on other platforms, grunt-open expects appname to be the name of the executale...
|
||||
appName: browsers[browser][process.platform === 'darwin' || process.platform === 'win32'
|
||||
? 'appName'
|
||||
: 'executale'
|
||||
]
|
||||
});
|
||||
grunt.registerTask('browser_tests:' + browser, [
|
||||
'generate',
|
||||
|
||||
@ -43,6 +43,7 @@
|
||||
|
||||
runner.on('suite', function (suite) {
|
||||
if (suite.root) {
|
||||
$.post('/tests-started');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -134,7 +135,7 @@
|
||||
});
|
||||
|
||||
function allTestsDone() {
|
||||
window.testResults = {
|
||||
var testResults = {
|
||||
stats: stats,
|
||||
suites: $.map(rootSuite.suites, function removeElements(suite) {
|
||||
var s = {
|
||||
@ -152,7 +153,8 @@
|
||||
return s;
|
||||
})
|
||||
};
|
||||
$.post('/tests-complete', JSON.stringify(window.testResults), function () {
|
||||
|
||||
$.post('/tests-complete', JSON.stringify(testResults), function () {
|
||||
// alert('test complete');
|
||||
window.close();
|
||||
});
|
||||
|
||||
@ -138,8 +138,8 @@ function collectTestResults(req, resp) {
|
||||
_.each(suiteInfo.suites, serializeSuite);
|
||||
}
|
||||
|
||||
suite.ele('system-out', {}, suiteInfo.stdout);
|
||||
suite.ele('system-err', {}, suiteInfo.stderr);
|
||||
suite.ele('system-out', {}).cdata(suiteInfo.stdout);
|
||||
suite.ele('system-err', {}).cdata(suiteInfo.stderr);
|
||||
});
|
||||
|
||||
var filename = path.join(__dirname, 'test-output.xml');
|
||||
@ -185,6 +185,9 @@ var server = http.createServer(function (req, resp) {
|
||||
middleware.push(function (req, resp, next) {
|
||||
// resolve filenames
|
||||
switch (req.uri) {
|
||||
case '/tests-started':
|
||||
resp.end('OK');
|
||||
return;
|
||||
case '/tests-complete':
|
||||
return collectTestResults(req, resp);
|
||||
case '/expect.js':
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user