browsertime 17.18.1 → 18.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
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
# Browsertime changelog (we do [semantic versioning](https://semver.org))
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 18.0.0 - 2023-11-07
|
|
4
|
+
|
|
5
|
+
### Breaking
|
|
6
|
+
* Dropping support for NodeJS 16.
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
* Updated all dev-dependencies to latest versions [#2013](https://github.com/sitespeedio/browsertime/pull/2013).
|
|
10
|
+
* Updated GitHub Actions to use latest versions of actions and Ubuntu 22.04 [#2012](https://github.com/sitespeedio/browsertime/pull/2012), [#2014](https://github.com/sitespeedio/browsertime/pull/2014) and [#2016](https://github.com/sitespeedio/browsertime/pull/2016)
|
|
11
|
+
* Updated all dependencies to latest versions: ADB kit 3.2.5 [#2017](https://github.com/sitespeedio/browsertime/pull/2017), execa, dayjs, get-port and Chromedriver [#2015](https://github.com/sitespeedio/browsertime/pull/2015).
|
|
12
|
+
|
|
13
|
+
## 17.19.0 - 2023-11-03
|
|
14
|
+
### Added
|
|
15
|
+
* Updated to Chrome, Firefox and Edge 119 in the Docker container [#2010](https://github.com/sitespeedio/browsertime/pull/2010).
|
|
16
|
+
* Updated to Edgedriver 119.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
* Updated to Selenium 4.15.0 [#2011](https://github.com/sitespeedio/browsertime/pull/2011).
|
|
20
|
+
|
|
21
|
+
## 17.18.1 - 2023-10-31
|
|
4
22
|
### Fixed
|
|
5
23
|
* WebDriver 4.14.0
|
|
6
24
|
* Chromedriver 119.0.6045-59
|
|
7
25
|
|
|
8
|
-
## 17.18.0 -
|
|
26
|
+
## 17.18.0 - 2023-10-23
|
|
9
27
|
### Added
|
|
10
28
|
* Updated to Chromedriver 119 [#2003](https://github.com/sitespeedio/browsertime/pull/2003). 119 works with both Chrome 118 and 119 so it fixes [#1197](https://github.com/sitespeedio/browsertime/issues/1997).
|
|
11
29
|
* Add support for network idle method to know when to end a test that uses network logs. Uses Bidi for Firefox and CDP for Chrome to listen on network events to know when to end a test. By default 5 seconds idle network time ends a tests (you could have network responses that hasn't arrived yet) [#1960](https://github.com/sitespeedio/browsertime/pull/1960). Potentially this can help SPA users or users where the page uses iframes. You can try it out by adding `--pageCompleteCheckNetworkIdle` yo your command line. This is still some work in progress but feel free to try ut out.
|
|
@@ -15,7 +33,7 @@
|
|
|
15
33
|
* Make sure timer always is cleared. There was case of where we do a rase beteween a promise and a timeout where the timeout timer wasn't cleared/removed [#2005](https://github.com/sitespeedio/browsertime/pull/2005).
|
|
16
34
|
* Better way to get the url when you use GeckoProfiler.stop for Firefox, thank you [Nazım Can Altınova](https://github.com/canova) for PR [#1999](https://github.com/sitespeedio/browsertime/pull/1999)
|
|
17
35
|
|
|
18
|
-
## 17.17.0 -
|
|
36
|
+
## 17.17.0 - 2023-10-11
|
|
19
37
|
### Added
|
|
20
38
|
* Firefox 118, Edge 117 and Chrome/Chromedriver 118 in the Docker container [#1996](https://github.com/sitespeedio/browsertime/pull/1996).
|
|
21
39
|
* Expose trace start/stop for Chrome in scripting (the same way as for Firefox). Thank you [KS](https://github.com/92kns) for [#1988](https://github.com/sitespeedio/browsertime/pull/1988). Documentation is coming when the functionality is rolled out in sitespeed.io.
|
|
@@ -23,46 +41,46 @@
|
|
|
23
41
|
### Updated
|
|
24
42
|
* Updated to Selenium 4.12
|
|
25
43
|
|
|
26
|
-
## 17.16.0 -
|
|
44
|
+
## 17.16.0 - 2023-09-04
|
|
27
45
|
### Added
|
|
28
46
|
* Firefox 117 and Edge 116 in the Docker container.
|
|
29
47
|
|
|
30
48
|
### Fixed
|
|
31
49
|
* Updated the BiDi HAR exporter for Firefox to version 0.0.12. This version will not work with Firefox 116 so if you use the BiDi HAR exporter you need to upgrade to Firefox 117.
|
|
32
50
|
|
|
33
|
-
## 17.15.0 -
|
|
51
|
+
## 17.15.0 - 2023-08-16
|
|
34
52
|
### Added
|
|
35
53
|
* Updated Chrome and Chromedriver to 116.
|
|
36
54
|
|
|
37
|
-
## 17.14.3 -
|
|
55
|
+
## 17.14.3 - 2023-08-16
|
|
38
56
|
|
|
39
57
|
### Fixed
|
|
40
58
|
* Updated to Selenium 4.11.1 [#1978](https://github.com/sitespeedio/browsertime/pull/1978).
|
|
41
59
|
* Updated Chrome and Chromedriver to minor versions.
|
|
42
60
|
|
|
43
|
-
## 17.14.2 -
|
|
61
|
+
## 17.14.2 - 2023-07-31
|
|
44
62
|
### Fixed
|
|
45
63
|
* The auto build of release Docker container was broken so no tagged containers was pushed.
|
|
46
64
|
|
|
47
|
-
## 17.14.1 -
|
|
65
|
+
## 17.14.1 - 2023-07-31
|
|
48
66
|
|
|
49
67
|
### Fixed
|
|
50
68
|
* Default jimp resize didn't handle large values (2000) when running in Docker AMD on a ARM machine so changing to another algorithm (HERMITE) [#1977](https://github.com/sitespeedio/browsertime/pull/1977).
|
|
51
69
|
|
|
52
70
|
* Update: chrome-har, dayjs, execa, chrome-remote-interface and jimp [#1976](https://github.com/sitespeedio/browsertime/pull/1976).
|
|
53
71
|
|
|
54
|
-
## 17.14.0 -
|
|
72
|
+
## 17.14.0 - 2023-07-24
|
|
55
73
|
|
|
56
74
|
### Added
|
|
57
75
|
* Edge and Edgedriver 115 [#1973](https://github.com/sitespeedio/browsertime/pull/1973).
|
|
58
76
|
|
|
59
|
-
## 17.13.1 -
|
|
77
|
+
## 17.13.1 - 2023-07-22
|
|
60
78
|
|
|
61
79
|
### Tech
|
|
62
80
|
* Internal fix how the render blocking result is added [#1972](https://github.com/sitespeedio/browsertime/pull/1972).
|
|
63
81
|
|
|
64
82
|
|
|
65
|
-
## 17.13.0 -
|
|
83
|
+
## 17.13.0 - 2023-07-21
|
|
66
84
|
### Fixed
|
|
67
85
|
* Fix for Chromedriver 115 so that it works on Mac again [#1971](https://github.com/sitespeedio/browsertime/pull/1971).
|
|
68
86
|
|
|
@@ -72,7 +90,7 @@
|
|
|
72
90
|
### Tech
|
|
73
91
|
* Run tests on Chrome/Firefox/Edge on Mac OS on our GitHub Actions to catch the next time Chromedriver is broken on Mac [#1970](https://github.com/sitespeedio/browsertime/pull/1970)
|
|
74
92
|
|
|
75
|
-
## 17.12.1 -
|
|
93
|
+
## 17.12.1 - 2023-07-19
|
|
76
94
|
### Fixed
|
|
77
95
|
* Hmm, Chromedriver 115 doesn't seems to work on Mac so reverted to 114.
|
|
78
96
|
|
|
@@ -82,31 +100,31 @@
|
|
|
82
100
|
|
|
83
101
|
* If you collect the Chrome devtools trace using `--cpu` we will now also collect the number of elements that needs recalculate styles before FCP/LCP.[#1964](https://github.com/sitespeedio/browsertime/pull/1964).
|
|
84
102
|
|
|
85
|
-
## 17.11.2 -
|
|
103
|
+
## 17.11.2 - 2023-06-19
|
|
86
104
|
### Fixed
|
|
87
105
|
* Fix --debug mode. Thank you [Gregory Mierzwinski](https://github.com/gmierz) for PR [#1959](https://github.com/sitespeedio/browsertime/pull/1959).
|
|
88
106
|
* Update ff-test-bidi-har-export to 0.0.11 that fixes some error logs [#1961](https://github.com/sitespeedio/browsertime/pull/1961).
|
|
89
107
|
|
|
90
|
-
## 17.11.1 -
|
|
108
|
+
## 17.11.1 - 2023-06-12
|
|
91
109
|
### Fixed
|
|
92
110
|
* If Chrome do not collect largest contentful paint, log that instead of just log null [#1957](https://github.com/sitespeedio/browsertime/pull/1957).
|
|
93
111
|
|
|
94
|
-
## 17.11.0 -
|
|
112
|
+
## 17.11.0 - 2023-06-01
|
|
95
113
|
### Fixed
|
|
96
114
|
* Fixed broken Docker auto build that skipped adding Docker manifest file.
|
|
97
115
|
|
|
98
116
|
### Added
|
|
99
117
|
* Use Chrome ane Chromedriver 114.
|
|
100
118
|
|
|
101
|
-
## 17.10.2 -
|
|
119
|
+
## 17.10.2 - 2023-05-26
|
|
102
120
|
### Fixed
|
|
103
121
|
* Fix for --host-resolver-rules, thank you [Mikhail](https://github.com/atuchin-m) for PR [#1953](https://github.com/sitespeedio/browsertime/pull/1953).
|
|
104
122
|
|
|
105
|
-
## 17.10.1 -
|
|
123
|
+
## 17.10.1 - 2023-05-19
|
|
106
124
|
### Fixed
|
|
107
125
|
* Updated code to collect Interaction To Next Paint [#1952](https://github.com/sitespeedio/browsertime/pull/1952). This new version follow updated version(s) of Google Web Vitals.
|
|
108
126
|
|
|
109
|
-
## 17.10.0 -
|
|
127
|
+
## 17.10.0 - 2023-05-19
|
|
110
128
|
|
|
111
129
|
### Added
|
|
112
130
|
* Chrome, Edge and Firefox 113 [#1946](https://github.com/sitespeedio/browsertime/pull/1946), Chromedriver 113 [#1947](https://github.com/sitespeedio/browsertime/pull/1947) and Edgedriver 113 [#1949](https://github.com/sitespeedio/browsertime/pull/1949).
|
|
@@ -115,7 +133,7 @@
|
|
|
115
133
|
* Bugfix for running iPhone Siumlator (and run tests on latest Mac OS) [#1945](https://github.com/sitespeedio/browsertime/pull/1945).
|
|
116
134
|
* Bumped dependencies for Selenium, yargs and jimp [#1950](https://github.com/sitespeedio/browsertime/pull/1950).
|
|
117
135
|
|
|
118
|
-
## 17.9.0 -
|
|
136
|
+
## 17.9.0 - 2023-04-19
|
|
119
137
|
### Added
|
|
120
138
|
* New command to start geckoprofiling when scripting using Firefox. Thank you [KS](https://github.com/92kns) for PR [#1934](https://github.com/sitespeedio/browsertime/pull/1934). This is probably only something you need if you work at Mozilla. There's also a follow PR [#1940](https://github.com/sitespeedio/browsertime/pull/1940) that fixes some of the issues I've been wanted to fix with the Geckoprofiler code.
|
|
121
139
|
|
|
@@ -124,20 +142,20 @@
|
|
|
124
142
|
### Fixed
|
|
125
143
|
* Bump Chrome remote interface and execa [#1941](https://github.com/sitespeedio/browsertime/pull/1941).
|
|
126
144
|
|
|
127
|
-
## 17.8.1 -
|
|
145
|
+
## 17.8.1 - 2023-04-12
|
|
128
146
|
### Fixed
|
|
129
147
|
* Upgraded to Firefox HAR 0.0.10 [#1939](https://github.com/sitespeedio/browsertime/pull/1939).
|
|
130
|
-
## 17.8.0 -
|
|
148
|
+
## 17.8.0 - 2023-04-11
|
|
131
149
|
### Fixed
|
|
132
150
|
* Upgraded to Firefox HAR 0.0.8 [#1937](https://github.com/sitespeedio/browsertime/pull/1937).
|
|
133
151
|
|
|
134
152
|
### Added
|
|
135
153
|
* Upgraded to Firefox 112 in the Docker container.
|
|
136
|
-
## 17.7.0 -
|
|
154
|
+
## 17.7.0 - 2023-04-07
|
|
137
155
|
### Added
|
|
138
156
|
* Added Edge/Edgedriver 112.
|
|
139
157
|
|
|
140
|
-
## 17.6.0 -
|
|
158
|
+
## 17.6.0 - 2023-04-05
|
|
141
159
|
### Fixed
|
|
142
160
|
* Increased the default wait time from 2 to 5 seconds when a element a clicked and the page complete check runs [#1931](https://github.com/sitespeedio/browsertime/pull/1931)
|
|
143
161
|
|
|
@@ -145,7 +163,7 @@
|
|
|
145
163
|
* Upgraded to Chrome/Chromedriver 112 in the Docker container [#1932](https://github.com/sitespeedio/browsertime/pull/1932).
|
|
146
164
|
* If you use `--headless` Chrome will use the new headless switch [#1933](https://github.com/sitespeedio/browsertime/pull/1933).
|
|
147
165
|
|
|
148
|
-
## 17.5.0 -
|
|
166
|
+
## 17.5.0 - 2023-04-04
|
|
149
167
|
|
|
150
168
|
### Added
|
|
151
169
|
* There's a new better way to get the HAR from [Firefox using WebDriver BiDi network events](https://github.com/firefox-devtools/bidi-har-export). Thank you [Julian Descottes](https://github.com/juliandescottes) and others at Mozilla that made this happen! With the new version we hope to see less overhead getting the HAR + it works on Firefox on Android [#1918](https://github.com/sitespeedio/browsertime/pull/1918). You can turn it on with `--firefox.bidihar`.
|
|
@@ -155,12 +173,12 @@
|
|
|
155
173
|
* Fixed the interaction to next paint error message that started to appear in latest Chrome [#1924](https://github.com/sitespeedio/browsertime/pull/1924).
|
|
156
174
|
* Safer check for getting last meaningful paint [#1927](https://github.com/sitespeedio/browsertime/pull/1927)
|
|
157
175
|
|
|
158
|
-
## 17.4.0 -
|
|
176
|
+
## 17.4.0 - 2023-03-29
|
|
159
177
|
### Added
|
|
160
178
|
* Log the CPU benchmark metric to the console. This is useful (at least for me) when debugging instances with a lot of instability. [#1920](https://github.com/sitespeedio/browsertime/pull/1920).
|
|
161
179
|
* In Chrome 111 some metrics become more instable when running on host with limited CPU. This change also exists in 112 beta. However we where missing out on a couple of command line magic to disable features in Chrome, this fixes that [#1921](https://github.com/sitespeedio/browsertime/pull/1921).
|
|
162
180
|
|
|
163
|
-
## 17.3.0 -
|
|
181
|
+
## 17.3.0 - 2023-03-26
|
|
164
182
|
|
|
165
183
|
### Fixed
|
|
166
184
|
* Bumped Selenium-webdriver to 4.8.2 [#1916](https://github.com/sitespeedio/browsertime/pull/1916).
|
|
@@ -169,20 +187,20 @@
|
|
|
169
187
|
* On Linux you can use taskset to assing FFMPEG to specific CPUs using `--videoParams.taskset "0,5,7,9-11" `. It will start FFMPEG with `taskset -c <CPUS>` to pin FFMPG to specific CPU(s). Specify a numerical list of processors. The list may contain multiple items, separated by comma, and ranges. For example, "0,5,7,9-11". Use it together with isolcpus. Added in [#1917](https://github.com/sitespeedio/browsertime/pull/1917).
|
|
170
188
|
|
|
171
189
|
* If you use a rooted Samsung A51 you can now choose the CPU speed (min/middle/max) using `--android.pinCPUSpeed min|middle|max` [#1915](https://github.com/sitespeedio/browsertime/pull/1915).
|
|
172
|
-
## 17.2.1 -
|
|
190
|
+
## 17.2.1 - 2023-03-16
|
|
173
191
|
### Fixed
|
|
174
192
|
* Bumped Geckodriver to 0.32.2 and Edgedriver to 111.
|
|
175
193
|
|
|
176
|
-
## 17.2.0 -
|
|
194
|
+
## 17.2.0 - 2023-03-14
|
|
177
195
|
### Added
|
|
178
196
|
* Updated Chrome, Chromedriver, Edge and Firefox to 111.
|
|
179
197
|
|
|
180
|
-
## 17.1.1 -
|
|
198
|
+
## 17.1.1 - 2023-03-04
|
|
181
199
|
### Fixed
|
|
182
200
|
* Updated jimp, yargs, webdriver, execa and chrome-remote-interface dependencies [#1909](https://github.com/sitespeedio/browsertime/pull/1909).
|
|
183
201
|
* Added extra log message when using the package.json hack.
|
|
184
202
|
|
|
185
|
-
## 17.1.0 -
|
|
203
|
+
## 17.1.0 - 2023-02-24
|
|
186
204
|
|
|
187
205
|
### Added
|
|
188
206
|
* Expose chrome-remote-interface client to scripting. This makes it so much easier to run whatever CDP command. Get the raw version `commands.cdp.getRawClient();`. See PR [#1905](https://github.com/sitespeedio/browsertime/pull/1905) for a concrete example until we update the documentation.
|
|
@@ -190,7 +208,7 @@
|
|
|
190
208
|
* Fix visual-complete progress calculations to not use fuzz/slop, thank you [Gregory Mierzwinski](https://github.com/gmierz) for PR [#1902](https://github.com/sitespeedio/browsertime/pull/1902).
|
|
191
209
|
* Update to new Chrome HAR [#1906](https://github.com/sitespeedio/browsertime/pull/1906).
|
|
192
210
|
* Fix flushing DNS on Ubuntu 22.04 [#1907](https://github.com/sitespeedio/browsertime/pull/1907).
|
|
193
|
-
## 17.0.0 -
|
|
211
|
+
## 17.0.0 - 2023-02-10
|
|
194
212
|
|
|
195
213
|
### Breaking changes
|
|
196
214
|
The project was transitioned to a [pure ESM package](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) [#1859](https://github.com/sitespeedio/browsertime/pull/1859), allowing us to stay current with dependencies that have made the same transition and ensuring the ability to always utilize the latest versions of our dependencies. This is important for us and will make the project easier to maintain.
|
package/lib/android/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import { join } from 'node:path';
|
|
|
4
4
|
import { EOL as endOfLine } from 'node:os';
|
|
5
5
|
import { execa } from 'execa';
|
|
6
6
|
import intel from 'intel';
|
|
7
|
-
import
|
|
8
|
-
const {
|
|
7
|
+
import pkg from '@devicefarmer/adbkit';
|
|
8
|
+
const { Adb } = pkg;
|
|
9
9
|
import get from 'lodash.get';
|
|
10
10
|
const log = intel.getLogger('browsertime.android');
|
|
11
11
|
const mkdir = promisify(_mkdir);
|
|
@@ -21,7 +21,8 @@ export class Android {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
Android.instance = this;
|
|
24
|
-
this.client = createClient();
|
|
24
|
+
this.client = Adb.createClient();
|
|
25
|
+
|
|
25
26
|
this.id = get(
|
|
26
27
|
options,
|
|
27
28
|
'chrome.android.deviceSerial',
|
|
@@ -48,36 +49,34 @@ export class Android {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
this.device = this.client.getDevice(this.id);
|
|
53
|
+
|
|
51
54
|
if (!this.sdcard) {
|
|
52
55
|
this.sdcard = await this._runCommandAndGet('echo $EXTERNAL_STORAGE');
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
async _runCommand(command) {
|
|
57
|
-
return this.
|
|
60
|
+
return this.device.shell(command);
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
async _runCommandAndGet(command) {
|
|
61
|
-
const data = await this.
|
|
62
|
-
const output = await util.readAll(data);
|
|
64
|
+
const data = await this.device.shell(command);
|
|
65
|
+
const output = await Adb.util.readAll(data);
|
|
63
66
|
return output.toString().trim();
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
async _runAsRootAndGet(command) {
|
|
67
|
-
const data = await this.
|
|
68
|
-
|
|
69
|
-
'su - root -c "' + command + '"'
|
|
70
|
-
);
|
|
71
|
-
const output = await util.readAll(data);
|
|
70
|
+
const data = await this.device.shell('su - root -c "' + command + '"');
|
|
71
|
+
const output = await Adb.util.readAll(data);
|
|
72
72
|
return output.toString().trim();
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
async _runAsRoot(command) {
|
|
76
|
-
const data = await this.
|
|
77
|
-
this.id,
|
|
76
|
+
const data = await this.device.shell(
|
|
78
77
|
'su - root -c "' + command + ' && echo SUCCESS || echo FAIL"'
|
|
79
78
|
);
|
|
80
|
-
const output = await util.readAll(data);
|
|
79
|
+
const output = await Adb.util.readAll(data);
|
|
81
80
|
const result = output.toString().trim();
|
|
82
81
|
if (result === 'FAIL') {
|
|
83
82
|
log.error('Failing running as root:' + command);
|
|
@@ -88,7 +87,7 @@ export class Android {
|
|
|
88
87
|
async _downloadFile(sourcePath, destinationPath) {
|
|
89
88
|
log.trace(`Pulling to ${destinationPath} from ${sourcePath}`);
|
|
90
89
|
|
|
91
|
-
const transfer = await this.
|
|
90
|
+
const transfer = await this.device.pull(sourcePath);
|
|
92
91
|
|
|
93
92
|
return new Promise((resolve, reject) => {
|
|
94
93
|
transfer.on('end', function () {
|
|
@@ -100,7 +99,7 @@ export class Android {
|
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
async _downloadDir(sourcePath, destinationPath) {
|
|
103
|
-
const files = await this.
|
|
102
|
+
const files = await this.device.readdir(sourcePath);
|
|
104
103
|
|
|
105
104
|
for (const file of files) {
|
|
106
105
|
const fullSourcePath = `${sourcePath}/${file.name}`;
|
|
@@ -141,7 +140,7 @@ export class Android {
|
|
|
141
140
|
}
|
|
142
141
|
|
|
143
142
|
async reboot() {
|
|
144
|
-
await this.
|
|
143
|
+
await this.device.reboot(this.id);
|
|
145
144
|
return delay(60_000);
|
|
146
145
|
}
|
|
147
146
|
|
|
@@ -155,24 +154,24 @@ export class Android {
|
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
async getMeta() {
|
|
158
|
-
const rawModel = await util.readAll(
|
|
157
|
+
const rawModel = await Adb.util.readAll(
|
|
159
158
|
await this._runCommand(`getprop ro.product.model`)
|
|
160
159
|
);
|
|
161
160
|
const model = rawModel.toString().trim();
|
|
162
|
-
const rawName = await util.readAll(
|
|
161
|
+
const rawName = await Adb.util.readAll(
|
|
163
162
|
await this._runCommand(`getprop ro.product.name`)
|
|
164
163
|
);
|
|
165
164
|
const name = rawName.toString().trim();
|
|
166
|
-
const rawDevice = await util.readAll(
|
|
165
|
+
const rawDevice = await Adb.util.readAll(
|
|
167
166
|
await this._runCommand(`getprop ro.product.device`)
|
|
168
167
|
);
|
|
169
168
|
const device = rawDevice.toString().trim();
|
|
170
|
-
const rawId = await util.readAll(
|
|
169
|
+
const rawId = await Adb.util.readAll(
|
|
171
170
|
await this._runCommand(`getprop ro.serialno`)
|
|
172
171
|
);
|
|
173
172
|
const id = rawId.toString().trim();
|
|
174
173
|
const wifi = await this.getWifi();
|
|
175
|
-
const rawRelease = await util.readAll(
|
|
174
|
+
const rawRelease = await Adb.util.readAll(
|
|
176
175
|
await this._runCommand(`getprop ro.build.version.release `)
|
|
177
176
|
);
|
|
178
177
|
const androidVersion = rawRelease.toString().trim();
|
|
@@ -187,8 +186,7 @@ export class Android {
|
|
|
187
186
|
}
|
|
188
187
|
|
|
189
188
|
async addDevtoolsFw() {
|
|
190
|
-
return this.
|
|
191
|
-
this.id,
|
|
189
|
+
return this.device.forward(
|
|
192
190
|
'tcp:' + this.port,
|
|
193
191
|
'localabstract:chrome_devtools_remote'
|
|
194
192
|
);
|
|
@@ -236,13 +234,13 @@ export class Android {
|
|
|
236
234
|
}
|
|
237
235
|
|
|
238
236
|
async getWifi() {
|
|
239
|
-
const rawWifiInfo = await util.readAll(
|
|
237
|
+
const rawWifiInfo = await Adb.util.readAll(
|
|
240
238
|
await this._runCommand(
|
|
241
239
|
`dumpsys netstats | grep -E 'iface=wlan.*networkId'`
|
|
242
240
|
)
|
|
243
241
|
);
|
|
244
242
|
const wifiInfo = rawWifiInfo.toString().trim();
|
|
245
|
-
const wifi = wifiInfo.match(/"[^"]*"|^[^"]*$/)[0].
|
|
243
|
+
const wifi = wifiInfo.match(/"[^"]*"|^[^"]*$/)[0].replaceAll('"', '');
|
|
246
244
|
return wifi;
|
|
247
245
|
}
|
|
248
246
|
|
|
@@ -299,7 +297,7 @@ export class Android {
|
|
|
299
297
|
const cmd1 = `pidof ${packageName}`;
|
|
300
298
|
log.debug(`pidof ${cmd1}`);
|
|
301
299
|
const proc1 = await this._runCommand(cmd1);
|
|
302
|
-
const ps1 = await util.readAll(proc1);
|
|
300
|
+
const ps1 = await Adb.util.readAll(proc1);
|
|
303
301
|
const ps = ps1.toString();
|
|
304
302
|
log.debug(`pidof ${ps}`);
|
|
305
303
|
|
|
@@ -328,7 +326,7 @@ export class Android {
|
|
|
328
326
|
const cmd = `ps`;
|
|
329
327
|
log.debug(`pidof ${cmd}`);
|
|
330
328
|
const proc = await this._runCommand(cmd);
|
|
331
|
-
const psTemporary = await util.readAll(proc);
|
|
329
|
+
const psTemporary = await Adb.util.readAll(proc);
|
|
332
330
|
const ps = psTemporary.toString();
|
|
333
331
|
log.debug(`pidof ${ps}`);
|
|
334
332
|
|
|
@@ -382,7 +380,9 @@ export class Android {
|
|
|
382
380
|
// `cut` and `awk`, to make this more robust.
|
|
383
381
|
const cut = `echo $EPOCHREALTIME && cut -d ' ' -f 1 /proc/uptime && cut -d ' ' -f 22 /proc/self/stat /proc/${pid}/stat`;
|
|
384
382
|
// const awk = `date +%s%3N && awk '{print $1}' /proc/uptime && awk '{print $22}' /proc/self/stat /proc/${pid}/stat`;
|
|
385
|
-
const statAndTimestamp = await util.readAll(
|
|
383
|
+
const statAndTimestamp = await Adb.util.readAll(
|
|
384
|
+
await this._runCommand(cut)
|
|
385
|
+
);
|
|
386
386
|
const output = statAndTimestamp.toString();
|
|
387
387
|
|
|
388
388
|
const [
|
|
@@ -129,7 +129,7 @@ export class Click {
|
|
|
129
129
|
async byXpath(xpath) {
|
|
130
130
|
try {
|
|
131
131
|
// This is how Selenium do internally
|
|
132
|
-
const replaced = xpath.
|
|
132
|
+
const replaced = xpath.replaceAll('"', "'");
|
|
133
133
|
const script = `document.evaluate("${replaced}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();`;
|
|
134
134
|
return this.browser.runScript(script, 'CUSTOM');
|
|
135
135
|
} catch (error) {
|
|
@@ -148,7 +148,7 @@ export class Click {
|
|
|
148
148
|
async byXpathAndWait(xpath) {
|
|
149
149
|
try {
|
|
150
150
|
// This is how Selenium do internally
|
|
151
|
-
const replaced = xpath.
|
|
151
|
+
const replaced = xpath.replaceAll('"', "'");
|
|
152
152
|
const script = `document.evaluate("${replaced}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();`;
|
|
153
153
|
await this.browser.runScript(script, 'CUSTOM');
|
|
154
154
|
return this.browser.extraWait(this.pageCompleteCheck);
|
|
@@ -114,10 +114,10 @@ export class Measure {
|
|
|
114
114
|
// If we have tested pages before, but not in the making of
|
|
115
115
|
// measuring a page, associate the error with that latest page.
|
|
116
116
|
if (this.result.length > 0) {
|
|
117
|
-
if (this.result
|
|
118
|
-
this.result
|
|
117
|
+
if (this.result.at(-1).error === undefined) {
|
|
118
|
+
this.result.at(-1).error = [message];
|
|
119
119
|
} else {
|
|
120
|
-
this.result
|
|
120
|
+
this.result.at(-1).error.push(message);
|
|
121
121
|
}
|
|
122
122
|
} else {
|
|
123
123
|
// error not associated to a start/run so far
|
|
@@ -6,7 +6,7 @@ const log = intel.getLogger('browsertime');
|
|
|
6
6
|
|
|
7
7
|
function toSafeKey(key) {
|
|
8
8
|
// U+2013 : EN DASH – as used on https://en.wikipedia.org/wiki/2019–20_coronavirus_pandemic
|
|
9
|
-
return key.
|
|
9
|
+
return key.replaceAll(/[ %&()+,./:?|~–]|%7C/g, '-');
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export function pathToFolder(url, options) {
|
|
@@ -59,7 +59,7 @@ export function pathToFolder(url, options) {
|
|
|
59
59
|
|
|
60
60
|
for (const [index, segment] of pathSegments.entries()) {
|
|
61
61
|
if (segment) {
|
|
62
|
-
pathSegments[index] = segment.
|
|
62
|
+
pathSegments[index] = segment.replaceAll(/[^\w.\u0621-\u064A-]/gi, '-');
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -23,7 +23,7 @@ const mkdir = promisify(_mkdir);
|
|
|
23
23
|
const log = intel.getLogger('browsertime');
|
|
24
24
|
|
|
25
25
|
const defaultDir = 'browsertime-results';
|
|
26
|
-
let timestamp = dayjs().format().
|
|
26
|
+
let timestamp = dayjs().format().replaceAll(':', '');
|
|
27
27
|
|
|
28
28
|
function pathNameFromUrl(url) {
|
|
29
29
|
const parsedUrl = parse(url),
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browsertime",
|
|
3
3
|
"description": "Get performance metrics from your web page using Browsertime.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "18.0.0",
|
|
5
5
|
"bin": "./bin/browsertime.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@cypress/xvfb": "1.2.4",
|
|
9
|
-
"@devicefarmer/adbkit": "2.
|
|
10
|
-
"@sitespeed.io/chromedriver": "119.0.6045-
|
|
11
|
-
"@sitespeed.io/edgedriver": "
|
|
9
|
+
"@devicefarmer/adbkit": "3.2.5",
|
|
10
|
+
"@sitespeed.io/chromedriver": "119.0.6045-105",
|
|
11
|
+
"@sitespeed.io/edgedriver": "119.0.2151-42",
|
|
12
12
|
"@sitespeed.io/geckodriver": "0.33.0",
|
|
13
13
|
"@sitespeed.io/throttle": "5.0.0",
|
|
14
14
|
"@sitespeed.io/tracium": "0.3.3",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"btoa": "1.2.1",
|
|
17
17
|
"chrome-har": "0.13.2",
|
|
18
18
|
"chrome-remote-interface": "0.33.0",
|
|
19
|
-
"dayjs": "1.11.
|
|
20
|
-
"execa": "
|
|
19
|
+
"dayjs": "1.11.10",
|
|
20
|
+
"execa": "8.0.1",
|
|
21
21
|
"fast-stats": "0.0.6",
|
|
22
22
|
"find-up": "6.3.0",
|
|
23
|
-
"get-port": "
|
|
23
|
+
"get-port": "7.0.0",
|
|
24
24
|
"hasbin": "1.2.3",
|
|
25
25
|
"intel": "1.2.0",
|
|
26
26
|
"lodash.get": "4.4.2",
|
|
@@ -29,21 +29,21 @@
|
|
|
29
29
|
"lodash.merge": "4.6.2",
|
|
30
30
|
"lodash.pick": "4.4.0",
|
|
31
31
|
"lodash.set": "4.3.2",
|
|
32
|
-
"selenium-webdriver": "4.
|
|
32
|
+
"selenium-webdriver": "4.15.0",
|
|
33
33
|
"yargs": "17.7.2"
|
|
34
34
|
},
|
|
35
35
|
"optionalDependencies": {
|
|
36
36
|
"jimp": "0.22.10"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"ava": "5.1
|
|
40
|
-
"eslint": "8.
|
|
41
|
-
"eslint-config-prettier": "
|
|
42
|
-
"eslint-plugin-prettier": "
|
|
43
|
-
"eslint-plugin-unicorn": "
|
|
44
|
-
"prettier": "
|
|
39
|
+
"ava": "5.3.1",
|
|
40
|
+
"eslint": "8.53.0",
|
|
41
|
+
"eslint-config-prettier": "9.0.0",
|
|
42
|
+
"eslint-plugin-prettier": "5.0.1",
|
|
43
|
+
"eslint-plugin-unicorn": "49.0.0",
|
|
44
|
+
"prettier": "3.0.3",
|
|
45
45
|
"serve-handler": "6.1.5",
|
|
46
|
-
"serve": "14.1
|
|
46
|
+
"serve": "14.2.1"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=14.19.1"
|