Write more data to the extra json file. (#3307)

This commit is contained in:
Peter Hedenskog 2021-03-11 12:32:56 +01:00 committed by GitHub
parent 87bd01de15
commit 28d409393a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 6 deletions

View File

@ -60,14 +60,14 @@ module.exports = {
'/' +
name +
'.' +
this.options.browser +
options.browser +
'.' +
connectivity +
'.' +
this.screenshotType
);
}
if (this.options.browsertime && this.options.browsertime.video) {
if (options.browsertime && options.browsertime.video) {
const videoFullPath = path.join(baseDir, message.data.video);
await this.storageManager.copyFileToDir(
@ -76,28 +76,38 @@ module.exports = {
'/' +
name +
'.' +
this.options.browser +
options.browser +
'.' +
connectivity +
'.mp4'
);
}
// Also store a JSON with data that we can use later
const json = {
url: message.url,
alias: this.alias[message.url],
timestamp: message.data.timestamp
timestamp: message.data.timestamp,
iterations: options.browsertime.iterations
};
if (message.data.title) {
json.title = message.data.title;
}
if (message.data.description) {
json.description = message.data.description;
}
if (message.data.android) {
json.android = {};
json.android.model = message.data.android.model;
json.android.androidVersion = message.data.android.androidVersion;
}
const data = JSON.stringify(json, null, 0);
return this.storageManager.writeDataToDir(
data,
name + '.' + this.options.browser + '.' + connectivity + '.json',
name + '.' + options.browser + '.' + connectivity + '.json',
newPath
);
}