browsertime 17.0.0-beta.4 → 17.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/CHANGELOG.md +30 -13
  2. package/bin/browsertime.js +4 -4
  3. package/bin/browsertimeWebPageReplay.js +2 -2
  4. package/browsertime/visualmetrics-portable.py +54 -50
  5. package/index.js +2 -2
  6. package/lib/android/gnirehtet.js +1 -2
  7. package/lib/android/root.js +57 -16
  8. package/lib/chrome/chromeDevtoolsProtocol.js +6 -3
  9. package/lib/chrome/har.js +1 -1
  10. package/lib/chrome/longTaskMetrics.js +1 -1
  11. package/lib/chrome/parseCpuTrace.js +2 -2
  12. package/lib/chrome/settings/chromeAndroidOptions.js +1 -1
  13. package/lib/chrome/settings/chromeDesktopOptions.js +1 -1
  14. package/lib/chrome/settings/traceCategories.js +1 -1
  15. package/lib/chrome/traceCategoriesParser.js +3 -3
  16. package/lib/chrome/webdriver/builder.js +1 -1
  17. package/lib/chrome/webdriver/chromium.js +13 -17
  18. package/lib/chrome/webdriver/setupChromiumOptions.js +18 -13
  19. package/lib/connectivity/humble.js +10 -12
  20. package/lib/connectivity/index.js +1 -1
  21. package/lib/core/engine/collector.js +2 -4
  22. package/lib/core/engine/command/addText.js +1 -2
  23. package/lib/core/engine/command/android.js +1 -1
  24. package/lib/core/engine/command/cache.js +1 -2
  25. package/lib/core/engine/command/chromeDevToolsProtocol.js +9 -2
  26. package/lib/core/engine/command/click.js +1 -2
  27. package/lib/core/engine/command/debug.js +1 -3
  28. package/lib/core/engine/command/javaScript.js +1 -2
  29. package/lib/core/engine/command/measure.js +13 -15
  30. package/lib/core/engine/command/meta.js +1 -1
  31. package/lib/core/engine/command/navigation.js +1 -1
  32. package/lib/core/engine/command/screenshot.js +1 -1
  33. package/lib/core/engine/command/scroll.js +1 -1
  34. package/lib/core/engine/command/select.js +1 -1
  35. package/lib/core/engine/command/set.js +1 -1
  36. package/lib/core/engine/command/stopWatch.js +1 -1
  37. package/lib/core/engine/command/switch.js +44 -1
  38. package/lib/core/engine/command/util/lcpHighlightScript.js +1 -1
  39. package/lib/core/engine/command/util/lsHighlightScript.js +1 -1
  40. package/lib/core/engine/command/wait.js +1 -1
  41. package/lib/core/engine/index.js +12 -12
  42. package/lib/core/engine/iteration.js +27 -27
  43. package/lib/core/engine/run.js +1 -1
  44. package/lib/core/pageCompleteChecks/defaultPageCompleteCheck.js +1 -1
  45. package/lib/core/pageCompleteChecks/pageCompleteCheckByInactivity.js +1 -1
  46. package/lib/core/pageCompleteChecks/spaInactivity.js +1 -1
  47. package/lib/core/seleniumRunner.js +9 -11
  48. package/lib/edge/webdriver/builder.js +1 -1
  49. package/lib/extensionserver/index.js +2 -4
  50. package/lib/extensionserver/setup.js +1 -1
  51. package/lib/firefox/geckoProfiler.js +46 -16
  52. package/lib/firefox/getHAR.js +1 -1
  53. package/lib/firefox/memoryReport.js +1 -1
  54. package/lib/firefox/settings/disableSafeBrowsingPreferences.js +1 -1
  55. package/lib/firefox/settings/disableTrackingProtectionPreferences.js +1 -1
  56. package/lib/firefox/settings/firefoxPreferences.js +1 -1
  57. package/lib/firefox/webdriver/builder.js +9 -9
  58. package/lib/firefox/webdriver/firefox.js +24 -6
  59. package/lib/safari/webdriver/safari.js +1 -1
  60. package/lib/screenshot/defaults.js +1 -1
  61. package/lib/screenshot/index.js +3 -5
  62. package/lib/support/cli.js +5 -5
  63. package/lib/support/dns.js +6 -1
  64. package/lib/support/engineUtils.js +5 -13
  65. package/lib/support/getViewPort.js +1 -1
  66. package/lib/support/har/index.js +6 -8
  67. package/lib/support/images/index.js +1 -1
  68. package/lib/support/logging.js +1 -1
  69. package/lib/support/pathToFolder.js +4 -4
  70. package/lib/support/preURL.js +1 -1
  71. package/lib/support/processes.js +1 -1
  72. package/lib/support/setResourceTimingBufferSize.js +1 -1
  73. package/lib/support/stop.js +1 -1
  74. package/lib/support/storageManager.js +1 -3
  75. package/lib/support/tcpdump.js +2 -2
  76. package/lib/support/xvfb.js +2 -4
  77. package/lib/video/postprocessing/finetune/addTextToVideo.js +3 -3
  78. package/lib/video/postprocessing/finetune/convertFps.js +1 -1
  79. package/lib/video/postprocessing/finetune/getFont.js +1 -1
  80. package/lib/video/postprocessing/finetune/getTimingMetrics.js +2 -2
  81. package/lib/video/postprocessing/finetune/index.js +4 -4
  82. package/lib/video/postprocessing/finetune/removeOrange.js +1 -1
  83. package/lib/video/postprocessing/visualmetrics/extraMetrics.js +1 -1
  84. package/lib/video/postprocessing/visualmetrics/getVideoMetrics.js +2 -2
  85. package/lib/video/screenRecording/android/recorder.js +1 -1
  86. package/lib/video/screenRecording/desktop/convert.js +1 -1
  87. package/lib/video/screenRecording/desktop/desktopRecorder.js +3 -3
  88. package/lib/video/screenRecording/desktop/ffmpegRecorder.js +6 -6
  89. package/lib/video/screenRecording/desktop/osx/getSPDisplaysDataType.js +1 -1
  90. package/lib/video/screenRecording/desktop/osx/getScreen.js +1 -1
  91. package/lib/video/screenRecording/firefox/firefoxWindowRecorder.js +1 -1
  92. package/lib/video/screenRecording/ios/convertToMp4.js +1 -1
  93. package/lib/video/screenRecording/ios/iosRecorder.js +2 -2
  94. package/lib/video/screenRecording/iosSimulator/convertToMp4.js +1 -1
  95. package/lib/video/screenRecording/iosSimulator/recorder.js +2 -2
  96. package/lib/video/screenRecording/recorder.js +6 -6
  97. package/lib/video/screenRecording/setOrangeBackground.js +1 -1
  98. package/lib/video/video.js +9 -11
  99. package/package.json +18 -18
@@ -1,7 +1,7 @@
1
1
  import intel from 'intel';
2
2
  const { INFO, DEBUG, VERBOSE, TRACE, NONE, basicConfig } = intel;
3
3
 
4
- export default function configure(options) {
4
+ export function configure(options) {
5
5
  options = options || {};
6
6
 
7
7
  let level = INFO;
@@ -9,7 +9,7 @@ function toSafeKey(key) {
9
9
  return key.replace(/[ %&()+,./:?|~–]|%7C/g, '-');
10
10
  }
11
11
 
12
- export default function (url, options) {
12
+ export function pathToFolder(url, options) {
13
13
  if (options.useSameDir) {
14
14
  return '';
15
15
  } else {
@@ -40,9 +40,7 @@ export default function (url, options) {
40
40
  }
41
41
 
42
42
  // This is used from sitespeed.io to match URLs on Graphite
43
- if (!options.storeURLsAsFlatPageOnDisk) {
44
- pathSegments.push(...urlSegments);
45
- } else {
43
+ if (options.storeURLsAsFlatPageOnDisk) {
46
44
  const folder = toSafeKey(urlSegments.join('_').concat('_'));
47
45
  if (folder.length > 255) {
48
46
  log.info(
@@ -52,6 +50,8 @@ export default function (url, options) {
52
50
  } else {
53
51
  pathSegments.push(folder);
54
52
  }
53
+ } else {
54
+ pathSegments.push(...urlSegments);
55
55
  }
56
56
  }
57
57
 
@@ -2,7 +2,7 @@ import intel from 'intel';
2
2
  const log = intel.getLogger('browsertime');
3
3
  const delay = ms => new Promise(res => setTimeout(res, ms));
4
4
 
5
- export default async function (browser, options) {
5
+ export async function preURL(browser, options) {
6
6
  log.info('Accessing preURL %s', options.preURL);
7
7
  await browser.loadAndWait(options.preURL);
8
8
  if (!options.preURLDisableWhiteBackground) {
@@ -1,5 +1,5 @@
1
1
  import { execaCommand as command } from 'execa';
2
- export default async function () {
2
+ export async function getNumberOfRunningProcesses() {
3
3
  const { stdout } = await command('ps aux | wc -l', { shell: true });
4
4
  return stdout;
5
5
  }
@@ -1,4 +1,4 @@
1
- export default async function (startURL, driver, size) {
1
+ export async function setResourceTimingBufferSize(startURL, driver, size) {
2
2
  await driver.get(startURL);
3
3
  await driver.executeScript(
4
4
  `window.performance.setResourceTimingBufferSize(${size});`
@@ -2,7 +2,7 @@ import { execa } from 'execa';
2
2
  import intel from 'intel';
3
3
  const log = intel.getLogger('browsertime');
4
4
 
5
- export default async function (processName) {
5
+ export async function stop(processName) {
6
6
  const scriptArguments = ['-9', processName];
7
7
 
8
8
  log.debug('Kill all processes ' + processName);
@@ -49,7 +49,7 @@ async function streamToString(stream) {
49
49
  });
50
50
  }
51
51
 
52
- class StorageManager {
52
+ export class StorageManager {
53
53
  constructor(url, { resultDir, prettyPrint = false } = {}) {
54
54
  this.baseDir = resultDir
55
55
  ? _resolve(resultDir)
@@ -134,5 +134,3 @@ class StorageManager {
134
134
  return this.baseDir;
135
135
  }
136
136
  }
137
-
138
- export default StorageManager;
@@ -1,9 +1,9 @@
1
1
  import { join } from 'node:path';
2
2
  import { execa } from 'execa';
3
- import pathToFolder from './pathToFolder.js';
3
+ import { pathToFolder } from './pathToFolder.js';
4
4
  import { rename } from './fileUtil.js';
5
5
 
6
- export default class TCPDump {
6
+ export class TCPDump {
7
7
  constructor(directory, options) {
8
8
  this.baseDir = directory;
9
9
  this.options = options;
@@ -2,7 +2,7 @@ import { promisify } from 'node:util';
2
2
  import get from 'lodash.get';
3
3
  import Xvfb from '@cypress/xvfb';
4
4
  import { xvfbDisplay } from '../video/defaults.js';
5
- import getViewPort from '../support/getViewPort.js';
5
+ import { getViewPort } from '../support/getViewPort.js';
6
6
  import { isAndroidConfigured } from '../android/index.js';
7
7
 
8
8
  function buildXvfbArguments({ display, screen = 0, size, silent }) {
@@ -41,7 +41,7 @@ async function stopXvfb(xvfb) {
41
41
  * Create a new XVFB instance
42
42
  * @class
43
43
  */
44
- class XVFB {
44
+ export class XVFB {
45
45
  constructor(options) {
46
46
  this.options = options;
47
47
  }
@@ -67,5 +67,3 @@ class XVFB {
67
67
  }
68
68
  }
69
69
  }
70
-
71
- export default XVFB;
@@ -1,7 +1,7 @@
1
1
  import { execa } from 'execa';
2
2
  import intel from 'intel';
3
- import getTimingMetrics from './getTimingMetrics.js';
4
- import getFont from './getFont.js';
3
+ import { getTimingMetrics } from './getTimingMetrics.js';
4
+ import { getFont } from './getFont.js';
5
5
  import { isAndroidConfigured } from '../../../android/index.js';
6
6
  const log = intel.getLogger('browsertime.video');
7
7
 
@@ -14,7 +14,7 @@ function isSmallish(options) {
14
14
  );
15
15
  }
16
16
 
17
- export default async function (
17
+ export async function addTextToVideo(
18
18
  inputFile,
19
19
  outputFile,
20
20
  videoMetrics,
@@ -2,7 +2,7 @@ import { execa } from 'execa';
2
2
  import intel from 'intel';
3
3
  const log = intel.getLogger('browsertime.video');
4
4
 
5
- export default async function (source, destination, framerate) {
5
+ export async function convert(source, destination, framerate) {
6
6
  const scriptArguments = [
7
7
  '-nostdin',
8
8
  '-i',
@@ -1,5 +1,5 @@
1
1
  import { existsSync } from 'node:fs';
2
- export default function (options) {
2
+ export function getFont(options) {
3
3
  // If the font is not part of the params and we're on macOS
4
4
  // we check that SFNSMono.ttf is available
5
5
  if (!options.videoParams.fontPath && process.platform === 'darwin') {
@@ -1,5 +1,5 @@
1
1
  import { isAndroidConfigured } from '../../../android/index.js';
2
- import getFont from './getFont.js';
2
+ import { getFont } from './getFont.js';
3
3
 
4
4
  function isSmallish(options) {
5
5
  return (
@@ -30,7 +30,7 @@ function get(metric, metricName, pos, options) {
30
30
  },30)':x=(w-tw)/2: y=H-${pos}-h/${x}:fontcolor=white:fontsize=h/${fontSize}:box=1:boxcolor=0x000000AA:boxborderw=2:text='${metricName} ${metric}'`;
31
31
  }
32
32
 
33
- export default function (videoMetrics, timingMetrics, options) {
33
+ export function getTimingMetrics(videoMetrics, timingMetrics, options) {
34
34
  let text = '';
35
35
  const vm = videoMetrics.visualMetrics;
36
36
  const startPosition = 'h/10';
@@ -7,9 +7,9 @@ import {
7
7
  import { promisify } from 'node:util';
8
8
  import intel from 'intel';
9
9
  import get from 'lodash.get';
10
- import addTextToVideo from './addTextToVideo.js';
11
- import removeOrange from './removeOrange.js';
12
- import convert from './convertFps.js';
10
+ import { addTextToVideo } from './addTextToVideo.js';
11
+ import { removeOrange } from './removeOrange.js';
12
+ import { convert } from './convertFps.js';
13
13
  import { convert as _convert } from '../../defaults.js';
14
14
  import { isAndroidConfigured } from '../../../android/index.js';
15
15
  const rename = promisify(_rename);
@@ -17,7 +17,7 @@ const copyFile = promisify(_copyFile);
17
17
  const unlink = promisify(_unlink);
18
18
  const log = intel.getLogger('browsertime.video');
19
19
 
20
- export default async function (
20
+ export async function finetuneVideo(
21
21
  videoDir,
22
22
  videoPath,
23
23
  index,
@@ -2,7 +2,7 @@ import { execa } from 'execa';
2
2
  import intel from 'intel';
3
3
  const log = intel.getLogger('browsertime.video');
4
4
 
5
- export default async function (
5
+ export async function removeOrange(
6
6
  inputFile,
7
7
  outputFile,
8
8
  newStart,
@@ -1,4 +1,4 @@
1
- export default function (metrics) {
1
+ export function extraMetrics(metrics) {
2
2
  const videoMetrics = {};
3
3
  if (!metrics.VisualReadiness) {
4
4
  metrics.VisualReadiness =
@@ -1,10 +1,10 @@
1
1
  import { join } from 'node:path';
2
2
  import intel from 'intel';
3
3
  import { run } from './visualMetrics.js';
4
- import extraMetrics from './extraMetrics.js';
4
+ import { extraMetrics } from './extraMetrics.js';
5
5
  const log = intel.getLogger('browsertime.video');
6
6
 
7
- export default async function (
7
+ export async function getVideoMetrics(
8
8
  videoDir,
9
9
  filmstripDir,
10
10
  videoPath,
@@ -8,7 +8,7 @@ const unlink = promisify(_unlink);
8
8
  const log = intel.getLogger('browsertime.video');
9
9
  const delay = ms => new Promise(res => setTimeout(res, ms));
10
10
 
11
- export default class AndroidRecorder {
11
+ export class AndroidRecorder {
12
12
  constructor(options) {
13
13
  this.waitTime = get(options, 'videoParams.androidVideoWaitTime', 5000);
14
14
  this.framerate = get(options, 'videoParams.framerate', framerate);
@@ -2,7 +2,7 @@ import { execa } from 'execa';
2
2
  import intel from 'intel';
3
3
  const log = intel.getLogger('browsertime.video');
4
4
 
5
- export default async function convert(source, destination, crf, threads) {
5
+ export async function convert(source, destination, crf, threads) {
6
6
  const scriptArguments = [
7
7
  '-nostdin',
8
8
  '-i',
@@ -3,7 +3,7 @@ import { unlink as _unlink, rename as _rename } from 'node:fs';
3
3
  import intel from 'intel';
4
4
  import get from 'lodash.get';
5
5
  import { start as _start, stop as _stop } from './ffmpegRecorder.js';
6
- import convert from './convert.js';
6
+ import { convert } from './convert.js';
7
7
  import {
8
8
  xvfbDisplay,
9
9
  framerate as _framerate,
@@ -11,12 +11,12 @@ import {
11
11
  convert as _convert,
12
12
  threads as _threads
13
13
  } from '../../defaults.js';
14
- import getViewPort from '../../../support/getViewPort.js';
14
+ import { getViewPort } from '../../../support/getViewPort.js';
15
15
  const unlink = promisify(_unlink);
16
16
  const rename = promisify(_rename);
17
17
  const log = intel.getLogger('browsertime.video');
18
18
 
19
- export default class DesktopRecorder {
19
+ export class DesktopRecorder {
20
20
  constructor(options) {
21
21
  this.display = get(options, 'xvfbParams.display', xvfbDisplay);
22
22
  this.framerate = get(options, 'videoParams.framerate', _framerate);
@@ -1,7 +1,7 @@
1
1
  import { execa } from 'execa';
2
2
  import intel from 'intel';
3
- import getScreenOnOSX from './osx/getScreen.js';
4
- import getSPDisplaysDataType from './osx/getSPDisplaysDataType.js';
3
+ import { getScreenOnOSX } from './osx/getScreen.js';
4
+ import { getSPDisplaysDataType } from './osx/getSPDisplaysDataType.js';
5
5
  const log = intel.getLogger('browsertime.video');
6
6
 
7
7
  async function buildX11FfmpegArguments({
@@ -98,15 +98,15 @@ async function startRecording(ffmpegArguments, nice, filePath) {
98
98
  });
99
99
  }
100
100
  let ffmpegProcess;
101
- if (nice !== 0) {
101
+ if (nice === 0) {
102
+ log.debug('Start FFMPEG with %j', ffmpegArguments);
103
+ ffmpegProcess = execa('ffmpeg', ffmpegArguments);
104
+ } else {
102
105
  ffmpegArguments.unshift('ffmpeg');
103
106
  ffmpegArguments.unshift(`${nice}`);
104
107
  ffmpegArguments.unshift('-n');
105
108
  log.debug('Start FFMPEG with %j', ffmpegArguments);
106
109
  ffmpegProcess = execa('nice', ffmpegArguments);
107
- } else {
108
- log.debug('Start FFMPEG with %j', ffmpegArguments);
109
- ffmpegProcess = execa('ffmpeg', ffmpegArguments);
110
110
  }
111
111
 
112
112
  // Race to catch if ffmpeg exists early, or if recording has started
@@ -1,6 +1,6 @@
1
1
  import { execaCommand as command } from 'execa';
2
2
 
3
- export default async function () {
3
+ export async function getSPDisplaysDataType() {
4
4
  const output = await command('system_profiler SPDisplaysDataType', {
5
5
  shell: true
6
6
  });
@@ -2,7 +2,7 @@ import { execa } from 'execa';
2
2
  import intel from 'intel';
3
3
  const log = intel.getLogger('browsertime.video');
4
4
 
5
- export default async function () {
5
+ export async function getScreenOnOSX() {
6
6
  const scriptArguments = [
7
7
  '-hide_banner',
8
8
  '-f',
@@ -147,7 +147,7 @@ async function generateVideo(destination, recordingDirectoryName) {
147
147
  return removeDirAndFiles(recordingDirectoryName);
148
148
  }
149
149
 
150
- export default class FirefoxWindowRecorder {
150
+ export class FirefoxWindowRecorder {
151
151
  constructor(options, browser, baseDir) {
152
152
  this.options = options;
153
153
  this.browser = browser;
@@ -2,7 +2,7 @@ import { execa } from 'execa';
2
2
  import intel from 'intel';
3
3
  const log = intel.getLogger('browsertime.video');
4
4
 
5
- export default async function convert(source, destination) {
5
+ export async function convert(source, destination) {
6
6
  const scriptArguments = [
7
7
  '-framerate',
8
8
  60,
@@ -4,7 +4,7 @@ import { resolve, join } from 'node:path';
4
4
  import { execaCommand as command } from 'execa';
5
5
  import { promisify } from 'node:util';
6
6
  import { unlink as _unlink } from 'node:fs';
7
- import convert from './convertToMp4.js';
7
+ import { convert } from './convertToMp4.js';
8
8
  import intel from 'intel';
9
9
  const log = intel.getLogger('browsertime.video');
10
10
  const unlink = promisify(_unlink);
@@ -13,7 +13,7 @@ const moduleRootPath = resolve(__dirname, '..', '..', '..', '..');
13
13
  const QVH = resolve(moduleRootPath, 'vendor', 'mac', 'x86', 'qvh');
14
14
  const delay = ms => new Promise(res => setTimeout(res, ms));
15
15
 
16
- export default class IOSRecorder {
16
+ export class IOSRecorder {
17
17
  constructor(options, baseDir) {
18
18
  this.options = options;
19
19
  this.uuid = options.safari.deviceUDID;
@@ -2,7 +2,7 @@ import { execa } from 'execa';
2
2
  import intel from 'intel';
3
3
  const log = intel.getLogger('browsertime.video');
4
4
 
5
- export default async function convert(source, destination) {
5
+ export async function convert(source, destination) {
6
6
  const scriptArguments = [
7
7
  // '-framerate',
8
8
  // 60,
@@ -3,12 +3,12 @@ import util from 'node:util';
3
3
  import fs from 'node:fs';
4
4
  import { execa } from 'execa';
5
5
  import intel from 'intel';
6
- import { default as convert } from './convertToMp4.js';
6
+ import { convert } from './convertToMp4.js';
7
7
  const unlink = util.promisify(fs.unlink);
8
8
  const delay = ms => new Promise(res => setTimeout(res, ms));
9
9
  const log = intel.getLogger('browsertime.video');
10
10
 
11
- export default class IOSSimulatorRecorder {
11
+ export class IOSSimulatorRecorder {
12
12
  constructor(options, baseDir) {
13
13
  this.options = options;
14
14
  this.tmpVideo = path.join(baseDir, 'tmp.mov');
@@ -1,11 +1,11 @@
1
1
  import { isAndroidConfigured } from '../../android/index.js';
2
- import AndroidRecorder from './android/recorder.js';
3
- import DesktopRecorder from './desktop/desktopRecorder.js';
4
- import FirefoxWindowRecorder from './firefox/firefoxWindowRecorder.js';
5
- import IOSSimulatorRecorder from './iosSimulator/recorder.js';
6
- import IOSRecorder from './ios/iosRecorder.js';
2
+ import { AndroidRecorder } from './android/recorder.js';
3
+ import { DesktopRecorder } from './desktop/desktopRecorder.js';
4
+ import { FirefoxWindowRecorder } from './firefox/firefoxWindowRecorder.js';
5
+ import { IOSSimulatorRecorder } from './iosSimulator/recorder.js';
6
+ import { IOSRecorder } from './ios/iosRecorder.js';
7
7
 
8
- export default function getRecorder(options, browser, baseDir) {
8
+ export function getRecorder(options, browser, baseDir) {
9
9
  if (
10
10
  options.browser === 'firefox' &&
11
11
  options.firefox &&
@@ -1,7 +1,7 @@
1
1
  import intel from 'intel';
2
2
  import { until, By } from 'selenium-webdriver';
3
3
  const log = intel.getLogger('browsertime.video');
4
- export default async function (driver) {
4
+ export async function setOrangeBackground(driver) {
5
5
  log.debug('Add orange color');
6
6
  // We tried other ways for Android (access an orange page)
7
7
  // That works fine ... but break scripts
@@ -1,16 +1,16 @@
1
1
  import { join } from 'node:path';
2
2
  import get from 'lodash.get';
3
- import getRecorder from './screenRecording/recorder.js';
4
- import getVideoMetrics from './postprocessing/visualmetrics/getVideoMetrics.js';
5
- import finetuneVideo from './postprocessing/finetune/index.js';
3
+ import { getRecorder } from './screenRecording/recorder.js';
4
+ import { getVideoMetrics } from './postprocessing/visualmetrics/getVideoMetrics.js';
5
+ import { finetuneVideo } from './postprocessing/finetune/index.js';
6
6
  import { rename, removeFile, removeDirAndFiles } from '../support/fileUtil.js';
7
- import pathToFolders from '../support/pathToFolder.js';
7
+ import { pathToFolder } from '../support/pathToFolder.js';
8
8
 
9
9
  /**
10
10
  * Create a new Video that handles everything with the video
11
11
  * @class
12
12
  */
13
- class Video {
13
+ export class Video {
14
14
  constructor(storageManager, options, browser) {
15
15
  this.options = options;
16
16
  this.storageManager = storageManager;
@@ -24,15 +24,15 @@ class Video {
24
24
  this.index = index;
25
25
 
26
26
  this.videoDir = await storageManager.createSubDataDir(
27
- join(pathToFolders(url, this.options), 'video')
27
+ join(pathToFolder(url, this.options), 'video')
28
28
  );
29
29
 
30
30
  await storageManager.createSubDataDir(
31
- join(pathToFolders(url, this.options), 'video', 'images', '' + index)
31
+ join(pathToFolder(url, this.options), 'video', 'images', '' + index)
32
32
  );
33
33
 
34
34
  this.filmstripDir = await storageManager.createSubDataDir(
35
- join(pathToFolders(url, this.options), 'filmstrip', '' + index)
35
+ join(pathToFolder(url, this.options), 'filmstrip', '' + index)
36
36
  );
37
37
  }
38
38
 
@@ -60,7 +60,7 @@ class Video {
60
60
  this.isRecording = false;
61
61
  this.videoPath = join(
62
62
  this.storageManager.directory,
63
- pathToFolders(url, this.options),
63
+ pathToFolder(url, this.options),
64
64
  'video',
65
65
  this.index + '.mp4'
66
66
  );
@@ -120,5 +120,3 @@ class Video {
120
120
  return this.recorder.timeToFirstFrame;
121
121
  }
122
122
  }
123
-
124
- export default Video;
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "description": "Browsertime",
3
- "version": "17.0.0-beta.4",
3
+ "version": "17.1.0",
4
4
  "bin": "./bin/browsertime.js",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "@cypress/xvfb": "1.2.4",
8
8
  "@devicefarmer/adbkit": "2.11.3",
9
- "@sitespeed.io/chromedriver": "106.0.5249-61",
10
- "@sitespeed.io/edgedriver": "106.0.1370-34",
11
- "@sitespeed.io/geckodriver": "0.31.0-c",
9
+ "@sitespeed.io/chromedriver": "110.0.5481-77",
10
+ "@sitespeed.io/edgedriver": "109.0.1518-70",
11
+ "@sitespeed.io/geckodriver": "0.32.0",
12
12
  "@sitespeed.io/throttle": "5.0.0",
13
13
  "@sitespeed.io/tracium": "0.3.3",
14
14
  "btoa": "1.2.1",
15
- "chrome-har": "0.13.0",
16
- "chrome-remote-interface": "0.31.3",
17
- "dayjs": "1.11.6",
15
+ "chrome-har": "0.13.1",
16
+ "chrome-remote-interface": "0.32.0",
17
+ "dayjs": "1.11.7",
18
18
  "execa": "6.1.0",
19
19
  "fast-stats": "0.0.6",
20
20
  "find-up": "6.3.0",
@@ -27,21 +27,21 @@
27
27
  "lodash.merge": "4.6.2",
28
28
  "lodash.pick": "4.4.0",
29
29
  "lodash.set": "4.3.2",
30
- "selenium-webdriver": "4.5.0",
31
- "yargs": "17.6.0"
30
+ "selenium-webdriver": "4.8.0",
31
+ "yargs": "17.6.2"
32
32
  },
33
33
  "optionalDependencies": {
34
- "jimp": "0.16.2"
34
+ "jimp": "0.22.1"
35
35
  },
36
36
  "devDependencies": {
37
- "ava": "5.0.1",
38
- "eslint": "8.26.0",
39
- "eslint-config-prettier": "8.5.0",
37
+ "ava": "5.1.0",
38
+ "eslint": "8.31.0",
39
+ "eslint-config-prettier": "8.6.0",
40
40
  "eslint-plugin-prettier": "4.2.1",
41
- "eslint-plugin-unicorn": "44.0.2",
42
- "prettier": "2.7.1",
43
- "serve-handler": "6.1.3",
44
- "serve": "14.0.1"
41
+ "eslint-plugin-unicorn": "45.0.2",
42
+ "prettier": "2.8.2",
43
+ "serve-handler": "6.1.5",
44
+ "serve": "14.1.2"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=14.19.1"
@@ -93,7 +93,7 @@
93
93
  "!test/data"
94
94
  ],
95
95
  "concurrency": 1,
96
- "failFast": false,
96
+ "failFast": true,
97
97
  "require": [
98
98
  "./test/util/setup.js"
99
99
  ],