No more javascriptExecutionTree bu default (option)

This commit is contained in:
Gaël Métais
2015-02-09 19:03:04 +01:00
parent ee490fc660
commit 42c27af604
2 changed files with 18 additions and 3 deletions
+13 -2
View File
@@ -32,7 +32,8 @@ var ApiController = function(app) {
url: req.body.url,
waitForResponse: req.body.waitForResponse !== false && req.body.waitForResponse !== 'false' && req.body.waitForResponse !== 0,
partialResult: req.body.partialResult || null,
screenshot: req.body.screenshot || false
screenshot: req.body.screenshot || false,
jsTimeline: req.body.jsTimeline || false
}
};
@@ -64,7 +65,8 @@ var ApiController = function(app) {
debug('Launching test %s on %s', run.runId, run.params.url);
var runOptions = {
screenshot: run.params.screenshot ? screenshot.getTmpFilePath() : false
screenshot: run.params.screenshot ? screenshot.getTmpFilePath() : false,
jsDeepAnalysis: run.params.jsTimeline
};
return ylt(run.params.url, runOptions);
@@ -107,7 +109,16 @@ var ApiController = function(app) {
// Save results
.then(function() {
// Remove uneeded temp screenshot path
delete data.params.options.screenshot;
// Empty javascriptExecutionTree if not needed
if (!run.params.jsTimeline) {
data.javascriptExecutionTree = {};
}
// Remove tools results if not needed
return resultsDatastore.saveResult(data);
})
+5 -1
View File
@@ -159,7 +159,10 @@ describe('api', function() {
body.should.have.a.property('scoreProfiles').that.is.an('object');
body.should.have.a.property('rules').that.is.an('object');
body.should.have.a.property('toolsResults').that.is.an('object');
// javascriptExecutionTree should only be filled if option jsTimeline is true
body.should.have.a.property('javascriptExecutionTree').that.is.an('object');
body.javascriptExecutionTree.should.deep.equal({});
// Check if the screenshot temporary file was correctly removed
body.params.options.should.not.have.a.property('screenshot');
@@ -188,7 +191,8 @@ describe('api', function() {
url: serverUrl + '/api/runs',
body: {
url: wwwUrl + '/simple-page.html',
waitForResponse: false
waitForResponse: false,
jsTimeline: true
},
json: true,
headers: {