browsertime 19.3.1 → 21.0.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.
- package/CHANGELOG.md +36 -0
- package/README.md +9 -8
- package/bin/browsertime.js +9 -3
- package/browserscripts/pageinfo/interactionToNextPaintInfo.js +170 -143
- package/browserscripts/timings/interactionToNextPaint.js +49 -137
- package/lib/chrome/webdriver/setupChromiumOptions.js +0 -9
- package/lib/core/engine/collector.js +11 -0
- package/lib/core/engine/command/actions.js +52 -0
- package/lib/core/engine/command/addText.js +48 -30
- package/lib/core/engine/command/android.js +43 -4
- package/lib/core/engine/command/cache.js +39 -2
- package/lib/core/engine/command/chromeDevToolsProtocol.js +51 -1
- package/lib/core/engine/command/chromeTrace.js +34 -0
- package/lib/core/engine/command/click.js +102 -52
- package/lib/core/engine/command/debug.js +19 -2
- package/lib/core/engine/command/element.js +66 -0
- package/lib/core/engine/command/geckoProfiler.js +41 -1
- package/lib/core/engine/command/javaScript.js +43 -20
- package/lib/core/engine/command/measure.js +151 -19
- package/lib/core/engine/command/meta.js +17 -0
- package/lib/core/engine/command/mouse/clickAndHold.js +56 -29
- package/lib/core/engine/command/mouse/contextClick.js +30 -11
- package/lib/core/engine/command/mouse/doubleClick.js +35 -11
- package/lib/core/engine/command/mouse/mouseMove.js +38 -16
- package/lib/core/engine/command/mouse/singleClick.js +187 -12
- package/lib/core/engine/command/navigation.js +31 -3
- package/lib/core/engine/command/screenshot.js +33 -0
- package/lib/core/engine/command/scroll.js +35 -13
- package/lib/core/engine/command/select.js +55 -36
- package/lib/core/engine/command/set.js +51 -36
- package/lib/core/engine/command/stopWatch.js +30 -9
- package/lib/core/engine/command/switch.js +49 -11
- package/lib/core/engine/command/wait.js +50 -25
- package/lib/core/engine/commands.js +267 -0
- package/lib/core/engine/context.js +81 -0
- package/lib/core/engine/index.js +6 -2
- package/lib/core/engine/iteration.js +20 -102
- package/lib/firefox/geckoProfiler.js +49 -1
- package/lib/firefox/webdriver/builder.js +35 -12
- package/lib/firefox/webdriver/firefox.js +1 -1
- package/lib/support/cli.js +35 -15
- package/lib/support/engineUtils.js +13 -1
- package/lib/support/statistics.js +11 -1
- package/lib/support/userTiming.js +2 -2
- package/package.json +17 -8
- package/types/android/index.d.ts +70 -0
- package/types/android/index.d.ts.map +1 -0
- package/types/chrome/parseCpuTrace.d.ts +21 -0
- package/types/chrome/parseCpuTrace.d.ts.map +1 -0
- package/types/chrome/traceCategoriesParser.d.ts +2 -0
- package/types/chrome/traceCategoriesParser.d.ts.map +1 -0
- package/types/chrome/webdriver/traceUtilities.d.ts +8 -0
- package/types/chrome/webdriver/traceUtilities.d.ts.map +1 -0
- package/types/core/engine/command/action.d.ts +73 -0
- package/types/core/engine/command/action.d.ts.map +1 -0
- package/types/core/engine/command/actions.d.ts +38 -0
- package/types/core/engine/command/actions.d.ts.map +1 -0
- package/types/core/engine/command/addText.d.ts +68 -0
- package/types/core/engine/command/addText.d.ts.map +1 -0
- package/types/core/engine/command/android.d.ts +39 -0
- package/types/core/engine/command/android.d.ts.map +1 -0
- package/types/core/engine/command/cache.d.ts +53 -0
- package/types/core/engine/command/cache.d.ts.map +1 -0
- package/types/core/engine/command/chromeDevToolsProtocol.d.ts +61 -0
- package/types/core/engine/command/chromeDevToolsProtocol.d.ts.map +1 -0
- package/types/core/engine/command/chromeTrace.d.ts +45 -0
- package/types/core/engine/command/chromeTrace.d.ts.map +1 -0
- package/types/core/engine/command/click.d.ts +151 -0
- package/types/core/engine/command/click.d.ts.map +1 -0
- package/types/core/engine/command/debug.d.ts +28 -0
- package/types/core/engine/command/debug.d.ts.map +1 -0
- package/types/core/engine/command/element.d.ts +49 -0
- package/types/core/engine/command/element.d.ts.map +1 -0
- package/types/core/engine/command/geckoProfiler.d.ts +46 -0
- package/types/core/engine/command/geckoProfiler.d.ts.map +1 -0
- package/types/core/engine/command/javaScript.d.ts +63 -0
- package/types/core/engine/command/javaScript.d.ts.map +1 -0
- package/types/core/engine/command/measure.d.ts +194 -0
- package/types/core/engine/command/measure.d.ts.map +1 -0
- package/types/core/engine/command/meta.d.ts +23 -0
- package/types/core/engine/command/meta.d.ts.map +1 -0
- package/types/core/engine/command/mouse/clickAndHold.d.ts +82 -0
- package/types/core/engine/command/mouse/clickAndHold.d.ts.map +1 -0
- package/types/core/engine/command/mouse/contextClick.d.ts +44 -0
- package/types/core/engine/command/mouse/contextClick.d.ts.map +1 -0
- package/types/core/engine/command/mouse/doubleClick.d.ts +51 -0
- package/types/core/engine/command/mouse/doubleClick.d.ts.map +1 -0
- package/types/core/engine/command/mouse/index.d.ts +6 -0
- package/types/core/engine/command/mouse/index.d.ts.map +1 -0
- package/types/core/engine/command/mouse/mouseMove.d.ts +56 -0
- package/types/core/engine/command/mouse/mouseMove.d.ts.map +1 -0
- package/types/core/engine/command/mouse/singleClick.d.ts +115 -0
- package/types/core/engine/command/mouse/singleClick.d.ts.map +1 -0
- package/types/core/engine/command/navigation.d.ts +45 -0
- package/types/core/engine/command/navigation.d.ts.map +1 -0
- package/types/core/engine/command/screenshot.d.ts +33 -0
- package/types/core/engine/command/screenshot.d.ts.map +1 -0
- package/types/core/engine/command/scroll.d.ts +52 -0
- package/types/core/engine/command/scroll.d.ts.map +1 -0
- package/types/core/engine/command/select.d.ts +81 -0
- package/types/core/engine/command/select.d.ts.map +1 -0
- package/types/core/engine/command/set.d.ts +74 -0
- package/types/core/engine/command/set.d.ts.map +1 -0
- package/types/core/engine/command/stopWatch.d.ts +49 -0
- package/types/core/engine/command/stopWatch.d.ts.map +1 -0
- package/types/core/engine/command/switch.d.ts +77 -0
- package/types/core/engine/command/switch.d.ts.map +1 -0
- package/types/core/engine/command/util/lcpHighlightScript.d.ts +2 -0
- package/types/core/engine/command/util/lcpHighlightScript.d.ts.map +1 -0
- package/types/core/engine/command/util/lsHighlightScript.d.ts +2 -0
- package/types/core/engine/command/util/lsHighlightScript.d.ts.map +1 -0
- package/types/core/engine/command/wait.d.ts +74 -0
- package/types/core/engine/command/wait.d.ts.map +1 -0
- package/types/core/engine/commands.d.ts +161 -0
- package/types/core/engine/commands.d.ts.map +1 -0
- package/types/core/engine/context.d.ts +87 -0
- package/types/core/engine/context.d.ts.map +1 -0
- package/types/firefox/geckoProfiler.d.ts +11 -0
- package/types/firefox/geckoProfiler.d.ts.map +1 -0
- package/types/firefox/settings/geckoProfilerDefaults.d.ts +8 -0
- package/types/firefox/settings/geckoProfilerDefaults.d.ts.map +1 -0
- package/types/scripting.d.ts +2 -0
- package/types/support/engineUtils.d.ts +5 -0
- package/types/support/engineUtils.d.ts.map +1 -0
- package/types/support/errors.d.ts +15 -0
- package/types/support/errors.d.ts.map +1 -0
- package/types/support/fileUtil.d.ts +10 -0
- package/types/support/fileUtil.d.ts.map +1 -0
- package/types/support/filters.d.ts +7 -0
- package/types/support/filters.d.ts.map +1 -0
- package/types/support/getViewPort.d.ts +2 -0
- package/types/support/getViewPort.d.ts.map +1 -0
- package/types/support/pathToFolder.d.ts +2 -0
- package/types/support/pathToFolder.d.ts.map +1 -0
- package/types/support/storageManager.d.ts +17 -0
- package/types/support/storageManager.d.ts.map +1 -0
- package/types/support/tcpdump.d.ts +10 -0
- package/types/support/tcpdump.d.ts.map +1 -0
- package/types/support/userTiming.d.ts +2 -0
- package/types/support/userTiming.d.ts.map +1 -0
- package/types/support/util.d.ts +6 -0
- package/types/support/util.d.ts.map +1 -0
- package/types/video/defaults.d.ts +7 -0
- package/types/video/defaults.d.ts.map +1 -0
- package/types/video/postprocessing/finetune/addTextToVideo.d.ts +2 -0
- package/types/video/postprocessing/finetune/addTextToVideo.d.ts.map +1 -0
- package/types/video/postprocessing/finetune/convertFps.d.ts +2 -0
- package/types/video/postprocessing/finetune/convertFps.d.ts.map +1 -0
- package/types/video/postprocessing/finetune/getFont.d.ts +2 -0
- package/types/video/postprocessing/finetune/getFont.d.ts.map +1 -0
- package/types/video/postprocessing/finetune/getTimingMetrics.d.ts +2 -0
- package/types/video/postprocessing/finetune/getTimingMetrics.d.ts.map +1 -0
- package/types/video/postprocessing/finetune/index.d.ts +2 -0
- package/types/video/postprocessing/finetune/index.d.ts.map +1 -0
- package/types/video/postprocessing/finetune/removeOrange.d.ts +2 -0
- package/types/video/postprocessing/finetune/removeOrange.d.ts.map +1 -0
- package/types/video/postprocessing/visualmetrics/extraMetrics.d.ts +5 -0
- package/types/video/postprocessing/visualmetrics/extraMetrics.d.ts.map +1 -0
- package/types/video/postprocessing/visualmetrics/getVideoMetrics.d.ts +5 -0
- package/types/video/postprocessing/visualmetrics/getVideoMetrics.d.ts.map +1 -0
- package/types/video/postprocessing/visualmetrics/visualMetrics.d.ts +3 -0
- package/types/video/postprocessing/visualmetrics/visualMetrics.d.ts.map +1 -0
- package/types/video/screenRecording/android/recorder.d.ts +11 -0
- package/types/video/screenRecording/android/recorder.d.ts.map +1 -0
- package/types/video/screenRecording/desktop/convert.d.ts +2 -0
- package/types/video/screenRecording/desktop/convert.d.ts.map +1 -0
- package/types/video/screenRecording/desktop/desktopRecorder.d.ts +28 -0
- package/types/video/screenRecording/desktop/desktopRecorder.d.ts.map +1 -0
- package/types/video/screenRecording/desktop/ffmpegRecorder.d.ts +17 -0
- package/types/video/screenRecording/desktop/ffmpegRecorder.d.ts.map +1 -0
- package/types/video/screenRecording/desktop/osx/getSPDisplaysDataType.d.ts +2 -0
- package/types/video/screenRecording/desktop/osx/getSPDisplaysDataType.d.ts.map +1 -0
- package/types/video/screenRecording/desktop/osx/getScreen.d.ts +2 -0
- package/types/video/screenRecording/desktop/osx/getScreen.d.ts.map +1 -0
- package/types/video/screenRecording/firefox/firefoxWindowRecorder.d.ts +13 -0
- package/types/video/screenRecording/firefox/firefoxWindowRecorder.d.ts.map +1 -0
- package/types/video/screenRecording/ios/convertToMp4.d.ts +2 -0
- package/types/video/screenRecording/ios/convertToMp4.d.ts.map +1 -0
- package/types/video/screenRecording/ios/iosRecorder.d.ts +14 -0
- package/types/video/screenRecording/ios/iosRecorder.d.ts.map +1 -0
- package/types/video/screenRecording/iosSimulator/convertToMp4.d.ts +2 -0
- package/types/video/screenRecording/iosSimulator/convertToMp4.d.ts.map +1 -0
- package/types/video/screenRecording/iosSimulator/recorder.d.ts +9 -0
- package/types/video/screenRecording/iosSimulator/recorder.d.ts.map +1 -0
- package/types/video/screenRecording/recorder.d.ts +7 -0
- package/types/video/screenRecording/recorder.d.ts.map +1 -0
- package/types/video/screenRecording/setOrangeBackground.d.ts +2 -0
- package/types/video/screenRecording/setOrangeBackground.d.ts.map +1 -0
- package/types/video/video.d.ts +41 -0
- package/types/video/video.d.ts.map +1 -0
- package/CONTRIBUTING.md +0 -24
- package/browsersupport/firefox-profile/cert9.db +0 -0
- package/browsersupport/firefox-profile/chrome/userChrome.css +0 -4
- package/browsersupport/firefox-profile/key4.db +0 -0
- package/docs/examples/README.md +0 -9
- package/docs/examples/advance.md +0 -12
- package/docs/examples/android.md +0 -54
- package/docs/examples/basic.md +0 -36
- package/docs/examples/chrome.md +0 -28
- package/docs/examples/firefox.md +0 -10
- package/docs/issues.md +0 -18
- package/docs/new-style-script-objects.md +0 -38
- package/docs/sequence-diagrams/loadAndWait.wsd +0 -24
- package/docs/sequence-diagrams/run.wsd +0 -24
- package/vendor/mac/x86/qvh +0 -0
- package/visualmetrics/__init__.py +0 -1
- package/visualmetrics/test_data/ms_000000.png +0 -0
- package/visualmetrics/test_data/ms_000920.png +0 -0
- package/visualmetrics/test_data/ms_001000.png +0 -0
- package/visualmetrics/test_data/ms_001080.png +0 -0
- package/visualmetrics/test_data/ms_001200.png +0 -0
- package/visualmetrics/test_data/ms_001240.png +0 -0
- package/visualmetrics/test_data/ms_001280.png +0 -0
- package/visualmetrics/test_data/ms_001360.png +0 -0
- package/visualmetrics/test_data/ms_001400.png +0 -0
- package/visualmetrics/test_data/ms_001520.png +0 -0
- package/visualmetrics/test_data/ms_002040.png +0 -0
- package/visualmetrics/test_data/ms_002600.png +0 -0
- package/visualmetrics/test_data/ms_003160.png +0 -0
- package/visualmetrics/test_data/ms_003720.png +0 -0
- package/visualmetrics/test_data/ms_004280.png +0 -0
- package/visualmetrics/test_data/ms_004880.png +0 -0
- package/visualmetrics/test_data/ms_005440.png +0 -0
- package/visualmetrics/test_data/ms_006000.png +0 -0
- package/visualmetrics/test_visualmetrics.py +0 -34
|
Binary file
|
package/docs/examples/README.md
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Examples
|
|
2
|
-
========
|
|
3
|
-
All examples are under the assumption that the tool was installed via npm. If you have cloned the git repository you will need to substitute "browsertime" with the path to the JS file "bin/browsertime.js" relative to the checked out repository.
|
|
4
|
-
|
|
5
|
-
- [Basic](basic.md)
|
|
6
|
-
- [Advance](advance.md)
|
|
7
|
-
- [Firefox](firefox.md)
|
|
8
|
-
- [Chrome](chrome.md)
|
|
9
|
-
- [Android](android.md)
|
package/docs/examples/advance.md
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Advance Examples
|
|
2
|
-
================
|
|
3
|
-
|
|
4
|
-
This page shows a few of the more advance examples of browsertime
|
|
5
|
-
|
|
6
|
-
browsertime https://www.sitespeed.io --script ~/browserscripts/scripts.js
|
|
7
|
-
|
|
8
|
-
- The script option allows for a single file or a directory to be passed to gather custom values that will be available in the JSON output. An additional page will be created to cover this option in the future.
|
|
9
|
-
|
|
10
|
-
bin/browsertime.js https://www.sitespeed.io --pageCompleteCheck 'return window.performance.timing.loadEventEnd>0'
|
|
11
|
-
|
|
12
|
-
- You can pass in a javascript snippet that is repeatedly queried to see if page has completed loading (indicated by the script returning true). Default script is 'return window.performance.timing.loadEventEnd>0'.
|
package/docs/examples/android.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
Android Examples
|
|
2
|
-
================
|
|
3
|
-
|
|
4
|
-
This page will give a few example to get you up and running with
|
|
5
|
-
browsertime on Android devices. Generally, add `--android` and then
|
|
6
|
-
configure the browser vehicle.
|
|
7
|
-
|
|
8
|
-
`browsertime --android https://www.sitespeed.io`
|
|
9
|
-
|
|
10
|
-
- The `--android` flag targets Chrome for Android by
|
|
11
|
-
default.
|
|
12
|
-
- Chrome for Android means the `com.android.chrome` package (and the
|
|
13
|
-
`com.google.android.apps.chrome.Main` activity).
|
|
14
|
-
|
|
15
|
-
`browsertime --android --browser chrome --chrome.android.deviceSerial SERIAL https://www.sitespeed.io`
|
|
16
|
-
|
|
17
|
-
- Use `chrome.android.deviceSerial` to target a specific device (by
|
|
18
|
-
serial or by ADB-over-TCP/IP address.
|
|
19
|
-
|
|
20
|
-
`browsertime --android --browser firefox https://www.sitespeed.io`
|
|
21
|
-
|
|
22
|
-
- The `firefox` browser means GeckoView example by default.
|
|
23
|
-
- GeckoView example means the `org.mozilla.geckoview_example` package
|
|
24
|
-
and the `org.mozilla.geckoview_example.GeckoViewActivity` activity.
|
|
25
|
-
|
|
26
|
-
`browsertime --android --browser firefox --firefox.android.deviceSerial '127.0.0.1:555' https://www.sitespeed.io`
|
|
27
|
-
|
|
28
|
-
- Use `firefox.android.deviceSerial` to target a specific device (by
|
|
29
|
-
serial or by ADB-over-TCP/IP address.
|
|
30
|
-
|
|
31
|
-
`browsertime --android --browser firefox --firefox.android.package org.mozilla.fenix.debug --firefox.android.activity org.mozilla.fenix.IntentReceiverActivity https://www.sitespeed.io`
|
|
32
|
-
|
|
33
|
-
- Use `firefox.android.{package,activity}` to configure which Android
|
|
34
|
-
package and activity is invoked for GeckoView (`--browser firefox`)
|
|
35
|
-
Apps.
|
|
36
|
-
|
|
37
|
-
`browsertime --android --browser firefox --firefox.android.package org.mozilla.firefox --firefox.android.activity org.mozilla.gecko.BrowserApp --firefox.android.intentArgument=--ez --firefox.android.intentArgument=skipstartpane --firefox.android.intentArgument=true https://www.sitespeed.io`
|
|
38
|
-
|
|
39
|
-
- Use `firefox.android.intentArgument` to configure how the Android
|
|
40
|
-
intent is launched.
|
|
41
|
-
- Prefer `firefox.android.intentArgument=...`, especially with
|
|
42
|
-
arguments starting with hyphens, to avoid a browsertime parsing
|
|
43
|
-
issue where the `--...` will be interpreted as an argument to
|
|
44
|
-
browsertime itself.
|
|
45
|
-
- Passed through to `adb shell am start ...` follow the format at
|
|
46
|
-
[https://developer.android.com/studio/command-line/adb#IntentSpec](https://developer.android.com/studio/command-line/adb#IntentSpec).
|
|
47
|
-
- To add multiple arguments, repeat `--firefox.android.intentArgument`
|
|
48
|
-
arguments.
|
|
49
|
-
|
|
50
|
-
`browsertime --android --browser chrome --chrome.android.package org.mozilla.tv.firefox.debug --firefox.android.activity .MainActivity https://www.sitespeed.io`
|
|
51
|
-
|
|
52
|
-
- Use `chrome.android.{package,activity}` to configure which Android
|
|
53
|
-
package and activity is invoked for WebView (`--browser chrome`)
|
|
54
|
-
Apps.
|
package/docs/examples/basic.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
Basic Examples
|
|
2
|
-
==============
|
|
3
|
-
|
|
4
|
-
This page will give a few example to get you up and running with browsertime.
|
|
5
|
-
|
|
6
|
-
browsertime --help
|
|
7
|
-
|
|
8
|
-
- Use the help option if you would like to know what options are available.
|
|
9
|
-
|
|
10
|
-
browsertime https://www.sitespeed.io
|
|
11
|
-
|
|
12
|
-
- The only required option when running browsertime is the URL you want to test.
|
|
13
|
-
|
|
14
|
-
browsertime https://www.sitespeed.io -n 5
|
|
15
|
-
|
|
16
|
-
- If you would like to override the default number of runs. It defaults to 3.
|
|
17
|
-
|
|
18
|
-
browsertime https://www.sitespeed.io --screenshot
|
|
19
|
-
|
|
20
|
-
- If you would like to capture screenshots during your run(s). It will capture a screenshot for each run.
|
|
21
|
-
|
|
22
|
-
browsertime https://www.sitespeed.io -b chrome
|
|
23
|
-
|
|
24
|
-
- If you would like to override the default browser used. Defaults to Firefox.
|
|
25
|
-
|
|
26
|
-
browsertime https://www.sitespeed.io --prettyPrint
|
|
27
|
-
|
|
28
|
-
- If you would like to output the HAR in a more human readable format.
|
|
29
|
-
|
|
30
|
-
browsertime https://www.sitespeed.io --delay 5000
|
|
31
|
-
|
|
32
|
-
- If you would like to deploy the time in between test runs. This option takes milliseconds and defaults no delay(0).
|
|
33
|
-
|
|
34
|
-
browsertime https://www.sitespeed.io --userAgent 'Googlebot/2.1 (+http://www.googlebot.com/bot.html)'
|
|
35
|
-
|
|
36
|
-
- If you want to customize the user agent passed to the test runs you can do so with the user agent option.
|
package/docs/examples/chrome.md
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
Chrome Examples
|
|
2
|
-
===============
|
|
3
|
-
|
|
4
|
-
This page shows a few of the options specific to Chrome.
|
|
5
|
-
|
|
6
|
-
browsertime https://www.sitespeed.io -b chrome
|
|
7
|
-
|
|
8
|
-
- Will use chrome's native performance logs to generate a HAR file.
|
|
9
|
-
|
|
10
|
-
browsertime https://www.sitespeed.io --chrome.collectPerfLog -b chrome
|
|
11
|
-
|
|
12
|
-
- Used for debugging chrome's native HAR export you can have it additionally output the Chrome performance logs.
|
|
13
|
-
|
|
14
|
-
browsertime https://www.sitespeed.io --chrome.args -b chrome
|
|
15
|
-
|
|
16
|
-
- Extra command line args to pass directly to the chrome process. (e.g. --no-sandbox)
|
|
17
|
-
|
|
18
|
-
browsertime https://www.sitespeed.io --chrome.binaryPath -b chrome
|
|
19
|
-
|
|
20
|
-
- Path to custom Chrome binary (e.g. Chrome Canary). On OS X, the path should be to the binary inside the app bundle. (e.g. /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary)
|
|
21
|
-
|
|
22
|
-
browsertime https://www.sitespeed.io --chrome.mobileEmulation.deviceName 'Apple iPad' -b chrome
|
|
23
|
-
|
|
24
|
-
- Name of device to emulate (see list in Chrome DevTools)
|
|
25
|
-
|
|
26
|
-
browsertime https://www.sitespeed.io --chrome.mobileEmulation.width 360 --chrome.mobileEmulation.height 640 --chrome.mobileEmulation.pixelRatio 2.0 -b chrome
|
|
27
|
-
|
|
28
|
-
- Width in pixels of emulated mobile screen (e.g. 360), Height in pixels of emulated mobile screen (e.g. 640), Pixel ration of emulated mobile screen (e.g. 2.0)
|
package/docs/examples/firefox.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
Firefox Examples
|
|
2
|
-
================
|
|
3
|
-
|
|
4
|
-
This page shows a few of the options specific to Firefox.
|
|
5
|
-
|
|
6
|
-
```
|
|
7
|
-
browsertime https://www.sitespeed.io -b firefox --firefox.binaryPath '/Applications/Firefox.app/Contents/MacOS/firefox-bin'
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
- Path to custom Firefox binary (e.g. Firefox Nightly). On OS X, the path should be to the binary inside the app bundle. (e.g. /Applications/Firefox.app/Contents/MacOS/firefox-bin)
|
package/docs/issues.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Running one of the example from the example docs produces the following error:
|
|
2
|
-
|
|
3
|
-
``` shellsession
|
|
4
|
-
browsertime https://www.sitespeed.io/
|
|
5
|
-
[2016-04-06 22:40:03] Running chrome for url: https://www.sitespeed.io/
|
|
6
|
-
events.js:141
|
|
7
|
-
throw er; // Unhandled 'error' event
|
|
8
|
-
^
|
|
9
|
-
|
|
10
|
-
Error: spawn java ENOENT
|
|
11
|
-
at exports._errnoException (util.js:870:11)
|
|
12
|
-
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
|
|
13
|
-
at onErrorNT (internal/child_process.js:344:16)
|
|
14
|
-
at nextTickCallbackWith2Args (node.js:442:9)
|
|
15
|
-
at process._tickCallback (node.js:356:17)
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Solution: Java is missing from your system and you will need install it.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# New-style script objects:
|
|
2
|
-
|
|
3
|
-
A new-style object allows the user to write a script that executes in an environment that meets certain requirements. The script writer specifies the requirements for their script and the browser will meet those requirements before executing the script's functionality. If the requirements cannot be met, then the script's functionality will not be executed.
|
|
4
|
-
|
|
5
|
-
A new-style script object is defined in a script file by a single object that is assigned to `module.exports`. A new-style script object has the following keys:
|
|
6
|
-
|
|
7
|
-
* *requires*: An object whose keys define the requirements for executing this script object's functionality.
|
|
8
|
-
* *function*: A possibly asynchronous function that actually performs the script object's actions. The function will be invoked with no parameters. If the function is asynchronous, it must return a `Promise`. The value `resolve`d by that promise is serialized into browsertime's result output. If the function is not asynchronous, any value returned by this function is written into browsertime's result output.
|
|
9
|
-
|
|
10
|
-
At the moment, browsertime only supports one requirement in new-style script objects, the `privilege` requirement. If the `privilege` requirement is set to `true`, the new-style script object's functionality will execute with access to the browser's privileged APIs (which is currently only available in Firefox). If the browser cannot guarantee that the script can execute with access to the browser's privileged API (for whatever reason), it will not be executed.
|
|
11
|
-
|
|
12
|
-
For example,
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
requires: { privilege: true },
|
|
16
|
-
function: function() {
|
|
17
|
-
const { AppConstants } = ChromeUtils.import(
|
|
18
|
-
'resource://gre/modules/AppConstants.jsm'
|
|
19
|
-
);
|
|
20
|
-
return AppConstants;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
defines a new-style script object that requires access to the browser's privileged API in order to fetch its constants.
|
|
25
|
-
|
|
26
|
-
The equivalent functionality can be accomplished asynchronously:
|
|
27
|
-
|
|
28
|
-
module.exports = {
|
|
29
|
-
requires: { privilege: true },
|
|
30
|
-
function: async function() {
|
|
31
|
-
return new Promise(resolve => {
|
|
32
|
-
const { AppConstants } = ChromeUtils.import(
|
|
33
|
-
'resource://gre/modules/AppConstants.jsm'
|
|
34
|
-
);
|
|
35
|
-
resolve(AppConstants);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
title Load a url and wait for load to complete
|
|
2
|
-
|
|
3
|
-
caller -> SeleniumRunner: loadAndWait
|
|
4
|
-
SeleniumRunner -> Browser: set page load timeout
|
|
5
|
-
SeleniumRunner -> Browser: set script timeout
|
|
6
|
-
SeleniumRunner -> Browser: Load url
|
|
7
|
-
|
|
8
|
-
note right of Browser
|
|
9
|
-
Wait at most "page load timeout"
|
|
10
|
-
milliseconds
|
|
11
|
-
end note
|
|
12
|
-
|
|
13
|
-
Browser -> SeleniumRunner :
|
|
14
|
-
SeleniumRunner -> Browser: executeScript "pageCompleteCheck"
|
|
15
|
-
|
|
16
|
-
note right of Browser
|
|
17
|
-
Keep testing script
|
|
18
|
-
at most "wait script timeout"
|
|
19
|
-
milliseconds
|
|
20
|
-
end note
|
|
21
|
-
|
|
22
|
-
Browser -> SeleniumRunner :
|
|
23
|
-
|
|
24
|
-
SeleniumRunner -> caller :
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
title Run one url via Engine
|
|
2
|
-
|
|
3
|
-
caller -> Engine: run
|
|
4
|
-
Engine -> EngineDelegate: onStartRun (BmpRunner - start proxy)
|
|
5
|
-
|
|
6
|
-
loop n times
|
|
7
|
-
Engine -> SeleniumRunner: start
|
|
8
|
-
SeleniumRunner -> Browser: launch browser
|
|
9
|
-
Engine -> EngineDelegate: onStartIteration (createHAR OR startNewPage)
|
|
10
|
-
Engine -> SeleniumRunner: loadAndWait
|
|
11
|
-
SeleniumRunner -> Browser: get url and execute pageCompleteCheck
|
|
12
|
-
loop for each script
|
|
13
|
-
Engine -> SeleniumRunner: runScript
|
|
14
|
-
SeleniumRunner -> Browser: executeScript
|
|
15
|
-
end
|
|
16
|
-
Engine -> EngineDelegate: onStopIteration
|
|
17
|
-
Engine -> SeleniumRunner: stop
|
|
18
|
-
SeleniumRunner -> Browser: quit browser
|
|
19
|
-
Engine -> Engine: optionally wait for short delay
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
Engine -> EngineDelegate: onStopRun (BmpRunner - getHAR, stop proxy)
|
|
23
|
-
|
|
24
|
-
Engine -> caller : [return HAR and script results]
|
package/vendor/mac/x86/qvh
DELETED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import unittest
|
|
2
|
-
import os
|
|
3
|
-
|
|
4
|
-
from browsertime.visualmetrics import (
|
|
5
|
-
calculate_contentful_speed_index,
|
|
6
|
-
calculate_perceptual_speed_index,
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
HERE = os.path.dirname(__file__)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class TestVisualMetrics(unittest.TestCase):
|
|
13
|
-
def setUp(self):
|
|
14
|
-
self.directory = "test_data"
|
|
15
|
-
images = os.listdir(os.path.join(HERE, self.directory))
|
|
16
|
-
|
|
17
|
-
def _p(image):
|
|
18
|
-
p = {}
|
|
19
|
-
p["time"] = int(image.split(".")[0].split("ms_")[-1])
|
|
20
|
-
return p
|
|
21
|
-
|
|
22
|
-
progress = [_p(image) for image in images if image.startswith("ms_")]
|
|
23
|
-
self.sorted_progress = sorted(progress,
|
|
24
|
-
key = lambda image: image['time'])
|
|
25
|
-
|
|
26
|
-
def test_calculate_contentful_speed_index(self):
|
|
27
|
-
res = calculate_contentful_speed_index(self.sorted_progress,
|
|
28
|
-
self.directory)
|
|
29
|
-
self.assertEqual(res[0], 1188)
|
|
30
|
-
|
|
31
|
-
def test_calculate_perceptual_speed_index(self):
|
|
32
|
-
res = calculate_perceptual_speed_index(self.sorted_progress,
|
|
33
|
-
self.directory)
|
|
34
|
-
self.assertEqual(res[0], 946)
|