browsertime 22.0.0 → 22.2.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 +17 -0
- package/lib/chrome/webdriver/setupChromiumOptions.js +1 -0
- package/lib/core/engine/command/addText.js +30 -5
- package/lib/core/engine/command/mouse/singleClick.js +40 -1
- package/lib/core/engine/command/wait.js +25 -1
- package/package.json +4 -4
- package/types/core/engine/command/addText.d.ts.map +1 -1
- package/types/core/engine/command/mouse/singleClick.d.ts +19 -1
- package/types/core/engine/command/mouse/singleClick.d.ts.map +1 -1
- package/types/core/engine/command/wait.d.ts +11 -1
- package/types/core/engine/command/wait.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Browsertime changelog (we do [semantic versioning](https://semver.org))
|
|
2
2
|
|
|
3
|
+
## 22.2.0 - 2024-05-24
|
|
4
|
+
### Added
|
|
5
|
+
* New command: Mouse single click on a element with a specific id `commands.mouse.singleClick.byId(id)` and `commands.mouse.singleClick.byIdAndWait(id)` [#2135](https://github.com/sitespeedio/browsertime/pull/2135).
|
|
6
|
+
* New command: `commands.wait.byIdAndVisible(id, maxTime)` - wait for an element with id to become visible [#2137](https://github.com/sitespeedio/browsertime/pull/2137).
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
* Make sure errors are correctly logged if you cannot add text to element [#2136](https://github.com/sitespeedio/browsertime/pull/2136).
|
|
10
|
+
|
|
11
|
+
## 22.1.0 - 2024-05-20
|
|
12
|
+
### Added
|
|
13
|
+
* Updated to Edge and Edgedriver 125 [#2132](https://github.com/sitespeedio/browsertime/pull/2132).
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
* Updated to Selenium Webdriver 4.21.0 [#2131](https://github.com/sitespeedio/browsertime/pull/2131).
|
|
17
|
+
* Trying to remove new Chrome popup [#2130](https://github.com/sitespeedio/browsertime/pull/2130).
|
|
18
|
+
|
|
19
|
+
|
|
3
20
|
## 22.0.0 - 2024-05-16
|
|
4
21
|
|
|
5
22
|
### Breaking
|
|
@@ -33,7 +33,12 @@ export class AddText {
|
|
|
33
33
|
await element.clear();
|
|
34
34
|
return element.sendKeys(text);
|
|
35
35
|
} catch (error) {
|
|
36
|
-
log.error(
|
|
36
|
+
log.error(
|
|
37
|
+
'Could not add text %s to id %s error:%s',
|
|
38
|
+
text,
|
|
39
|
+
id,
|
|
40
|
+
error.message
|
|
41
|
+
);
|
|
37
42
|
log.verbose(error);
|
|
38
43
|
throw new Error(`Could not add text ${text} to id ${id}`);
|
|
39
44
|
}
|
|
@@ -57,7 +62,12 @@ export class AddText {
|
|
|
57
62
|
await element.clear();
|
|
58
63
|
return element.sendKeys(text);
|
|
59
64
|
} catch (error) {
|
|
60
|
-
log.error(
|
|
65
|
+
log.error(
|
|
66
|
+
'Could not add text %s to xpath %s error: %s',
|
|
67
|
+
text,
|
|
68
|
+
xpath,
|
|
69
|
+
error.message
|
|
70
|
+
);
|
|
61
71
|
log.verbose(error);
|
|
62
72
|
throw new Error(`Could not add text ${text} to xpath ${xpath}`);
|
|
63
73
|
}
|
|
@@ -81,7 +91,12 @@ export class AddText {
|
|
|
81
91
|
await element.clear();
|
|
82
92
|
return element.sendKeys(text);
|
|
83
93
|
} catch (error) {
|
|
84
|
-
log.error(
|
|
94
|
+
log.error(
|
|
95
|
+
'Could not add text %s to selector %s error: %s',
|
|
96
|
+
text,
|
|
97
|
+
selector,
|
|
98
|
+
error.message
|
|
99
|
+
);
|
|
85
100
|
log.verbose(error);
|
|
86
101
|
throw new Error(`Could not add text ${text} to selector ${selector}`);
|
|
87
102
|
}
|
|
@@ -105,7 +120,12 @@ export class AddText {
|
|
|
105
120
|
await element.clear();
|
|
106
121
|
return element.sendKeys(text);
|
|
107
122
|
} catch (error) {
|
|
108
|
-
log.error(
|
|
123
|
+
log.error(
|
|
124
|
+
'Could not add text %s to class name %s error: %s',
|
|
125
|
+
text,
|
|
126
|
+
className,
|
|
127
|
+
error.message
|
|
128
|
+
);
|
|
109
129
|
log.verbose(error);
|
|
110
130
|
throw new Error(`Could not add text ${text} to class name ${className}`);
|
|
111
131
|
}
|
|
@@ -129,7 +149,12 @@ export class AddText {
|
|
|
129
149
|
await element.clear();
|
|
130
150
|
return element.sendKeys(text);
|
|
131
151
|
} catch (error) {
|
|
132
|
-
log.error(
|
|
152
|
+
log.error(
|
|
153
|
+
'Could not add text %s to name attribute %s error: %s',
|
|
154
|
+
text,
|
|
155
|
+
name,
|
|
156
|
+
error.message
|
|
157
|
+
);
|
|
133
158
|
log.verbose(error);
|
|
134
159
|
throw new Error(`Could not add text ${text} to name attribute ${name}`);
|
|
135
160
|
}
|
|
@@ -230,7 +230,7 @@ export class SingleClick {
|
|
|
230
230
|
|
|
231
231
|
/**
|
|
232
232
|
* Clicks on a link whose visible text contains the given substring and waits on the
|
|
233
|
-
* page complete
|
|
233
|
+
* page complete check.
|
|
234
234
|
*
|
|
235
235
|
* @async
|
|
236
236
|
* @param {string} text - The substring of the visible text of the link to click.
|
|
@@ -247,4 +247,43 @@ export class SingleClick {
|
|
|
247
247
|
throw new Error('Could not find link by partial text ' + text);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Clicks on a element with a specific id.
|
|
253
|
+
*
|
|
254
|
+
* @async
|
|
255
|
+
* @param {string} id - The id of the link to click.
|
|
256
|
+
* @returns {Promise<void>} A promise that resolves when the click action is performed.
|
|
257
|
+
* @throws {Error} Throws an error if the id is not found.
|
|
258
|
+
*/
|
|
259
|
+
async byId(id) {
|
|
260
|
+
try {
|
|
261
|
+
const element = await this.browser.getDriver().findElement(By.id(id));
|
|
262
|
+
return this.actions.click(element).perform();
|
|
263
|
+
} catch (error) {
|
|
264
|
+
log.error('Could not find the element with id %s', id);
|
|
265
|
+
log.verbose(error);
|
|
266
|
+
throw new Error('Could not the element with id ' + id);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Clicks on a element with a specific id and wait on the page complete check
|
|
272
|
+
*
|
|
273
|
+
* @async
|
|
274
|
+
* @param {string} id - The id of the link to click.
|
|
275
|
+
* @returns {Promise<void>} A promise that resolves when the page has completed.
|
|
276
|
+
* @throws {Error} Throws an error if the id is not found.
|
|
277
|
+
*/
|
|
278
|
+
async byIdAndWait(id) {
|
|
279
|
+
try {
|
|
280
|
+
const element = await this.browser.getDriver().findElement(By.id(id));
|
|
281
|
+
await this.actions.click(element).perform();
|
|
282
|
+
return this.browser.extraWait(this.pageCompleteCheck);
|
|
283
|
+
} catch (error) {
|
|
284
|
+
log.error('Could not find the element with id %s', id);
|
|
285
|
+
log.verbose(error);
|
|
286
|
+
throw new Error('Could not the element with id ' + id);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
250
289
|
}
|
|
@@ -22,7 +22,7 @@ export class Wait {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* Waits for an element with a specific ID to
|
|
25
|
+
* Waits for an element with a specific ID to be located within a maximum time.
|
|
26
26
|
*
|
|
27
27
|
* @async
|
|
28
28
|
* @param {string} id - The ID of the element to wait for.
|
|
@@ -46,6 +46,30 @@ export class Wait {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Waits for an element with a specific ID to be located and visible within a maximum time.
|
|
51
|
+
*
|
|
52
|
+
* @async
|
|
53
|
+
* @param {string} id - The ID of the element to wait for.
|
|
54
|
+
* @param {number} maxTime - Maximum time to wait in milliseconds.
|
|
55
|
+
* @returns {Promise<void>} A promise that resolves when the element is found or the time times out.
|
|
56
|
+
* @throws {Error} Throws an error if the element is not found within the specified time.
|
|
57
|
+
*/
|
|
58
|
+
async byIdAndVisible(id, maxTime) {
|
|
59
|
+
const driver = this.browser.getDriver();
|
|
60
|
+
await this.byId(id, maxTime);
|
|
61
|
+
try {
|
|
62
|
+
await driver.wait(
|
|
63
|
+
webdriver.until.elementIsVisible(webdriver.By.id(id)),
|
|
64
|
+
maxTime
|
|
65
|
+
);
|
|
66
|
+
} catch (error) {
|
|
67
|
+
log.error('Element by id %s was not visible in %s ms', id, maxTime);
|
|
68
|
+
log.verbose(error);
|
|
69
|
+
throw new Error(`Element by id ${id} was not located in ${maxTime} ms`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
49
73
|
/**
|
|
50
74
|
* Waits for an element located by XPath to appear within a maximum time.
|
|
51
75
|
*
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browsertime",
|
|
3
3
|
"description": "Get performance metrics from your web page using Browsertime.",
|
|
4
|
-
"version": "22.
|
|
4
|
+
"version": "22.2.0",
|
|
5
5
|
"bin": "./bin/browsertime.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./types/scripting.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@cypress/xvfb": "1.2.4",
|
|
10
10
|
"@devicefarmer/adbkit": "3.2.6",
|
|
11
|
-
"@sitespeed.io/chromedriver": "
|
|
12
|
-
"@sitespeed.io/edgedriver": "
|
|
11
|
+
"@sitespeed.io/chromedriver": "125.0.6422-60",
|
|
12
|
+
"@sitespeed.io/edgedriver": "125.0.2535-47",
|
|
13
13
|
"@sitespeed.io/geckodriver": "0.34.0",
|
|
14
14
|
"@sitespeed.io/throttle": "5.0.0",
|
|
15
15
|
"@sitespeed.io/tracium": "0.3.3",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lodash.merge": "4.6.2",
|
|
31
31
|
"lodash.pick": "4.4.0",
|
|
32
32
|
"lodash.set": "4.3.2",
|
|
33
|
-
"selenium-webdriver": "4.
|
|
33
|
+
"selenium-webdriver": "4.21.0",
|
|
34
34
|
"yargs": "17.7.2"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addText.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/addText.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IACE,0BAKC;IAJC;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;;;OASG;IACH,WALW,MAAM,MACN,MAAM,GACJ,QAAQ,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"addText.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/addText.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IACE,0BAKC;IAJC;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;;;OASG;IACH,WALW,MAAM,MACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAoBzB;IAED;;;;;;;;;OASG;IACH,cALW,MAAM,SACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAoBzB;IAED;;;;;;;;;OASG;IACH,iBALW,MAAM,YACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAoBzB;IAED;;;;;;;;;OASG;IACH,kBALW,MAAM,aACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAoBzB;IAED;;;;;;;;;OASG;IACH,aALW,MAAM,QACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAoBzB;CACF"}
|
|
@@ -103,7 +103,7 @@ export class SingleClick {
|
|
|
103
103
|
byPartialLinkText(text: string): Promise<void>;
|
|
104
104
|
/**
|
|
105
105
|
* Clicks on a link whose visible text contains the given substring and waits on the
|
|
106
|
-
* page complete
|
|
106
|
+
* page complete check.
|
|
107
107
|
*
|
|
108
108
|
* @async
|
|
109
109
|
* @param {string} text - The substring of the visible text of the link to click.
|
|
@@ -111,5 +111,23 @@ export class SingleClick {
|
|
|
111
111
|
* @throws {Error} Throws an error if the link is not found.
|
|
112
112
|
*/
|
|
113
113
|
byPartialLinkTextAndWait(text: string): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Clicks on a element with a specific id.
|
|
116
|
+
*
|
|
117
|
+
* @async
|
|
118
|
+
* @param {string} id - The id of the link to click.
|
|
119
|
+
* @returns {Promise<void>} A promise that resolves when the click action is performed.
|
|
120
|
+
* @throws {Error} Throws an error if the id is not found.
|
|
121
|
+
*/
|
|
122
|
+
byId(id: string): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Clicks on a element with a specific id and wait on the page complete check
|
|
125
|
+
*
|
|
126
|
+
* @async
|
|
127
|
+
* @param {string} id - The id of the link to click.
|
|
128
|
+
* @returns {Promise<void>} A promise that resolves when the page has completed.
|
|
129
|
+
* @throws {Error} Throws an error if the id is not found.
|
|
130
|
+
*/
|
|
131
|
+
byIdAndWait(id: string): Promise<void>;
|
|
114
132
|
}
|
|
115
133
|
//# sourceMappingURL=singleClick.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/singleClick.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH;IACE,kDAaC;IAZC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAgE;IAChE;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;;OAQG;IACH,eALW,MAAM,kBAEJ,QAAQ,IAAI,CAAC,CAoBzB;IAED;;;;;;;OAOG;IACH,sBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;;OAQG;IACH,qBALW,MAAM,kBAEJ,QAAQ,IAAI,CAAC,CAsBzB;IAED;;;;;;;OAOG;IACH,4BAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAiBzB;IAED;;;;;;;OAOG;IACH,yBAHa,QAAQ,IAAI,CAAC,CAiBzB;IAED;;;;;;;OAOG;IACH,mBAHa,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,iBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,wBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,wBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,+BAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;CACF"}
|
|
1
|
+
{"version":3,"file":"singleClick.d.ts","sourceRoot":"","sources":["../../../../../lib/core/engine/command/mouse/singleClick.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH;IACE,kDAaC;IAZC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAgE;IAChE;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;;OAQG;IACH,eALW,MAAM,kBAEJ,QAAQ,IAAI,CAAC,CAoBzB;IAED;;;;;;;OAOG;IACH,sBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;;OAQG;IACH,qBALW,MAAM,kBAEJ,QAAQ,IAAI,CAAC,CAsBzB;IAED;;;;;;;OAOG;IACH,4BAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAiBzB;IAED;;;;;;;OAOG;IACH,yBAHa,QAAQ,IAAI,CAAC,CAiBzB;IAED;;;;;;;OAOG;IACH,mBAHa,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,iBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,wBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,wBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,+BAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,SAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;OAOG;IACH,gBAJW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAazB;CACF"}
|
|
@@ -15,7 +15,7 @@ export class Wait {
|
|
|
15
15
|
*/
|
|
16
16
|
private pageCompleteCheck;
|
|
17
17
|
/**
|
|
18
|
-
* Waits for an element with a specific ID to
|
|
18
|
+
* Waits for an element with a specific ID to be located within a maximum time.
|
|
19
19
|
*
|
|
20
20
|
* @async
|
|
21
21
|
* @param {string} id - The ID of the element to wait for.
|
|
@@ -24,6 +24,16 @@ export class Wait {
|
|
|
24
24
|
* @throws {Error} Throws an error if the element is not found within the specified time.
|
|
25
25
|
*/
|
|
26
26
|
byId(id: string, maxTime: number): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Waits for an element with a specific ID to be located and visible within a maximum time.
|
|
29
|
+
*
|
|
30
|
+
* @async
|
|
31
|
+
* @param {string} id - The ID of the element to wait for.
|
|
32
|
+
* @param {number} maxTime - Maximum time to wait in milliseconds.
|
|
33
|
+
* @returns {Promise<void>} A promise that resolves when the element is found or the time times out.
|
|
34
|
+
* @throws {Error} Throws an error if the element is not found within the specified time.
|
|
35
|
+
*/
|
|
36
|
+
byIdAndVisible(id: string, maxTime: number): Promise<void>;
|
|
27
37
|
/**
|
|
28
38
|
* Waits for an element located by XPath to appear within a maximum time.
|
|
29
39
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/wait.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH;IACE,kDASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;;OAQG;IACH,SALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAiBzB;IAED;;;;;;;;OAQG;IACH,eALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAmBzB;IAED;;;;;;;;OAQG;IACH,qBALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAuBzB;IAED;;;;;;;OAOG;IACH,WAHW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAIzB;IAED;;;;;OAKG;IACH,oBAFa,QAAQ,IAAI,CAAC,CAIzB;IAED;;;;;;;;OAQG;IACH,0BALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAiBzB;CACF"}
|
|
1
|
+
{"version":3,"file":"wait.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/wait.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH;IACE,kDASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;;OAQG;IACH,SALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAiBzB;IAED;;;;;;;;OAQG;IACH,mBALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAgBzB;IAED;;;;;;;;OAQG;IACH,eALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAmBzB;IAED;;;;;;;;OAQG;IACH,qBALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAuBzB;IAED;;;;;;;OAOG;IACH,WAHW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAIzB;IAED;;;;;OAKG;IACH,oBAFa,QAAQ,IAAI,CAAC,CAIzB;IAED;;;;;;;;OAQG;IACH,0BALW,MAAM,WACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CAiBzB;CACF"}
|