@applitools/spec-driver-puppeteer 1.4.29 → 1.5.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 +38 -0
- package/dist/spec-driver.js +29 -2
- package/package.json +4 -4
- package/types/index.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.5.0](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-puppeteer@1.4.30...js/spec-driver-puppeteer@1.5.0) (2025-07-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* canvas webgl without preserveDrawingBuffer=1 | FLD-3144 ([#3040](https://github.com/Applitools-Dev/sdk/issues/3040)) ([f82d8f1](https://github.com/Applitools-Dev/sdk/commit/f82d8f148f913098752ec7bef8635a46b453d6fa))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* @applitools/utils bumped to 1.9.0
|
|
14
|
+
#### Features
|
|
15
|
+
|
|
16
|
+
* support https_proxy and http_proxy env variables | FLD-2702 ([#3046](https://github.com/Applitools-Dev/sdk/issues/3046)) ([0633809](https://github.com/Applitools-Dev/sdk/commit/06338099f44bfb149a5829f62c2f9b19e2392850))
|
|
17
|
+
* @applitools/logger bumped to 2.1.5
|
|
18
|
+
|
|
19
|
+
* @applitools/driver bumped to 1.22.0
|
|
20
|
+
#### Features
|
|
21
|
+
|
|
22
|
+
* canvas webgl without preserveDrawingBuffer=1 | FLD-3144 ([#3040](https://github.com/Applitools-Dev/sdk/issues/3040)) ([f82d8f1](https://github.com/Applitools-Dev/sdk/commit/f82d8f148f913098752ec7bef8635a46b453d6fa))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## [1.4.30](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-puppeteer@1.4.29...js/spec-driver-puppeteer@1.4.30) (2025-05-11)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Dependencies
|
|
31
|
+
|
|
32
|
+
* @applitools/utils bumped to 1.8.2
|
|
33
|
+
#### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* remove redundant file readings and added rendering concurrency limit ([#2956](https://github.com/Applitools-Dev/sdk/issues/2956)) ([b970180](https://github.com/Applitools-Dev/sdk/commit/b97018010fdf12cb0d202192b22f643c16c569d5))
|
|
36
|
+
* @applitools/logger bumped to 2.1.4
|
|
37
|
+
|
|
38
|
+
* @applitools/driver bumped to 1.21.4
|
|
39
|
+
|
|
40
|
+
|
|
3
41
|
## [1.4.29](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-puppeteer@1.4.28...js/spec-driver-puppeteer@1.4.29) (2025-05-07)
|
|
4
42
|
|
|
5
43
|
|
package/dist/spec-driver.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.build = exports.takeScreenshot = exports.visit = exports.getUrl = exports.getTitle = exports.getCookies = exports.setViewportSize = exports.getViewportSize = exports.getDriverInfo = exports.childContext = exports.parentContext = exports.mainContext = exports.click = exports.hover = exports.setElementText = exports.findElements = exports.findElement = exports.executeScript = exports.extractContext = exports.toSimpleCommonSelector = exports.toSelector = exports.isStaleElementError = exports.isSelector = exports.isElement = exports.isContext = exports.isDriver = void 0;
|
|
26
|
+
exports.build = exports.takeScreenshot = exports.visit = exports.getUrl = exports.getTitle = exports.getCookies = exports.setViewportSize = exports.getViewportSize = exports.getDriverInfo = exports.childContext = exports.parentContext = exports.mainContext = exports.click = exports.hover = exports.setElementText = exports.findElements = exports.findElement = exports.executeBrowserCommands = exports.executeScript = exports.extractContext = exports.toSimpleCommonSelector = exports.toSelector = exports.isStaleElementError = exports.isSelector = exports.isElement = exports.isContext = exports.isDriver = void 0;
|
|
27
27
|
const utils = __importStar(require("@applitools/utils"));
|
|
28
28
|
async function handleToObject(handle) {
|
|
29
29
|
const [, type] = handle.toString().split('@');
|
|
@@ -173,6 +173,33 @@ async function executeScript(frame, script, arg) {
|
|
|
173
173
|
return handleToObject(result);
|
|
174
174
|
}
|
|
175
175
|
exports.executeScript = executeScript;
|
|
176
|
+
async function executeBrowserCommands(page, commands, logger) {
|
|
177
|
+
let lastResponse;
|
|
178
|
+
let native = true;
|
|
179
|
+
for (const currentCommand of commands) {
|
|
180
|
+
switch (currentCommand.command) {
|
|
181
|
+
case 'Page.addScriptToEvaluateOnNewDocument':
|
|
182
|
+
if (currentCommand.params) {
|
|
183
|
+
lastResponse = await page.evaluateOnNewDocument(currentCommand.params.source);
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
default: {
|
|
187
|
+
native = false;
|
|
188
|
+
const userAgent = await (await page.browser().userAgent()).toLowerCase();
|
|
189
|
+
if (userAgent.includes('chrome') || userAgent.includes('chromium')) {
|
|
190
|
+
const cdpSession = await page.target().createCDPSession();
|
|
191
|
+
lastResponse = await cdpSession.send(currentCommand.command, currentCommand.params);
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
logger === null || logger === void 0 ? void 0 : logger.info('executeBrowserCommands not supported');
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
logger === null || logger === void 0 ? void 0 : logger.debug(`executeBrowserCommands native:${native} command:${currentCommand.command} ${JSON.stringify(currentCommand.params)} => ${JSON.stringify(lastResponse)}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
exports.executeBrowserCommands = executeBrowserCommands;
|
|
176
203
|
async function findElement(frame, selector, parent) {
|
|
177
204
|
const root = parent !== null && parent !== void 0 ? parent : frame;
|
|
178
205
|
if (isXpathSelector(selector)) {
|
|
@@ -297,7 +324,7 @@ async function build(env) {
|
|
|
297
324
|
else {
|
|
298
325
|
const options = {
|
|
299
326
|
headless,
|
|
300
|
-
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage',
|
|
327
|
+
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage', ...args],
|
|
301
328
|
ignoreDefaultArgs: ['--hide-scrollbars'],
|
|
302
329
|
product: browser,
|
|
303
330
|
protocol: 'cdp',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/spec-driver-puppeteer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"puppeteer",
|
|
6
6
|
"chrome devtools protocol",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"up:framework": "echo \"$(jq '.devDependencies.puppeteer = $ENV.APPLITOOLS_FRAMEWORK_VERSION' ./package.json)\" > ./package.json"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@applitools/driver": "1.
|
|
45
|
-
"@applitools/utils": "1.
|
|
44
|
+
"@applitools/driver": "1.22.0",
|
|
45
|
+
"@applitools/utils": "1.9.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@applitools/api-extractor": "^1.2.22",
|
|
49
49
|
"@applitools/test-utils": "^1.5.17",
|
|
50
50
|
"@types/node": "^12.20.55",
|
|
51
|
-
"puppeteer": "^
|
|
51
|
+
"puppeteer": "^24.11.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"puppeteer": ">=5.3.0"
|
package/types/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export function toSelector(selector: import('@applitools/driver').CommonSelector
|
|
|
9
9
|
export function toSimpleCommonSelector(selector: Selector): import('@applitools/driver').CommonSelector;
|
|
10
10
|
export function extractContext(page: Driver): Context;
|
|
11
11
|
export function executeScript(frame: Context, script: string | ((arg: any) => any), arg: any): Promise<any>;
|
|
12
|
+
export function executeBrowserCommands(page: Driver, commands: Array<import('@applitools/driver').BrowserCommand>, logger?: any): Promise<any>;
|
|
12
13
|
export function findElement(frame: Context, selector: Selector, parent?: undefined | Element<globalThis.Element>): Promise<null | Element<globalThis.Element>>;
|
|
13
14
|
export function findElements(frame: Context, selector: Selector, parent?: undefined | Element<globalThis.Element>): Promise<Array<Element<globalThis.Element>>>;
|
|
14
15
|
export function setElementText(_frame: Context, element: Element<globalThis.Element>, text: string): Promise<void>;
|