From 7d8ae5f7ad32f6513951f7a9a39bac6bdea9b8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Thu, 6 Jun 2019 01:13:57 +0200 Subject: [PATCH 1/5] version update --- CHANGELOG.md | 3 +++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22bc9ce5..a8ab4612 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +2.1.3/ ####-##-## +================= + 2.1.2 / 2018-06-06 ================== diff --git a/package-lock.json b/package-lock.json index 5ac18314..14ab07e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "wendigo", - "version": "2.1.2", + "version": "2.1.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5bdeec92..57cd7b70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wendigo", - "version": "2.1.2", + "version": "2.1.3", "description": "A proper monster for front-end automated testing", "engines": { "node": ">=8.0.0" From b1195163c3d53f9d7abe3675b9c7cb9db3b2881d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Thu, 13 Jun 2019 11:19:39 +0200 Subject: [PATCH 2/5] minor dependencies updated --- package-lock.json | 62 ++++++++++++++++++++++++++++------------------- package.json | 4 +-- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 14ab07e9..11c4da92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,9 +31,9 @@ "dev": true }, "@types/node": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.5.tgz", - "integrity": "sha512-CFLSALoE+93+Hcb5pFjp0J1uMrrbLRe+L1+gFwerJ776R3TACSF0kTVRQ7AvRa7aFx70nqYHAc7wQPlt9kY2Mg==" + "version": "12.0.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.8.tgz", + "integrity": "sha512-b8bbUOTwzIY3V5vDTY1fIJ+ePKDUBqt2hC2woVGotdQQhG/2Sh62HOKHrT7ab+VerXAcPyAiTEipPu/FsreUtg==" }, "@types/puppeteer": { "version": "1.12.4", @@ -485,9 +485,9 @@ } }, "es6-promise": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", - "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==" + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" }, "es6-promisify": { "version": "5.0.0", @@ -1273,18 +1273,18 @@ } }, "markdownlint": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.14.2.tgz", - "integrity": "sha512-Lzw5u46jcIQW0RX8nfz6mOjg3VwoTi7KTubk+G7LgJMybV98h3tyVaMpsNRm3UomBosNOUKVe3XOjJs6WS6DdQ==", + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.15.0.tgz", + "integrity": "sha512-sNcrSrUgpNbTQX6rPIMd+RI9rAryGTEbDI9VFpcFyijlC5g8gpkma49k5p98yFLdNbdcB3VW69UJ0smxvTVw6g==", "dev": true, "requires": { "markdown-it": "8.4.2" } }, "markdownlint-cli": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.16.0.tgz", - "integrity": "sha512-BmtWhDvbsnbgYirYOiSOxP8THhkCjp28+xVfTyj3D1JsOlj0Txf3IA9wlT5GHCYaR6QfDlWq4pz/rh+bfOw2Vg==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.17.0.tgz", + "integrity": "sha512-/MInVAuNUDGj5lWeAweL2s4Wk0BY2UqOUcOuOMhY62LXmQZU9qZiFJ5XgHrAZVMggFH/vPupCiUiAMFgGIOqHg==", "dev": true, "requires": { "commander": "~2.9.0", @@ -1294,7 +1294,7 @@ "js-yaml": "^3.13.1", "lodash.differencewith": "~4.5.0", "lodash.flatten": "~4.4.0", - "markdownlint": "~0.14.1", + "markdownlint": "~0.15.0", "minimatch": "~3.0.4", "rc": "~1.2.7" } @@ -1343,9 +1343,9 @@ "dev": true }, "mime": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.3.tgz", - "integrity": "sha512-QgrPRJfE+riq5TPZMcHZOtm8c6K/yYrMbKIoRfapfiGLxS8OTeIfRhUGW5LU7MlRa52KOAGCfUNruqLrIBvWZw==" + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", + "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" }, "mime-db": { "version": "1.40.0", @@ -1443,6 +1443,12 @@ "path-is-absolute": "^1.0.0" } }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, "supports-color": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", @@ -1455,9 +1461,9 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "mute-stream": { "version": "0.0.7", @@ -1835,9 +1841,9 @@ "dev": true }, "resolve": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", - "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", + "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -1945,6 +1951,12 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true } } }, @@ -2132,9 +2144,9 @@ "dev": true }, "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", "dev": true }, "tslint": { diff --git a/package.json b/package.json index 57cd7b70..0206540e 100644 --- a/package.json +++ b/package.json @@ -47,10 +47,10 @@ }, "devDependencies": { "@types/mocha": "^5.2.7", - "@types/node": "^12.0.5", + "@types/node": "^12.0.8", "eslint": "^5.16.0", "express": "^4.17.1", - "markdownlint-cli": "^0.16.0", + "markdownlint-cli": "^0.17.0", "mocha": "^6.1.4", "tslint": "^5.17.0", "typescript": "^3.5.1" From 4d5ad1674fa3d8af38a46d6dd7ca8047c1a3a0a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Fri, 14 Jun 2019 15:48:15 +0200 Subject: [PATCH 3/5] puppeteer minimal interface #371 --- CHANGELOG.md | 2 + lib/browser/browser.ts | 4 +- lib/browser/browser_core.ts | 56 +++---- lib/browser/mixins/browser_actions.ts | 8 +- lib/browser/mixins/browser_click.ts | 2 +- lib/browser/mixins/browser_info.ts | 2 +- lib/browser/mixins/browser_navigation.ts | 10 +- lib/browser/mixins/browser_queries.ts | 8 +- lib/browser/mixins/browser_tap.ts | 2 +- lib/browser/mixins/browser_wait.ts | 4 +- .../puppeteer_wrapper/puppeteer_page.ts | 140 ++++++++++++++++++ .../puppeteer_wrapper/puppeteer_types.ts | 3 + lib/browser_factory.ts | 5 +- lib/modules/console/browser_console.ts | 8 +- lib/modules/cookies/browser_cookies.ts | 14 +- lib/modules/requests/browser_requests.ts | 8 +- lib/modules/webworkers/browser_webworker.ts | 2 +- lib/modules/wendigo_module.ts | 3 + lib/types.ts | 4 +- package-lock.json | 6 +- package.json | 2 +- 21 files changed, 226 insertions(+), 67 deletions(-) create mode 100644 lib/browser/puppeteer_wrapper/puppeteer_page.ts create mode 100644 lib/browser/puppeteer_wrapper/puppeteer_types.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index a8ab4612..df3e1410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ 2.1.3/ ####-##-## ================= +* Internal Puppeteer wrapper + 2.1.2 / 2018-06-06 ================== diff --git a/lib/browser/browser.ts b/lib/browser/browser.ts index 71e58a74..aed3723b 100644 --- a/lib/browser/browser.ts +++ b/lib/browser/browser.ts @@ -1,5 +1,5 @@ import BrowserTap from './mixins/browser_tap'; -import { Page } from 'puppeteer'; +import PuppeteerPage from './puppeteer_wrapper/puppeteer_page'; import { FinalBrowserSettings } from '../types'; // Modules @@ -18,7 +18,7 @@ export default class Browser extends BrowserTap { public readonly webworkers: BrowserWebworker; public readonly dialog: BrowserDialog; - constructor(page: Page, settings: FinalBrowserSettings, components: Array = []) { + constructor(page: PuppeteerPage, settings: FinalBrowserSettings, components: Array = []) { components = components.concat(["cookies", "localStorage", "requests", "console", "webworkers", "dialog"]); super(page, settings, components); this.cookies = new BrowserCookies(this); diff --git a/lib/browser/browser_core.ts b/lib/browser/browser_core.ts index 44d7fa2b..89ebb8a4 100644 --- a/lib/browser/browser_core.ts +++ b/lib/browser/browser_core.ts @@ -1,23 +1,27 @@ import path from 'path'; import querystring from 'querystring'; -import { ConsoleMessage, Page, Response, Viewport, Frame } from 'puppeteer'; +import { ConsoleMessage, Page, Response, Frame } from 'puppeteer'; import { stringifyLogText } from '../utils/puppeteer_utils'; import WendigoConfig from '../../config'; import DomElement from '../models/dom_element'; import { FatalError, InjectScriptError } from '../errors'; import { FinalBrowserSettings, OpenSettings } from '../types'; +import PuppeteerPage from './puppeteer_wrapper/puppeteer_page'; +import { ViewportOptions } from './puppeteer_wrapper/puppeteer_types'; const injectionScriptsPath = WendigoConfig.injectionScripts.path; const injectionScripts = WendigoConfig.injectionScripts.files; -async function pageLog(log: ConsoleMessage): Promise { - const text = await stringifyLogText(log); - let logType = log.type() as string; - if (logType === 'warning') logType = 'warn'; - const con = console as any; - if (!(con[logType])) logType = 'log'; - con[logType](text); +async function pageLog(log?: ConsoleMessage): Promise { + if (log) { + const text = await stringifyLogText(log); + let logType = log.type() as string; + if (logType === 'warning') logType = 'warn'; + const con = console as any; + if (!(con[logType])) logType = 'log'; + con[logType](text); + } } const defaultOpenOptions: OpenSettings = { @@ -29,9 +33,9 @@ const defaultOpenOptions: OpenSettings = { }; export default abstract class BrowserCore { - public page: Page; public initialResponse: Response | null; + protected _page: PuppeteerPage; protected originalHtml?: string; protected settings: FinalBrowserSettings; @@ -39,18 +43,18 @@ export default abstract class BrowserCore { private disabled: boolean; private components: Array; - constructor(page: Page, settings: FinalBrowserSettings, components: Array = []) { - this.page = page; + constructor(page: PuppeteerPage, settings: FinalBrowserSettings, components: Array = []) { + this._page = page; this.settings = settings; this._loaded = false; this.initialResponse = null; this.disabled = false; this.components = components; if (this.settings.log) { - this.page.on("console", pageLog); + this._page.on("console", pageLog); } - this.page.on('load', async (): Promise => { + this._page.on('load', async (): Promise => { if (this._loaded) { try { await this._afterPageLoad(); @@ -61,6 +65,9 @@ export default abstract class BrowserCore { }); } + public get page(): Page { + return this._page.page; + } public get loaded(): boolean { return this._loaded && !this.disabled; } @@ -79,7 +86,7 @@ export default abstract class BrowserCore { } try { await this._beforeOpen(options); - const response = await this.page.goto(url); + const response = await this._page.goto(url); this.initialResponse = response; return this._afterPageLoad(); } catch (err) { @@ -106,7 +113,7 @@ export default abstract class BrowserCore { this.originalHtml = undefined; try { await p; - await this.page.browser().close(); + await this._page.browser().close(); } catch (err) { return Promise.reject(new FatalError("close", `Failed to close browser. ${err.message}`)); } @@ -115,20 +122,19 @@ export default abstract class BrowserCore { public async evaluate(cb: (...args: Array) => any, ...args: Array): Promise { this._failIfNotLoaded("evaluate"); args = this._setupEvaluateArguments(args); - const rawResult = await this.page.evaluateHandle(cb, ...args); + const rawResult = await this._page.evaluateHandle(cb, ...args); const resultAsElement = rawResult.asElement(); if (resultAsElement) { return new DomElement(resultAsElement); } else return rawResult.jsonValue(); } - public setViewport(config = {}): Promise { - const finalConfig = Object.assign({}, this.page.viewport(), config) as Viewport; - return this.page.setViewport(finalConfig); + public setViewport(config: ViewportOptions = {}): Promise { + return this._page.setViewport(config); } public frames(): Array { - return this.page.frames(); + return this._page.frames(); } public async mockDate(date: Date, options = { freeze: true }): Promise { @@ -146,7 +152,7 @@ export default abstract class BrowserCore { public async addScript(scriptPath: string): Promise { this._failIfNotLoaded("addScript"); try { - await this.page.addScriptTag({ + await this._page.addScriptTag({ path: scriptPath }); } catch (err) { @@ -168,11 +174,11 @@ export default abstract class BrowserCore { protected async _beforeOpen(options: OpenSettings): Promise { if (this.settings.userAgent) { - await this.page.setUserAgent(this.settings.userAgent); + await this._page.setUserAgent(this.settings.userAgent); } if (this.settings.bypassCSP) { - await this.page.setBypassCSP(true); + await this._page.setBypassCSP(true); } await this.setViewport(options.viewport); await this._callComponentsMethod("_beforeOpen", options); @@ -180,7 +186,7 @@ export default abstract class BrowserCore { protected async _afterPageLoad(): Promise { try { - const content = await this.page.content(); + const content = await this._page.content(); this.originalHtml = content; await this._addJsScripts(); } catch (err) { @@ -192,7 +198,7 @@ export default abstract class BrowserCore { private async _addJsScripts(): Promise { const promises = injectionScripts.map((s) => { - return this.page.addScriptTag({ // Not using wrapper as this is before loaded is true + return this._page.addScriptTag({ // Not using wrapper as this is before loaded is true path: path.join(injectionScriptsPath, s) }); }); diff --git a/lib/browser/mixins/browser_actions.ts b/lib/browser/mixins/browser_actions.ts index 96713100..141282fe 100644 --- a/lib/browser/mixins/browser_actions.ts +++ b/lib/browser/mixins/browser_actions.ts @@ -24,7 +24,7 @@ export default abstract class BrowserActions extends BrowserQueries { try { for (let i = 0; i < count; i++) { for (const k of keys) { - await this.page.keyboard.press(k); + await this._page.keyboard.press(k); } } } catch (err) { @@ -55,7 +55,7 @@ export default abstract class BrowserActions extends BrowserQueries { if (!element) throw new Error(); cssPath = await this.findCssPath(element); } else cssPath = selector; - return await this.page.select(cssPath, ...values); + return await this._page.select(cssPath, ...values); } catch (err) { throw new QueryError("select", `Element "${selector}" not found.`); } @@ -150,7 +150,7 @@ export default abstract class BrowserActions extends BrowserQueries { public screenshot(args?: Base64ScreenShotOptions): Promise { this._failIfNotLoaded("screenshot"); - return this.page.screenshot(args); + return this._page.screenshot(args); } public async screenshotOfElement(selector: WendigoSelector, options?: Base64ScreenShotOptions): Promise { @@ -180,7 +180,7 @@ export default abstract class BrowserActions extends BrowserQueries { // const boxFrom = await fromElement.element.boundingBox(); // const boxTo = await toElement.element.boundingBox(); // if (!boxFrom || !boxTo) throw new FatalError("dragAndDrop", "Bounding box not found"); - // const mouse = this.page.mouse; + // const mouse = this._page.mouse; // await mouse.up(); // await mouse.move(boxFrom.x + (boxFrom.width / 2), boxFrom.y + (boxFrom.height / 2)); // await mouse.down(); diff --git a/lib/browser/mixins/browser_click.ts b/lib/browser/mixins/browser_click.ts index 645a5df2..f845bfcf 100644 --- a/lib/browser/mixins/browser_click.ts +++ b/lib/browser/mixins/browser_click.ts @@ -84,6 +84,6 @@ export default abstract class BrowserClick extends BrowserActions { } private _clickCoordinates(x: number, y: number): Promise { - return this.page.mouse.click(x, y); + return this._page.mouse.click(x, y); } } diff --git a/lib/browser/mixins/browser_info.ts b/lib/browser/mixins/browser_info.ts index 216f0945..5c9b053c 100644 --- a/lib/browser/mixins/browser_info.ts +++ b/lib/browser/mixins/browser_info.ts @@ -18,7 +18,7 @@ export default abstract class BrowserInfo extends BrowserClick { public title(): Promise { this._failIfNotLoaded("title"); - return this.page.title(); + return this._page.title(); } public html(): string { diff --git a/lib/browser/mixins/browser_navigation.ts b/lib/browser/mixins/browser_navigation.ts index 14d502f7..d4431639 100644 --- a/lib/browser/mixins/browser_navigation.ts +++ b/lib/browser/mixins/browser_navigation.ts @@ -3,28 +3,28 @@ import BrowserEvents from './browser_events'; export default abstract class BrowserNavigation extends BrowserEvents { public async back(): Promise { this._failIfNotLoaded("back"); - await this.page.goBack(); + await this._page.goBack(); await this._afterPageLoad(); } public async forward(): Promise { this._failIfNotLoaded("forward"); - await this.page.goForward(); + await this._page.goForward(); await this._afterPageLoad(); } public async refresh(): Promise { this._failIfNotLoaded("refresh"); - await this.page.reload(); + await this._page.reload(); await this._afterPageLoad(); } public async waitForPageLoad(): Promise { - await this.page.waitForNavigation({ + await this._page.waitForNavigation({ waitUntil: "domcontentloaded" }); - await this.page.waitFor(() => { + await this._page.waitFor(() => { const w = window as any; return Boolean(w.WendigoUtils && w.WendigoQuery && w.WendigoPathFinder); // Waits until Wendigo is ready }); diff --git a/lib/browser/mixins/browser_queries.ts b/lib/browser/mixins/browser_queries.ts index 57ca08db..f9e041b2 100644 --- a/lib/browser/mixins/browser_queries.ts +++ b/lib/browser/mixins/browser_queries.ts @@ -14,9 +14,9 @@ export default abstract class BrowserQueries extends BrowserCore { if (typeof selector === 'string') { let elementHandle: ElementHandle | null; if (isXPathQuery(selector)) { - const results = await this.page.$x(selector); + const results = await this._page.$x(selector); elementHandle = results[0] || null; - } else elementHandle = await this.page.$(selector); + } else elementHandle = await this._page.$(selector); result = DomElement.processQueryResult(elementHandle, selector); } else if (selector instanceof DomElement) result = selector; else throw new WendigoError("query", "Invalid selector."); @@ -34,8 +34,8 @@ export default abstract class BrowserQueries extends BrowserCore { if (typeof selector === 'string') { let rawElements: Array; - if (isXPathQuery(selector)) rawElements = await this.page.$x(selector); - else rawElements = await this.page.$$(selector); + if (isXPathQuery(selector)) rawElements = await this._page.$x(selector); + else rawElements = await this._page.$$(selector); result = rawElements.map((e) => { return DomElement.processQueryResult(e, selector); }).filter(b => Boolean(b)) as Array; diff --git a/lib/browser/mixins/browser_tap.ts b/lib/browser/mixins/browser_tap.ts index 722ff81f..aad3b929 100644 --- a/lib/browser/mixins/browser_tap.ts +++ b/lib/browser/mixins/browser_tap.ts @@ -46,7 +46,7 @@ export default abstract class BrowserTap extends BrowserWait { } private async tapCoordinates(x: number, y: number): Promise { - await this.page.touchscreen.tap(x, y); + await this._page.touchscreen.tap(x, y); return 1; } } diff --git a/lib/browser/mixins/browser_wait.ts b/lib/browser/mixins/browser_wait.ts index d2631892..b646e3d7 100644 --- a/lib/browser/mixins/browser_wait.ts +++ b/lib/browser/mixins/browser_wait.ts @@ -20,7 +20,7 @@ export default abstract class BrowserWait extends BrowserNavigation { else return e; }); try { - await this.page.waitFor(selector, { + await this._page.waitFor(selector, { timeout: timeout, visible: true }, ...args); @@ -74,7 +74,7 @@ export default abstract class BrowserWait extends BrowserNavigation { this._failIfNotLoaded("waitForNavigation"); const t1 = new Date().getTime(); try { - await this.page.waitForNavigation({ + await this._page.waitForNavigation({ timeout: timeout }); const t2 = new Date().getTime(); diff --git a/lib/browser/puppeteer_wrapper/puppeteer_page.ts b/lib/browser/puppeteer_wrapper/puppeteer_page.ts new file mode 100644 index 00000000..de5263a2 --- /dev/null +++ b/lib/browser/puppeteer_wrapper/puppeteer_page.ts @@ -0,0 +1,140 @@ +import { + Page, Frame, Viewport, EvaluateFn, SerializableOrJSHandle, JSHandle, Response, Worker, + ScriptTagOptions, Browser, Base64ScreenShotOptions, Keyboard, Mouse, NavigationOptions, WaitForSelectorOptions, ElementHandle, + Touchscreen, Cookie, SetCookie, DeleteCookie, PageEventObj, Request, Timeoutable +} from 'puppeteer'; +import { ViewportOptions } from './puppeteer_types'; + +export default class PuppeteerPage { + public page: Page; + + constructor(page: Page) { + this.page = page; + } + + public get keyboard(): Keyboard { + return this.page.keyboard; + } + + public get mouse(): Mouse { + return this.page.mouse; + } + + public get touchscreen(): Touchscreen { + return this.page.touchscreen; + } + + public goto(url: string): Promise { + return this.page.goto(url); + } + + public browser(): Browser { + return this.page.browser(); + } + + public frames(): Array { + return this.page.frames(); + } + + public setViewport(config: ViewportOptions = {}): Promise { + const finalConfig = Object.assign({}, this.page.viewport(), config) as Viewport; + return this.page.setViewport(finalConfig); + } + + public on(eventName: K, cb: (msg: PageEventObj[K]) => Promise): void { + this.page.on(eventName, cb); + } + + public evaluateHandle(cb: EvaluateFn, ...args: Array): Promise { + return this.page.evaluateHandle(cb, ...args); + } + + public async addScriptTag(options: ScriptTagOptions): Promise { + await this.page.addScriptTag(options); + } + + public async setUserAgent(userAgent: string): Promise { + await this.page.setUserAgent(userAgent); + } + + public async setBypassCSP(value: boolean): Promise { + await this.page.setBypassCSP(value); + } + + public content(): Promise { + return this.page.content(); + } + + public screenshot(args?: Base64ScreenShotOptions): Promise { + return this.page.screenshot(args); + } + + public select(cssPath: string, ...values: Array): Promise> { + return this.page.select(cssPath, ...values); + } + + public title(): Promise { + return this.page.title(); + } + + public async goBack(): Promise { + await this.page.goBack(); + } + + public async goForward(): Promise { + await this.page.goForward(); + } + + public async reload(): Promise { + await this.page.reload(); + } + + public async waitForNavigation(options?: NavigationOptions): Promise { + await this.page.waitForNavigation(options); + } + + public async waitFor(selector: string | EvaluateFn, options?: WaitForSelectorOptions, ...args: Array): Promise { + await this.page.waitFor(selector, options, ...args); + } + + public waitForRequest(url: string, options?: Timeoutable): Promise { + return this.page.waitForRequest(url, options); + } + + public waitForResponse(url: string, options?: Timeoutable): Promise { + return this.page.waitForResponse(url, options); + } + + public $(selector: string): Promise | null> { + return this.page.$(selector); + } + + public $x(selector: string): Promise>> { + return this.page.$x(selector); + } + + public $$(selector: string): Promise>> { + return this.page.$$(selector); + } + + public cookies(...urls: Array): Promise> { + return this.page.cookies(...urls); + } + + public setCookie(...cookies: Array): Promise { + return this.page.setCookie(...cookies); + } + + public deleteCookie(...cookies: Array): Promise { + return this.page.deleteCookie(...cookies); + } + + public workers(): Array { + return this.page.workers(); + } + + public setRequestInterception(b: boolean): Promise { + return this.page.setRequestInterception(b); + + } +} diff --git a/lib/browser/puppeteer_wrapper/puppeteer_types.ts b/lib/browser/puppeteer_wrapper/puppeteer_types.ts new file mode 100644 index 00000000..e47e8997 --- /dev/null +++ b/lib/browser/puppeteer_wrapper/puppeteer_types.ts @@ -0,0 +1,3 @@ +import { Viewport } from "puppeteer"; + +export type ViewportOptions = Partial; diff --git a/lib/browser_factory.ts b/lib/browser_factory.ts index c461f1f2..32ae7aba 100644 --- a/lib/browser_factory.ts +++ b/lib/browser_factory.ts @@ -7,6 +7,7 @@ import BrowserAssertion from './browser/browser_assertions'; import { FinalBrowserSettings, PluginModule } from './types'; import { FatalError } from './errors'; import BrowserInterface from './browser/browser_interface'; +import PuppeteerPage from './browser/puppeteer_wrapper/puppeteer_page'; export default class BrowserFactory { private static browserClass?: typeof Browser; @@ -16,7 +17,9 @@ export default class BrowserFactory { this.setupBrowserClass(plugins); } if (!this.browserClass) throw new FatalError("BrowserFactory", "Error on setupBrowserClass"); - return new this.browserClass(page, settings) as BrowserInterface; + + const puppeteerPage = new PuppeteerPage(page); + return new this.browserClass(puppeteerPage, settings) as BrowserInterface; } public static clearCache(): void { diff --git a/lib/modules/console/browser_console.ts b/lib/modules/console/browser_console.ts index bdfd6bdc..addc1da1 100644 --- a/lib/modules/console/browser_console.ts +++ b/lib/modules/console/browser_console.ts @@ -12,9 +12,11 @@ export default class BrowserConsole extends WendigoModule { constructor(browser: Browser) { super(browser); this.logs = []; - this._browser.page.on("console", async (log) => { - const text = await stringifyLogText(log); - this.logs.push(new Log(log, text)); + this._page.on("console", async (log) => { + if (log) { + const text = await stringifyLogText(log); + this.logs.push(new Log(log, text)); + } }); } diff --git a/lib/modules/cookies/browser_cookies.ts b/lib/modules/cookies/browser_cookies.ts index a8306fc5..efb940d2 100644 --- a/lib/modules/cookies/browser_cookies.ts +++ b/lib/modules/cookies/browser_cookies.ts @@ -5,7 +5,7 @@ import { arrayfy } from '../../utils/utils'; export default class BrowserCookies extends WendigoModule { public async all(): Promise<{ [s: string]: string }> { - const cookies = await this._browser.page.cookies(); + const cookies = await this._page.cookies(); return cookies.reduce((acc, cookie): { [s: string]: string } => { acc[cookie.name] = cookie.value; return acc; @@ -15,8 +15,8 @@ export default class BrowserCookies extends WendigoModule { public async get(name: string, url?: string): Promise { let cookies: Array; if (url) { - cookies = await this._browser.page.cookies(url); - } else cookies = await this._browser.page.cookies(); + cookies = await this._page.cookies(url); + } else cookies = await this._page.cookies(); return cookies.find((cookie) => { return cookie.name === name; }); @@ -32,14 +32,14 @@ export default class BrowserCookies extends WendigoModule { } else { data = Object.assign({}, value, { name: name }); } - return this._browser.page.setCookie(data); + return this._page.setCookie(data); } public delete(name: string | Array | DeleteCookie): Promise { if (name === undefined || name === null) throw new WendigoError("cookies.delete", "Delete cookie name missing"); if (this.isDeleteCookieInterface(name)) { - return this._browser.page.deleteCookie(name); + return this._page.deleteCookie(name); } const cookiesList = arrayfy(name); @@ -47,11 +47,11 @@ export default class BrowserCookies extends WendigoModule { const cookiesObjects = cookiesList.map((n) => { return { name: n }; }); - return this._browser.page.deleteCookie(...cookiesObjects); + return this._page.deleteCookie(...cookiesObjects); } public async clear(): Promise { - const cookies = await this._browser.page.cookies(); + const cookies = await this._page.cookies(); const cookiesList = cookies.map(c => c.name); return this.delete(cookiesList); } diff --git a/lib/modules/requests/browser_requests.ts b/lib/modules/requests/browser_requests.ts index c98701d3..3e8781ec 100644 --- a/lib/modules/requests/browser_requests.ts +++ b/lib/modules/requests/browser_requests.ts @@ -53,7 +53,7 @@ export default class BrowserRequests extends WendigoModule { public async waitForNextRequest(url: string, timeout: number = 500): Promise { try { - await this._browser.page.waitForRequest(url, { + await this._page.waitForRequest(url, { timeout: timeout }); } catch (err) { @@ -63,7 +63,7 @@ export default class BrowserRequests extends WendigoModule { public async waitForNextResponse(url: string, timeout: number = 500): Promise { try { - await this._browser.page.waitForResponse(url, { + await this._page.waitForResponse(url, { timeout: timeout }); } catch (err) { @@ -118,8 +118,8 @@ export default class BrowserRequests extends WendigoModule { protected async _startRequestInterceptor(): Promise { this._interceptorReady = true; - await this._browser.page.setRequestInterception(true); - this._browser.page.on('request', request => { + await this._page.setRequestInterception(true); + this._page.on('request', request => { this._requests.push(request); const mock = this._requestMocker.getMockedResponse(request); if (mock) { diff --git a/lib/modules/webworkers/browser_webworker.ts b/lib/modules/webworkers/browser_webworker.ts index 36014203..c82c3856 100644 --- a/lib/modules/webworkers/browser_webworker.ts +++ b/lib/modules/webworkers/browser_webworker.ts @@ -3,7 +3,7 @@ import WendigoModule from '../wendigo_module'; export default class BrowserWebWorker extends WendigoModule { public all(): Array { - return this._browser.page.workers().map((ww) => { + return this._page.workers().map((ww) => { return new WebWorker(ww); }); } diff --git a/lib/modules/wendigo_module.ts b/lib/modules/wendigo_module.ts index f60b3dc6..93f9b18e 100644 --- a/lib/modules/wendigo_module.ts +++ b/lib/modules/wendigo_module.ts @@ -1,11 +1,14 @@ import Browser from '../browser/browser'; import { OpenSettings } from '../types'; +import PuppeteerPage from '../browser/puppeteer_wrapper/puppeteer_page'; export default abstract class WendigoModule { protected _browser: Browser; + protected _page: PuppeteerPage; constructor(browser: Browser) { this._browser = browser; + this._page = new PuppeteerPage(browser.page); } protected _beforeOpen(_options: OpenSettings): Promise { diff --git a/lib/types.ts b/lib/types.ts index a2338c32..9eca4764 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -1,5 +1,5 @@ -import { Viewport } from 'puppeteer'; import DomElement from './models/dom_element'; +import { ViewportOptions } from './browser/puppeteer_wrapper/puppeteer_types'; export type WendigoSelector = string | DomElement; @@ -33,6 +33,6 @@ export interface PluginModule { } export interface OpenSettings { - viewport?: Viewport; + viewport?: ViewportOptions; queryString?: string | { [s: string]: string; }; } diff --git a/package-lock.json b/package-lock.json index 11c4da92..5f7be5b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2212,9 +2212,9 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "typescript": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.1.tgz", - "integrity": "sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.2.tgz", + "integrity": "sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==", "dev": true }, "uc.micro": { diff --git a/package.json b/package.json index 0206540e..644eae77 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,6 @@ "markdownlint-cli": "^0.17.0", "mocha": "^6.1.4", "tslint": "^5.17.0", - "typescript": "^3.5.1" + "typescript": "^3.5.2" } } From 9246bce3ac7f404c859d1a4468e1248c3ed421be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Fri, 21 Jun 2019 12:31:28 +0200 Subject: [PATCH 4/5] puppeteer updated to 1.18.0, close #355 --- CHANGELOG.md | 1 + package-lock.json | 58 +++++++++++++++++++++++------------------------ package.json | 2 +- 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df3e1410..0cb80c84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ================= * Internal Puppeteer wrapper +* Puppeteer updated to 1.18.0 2.1.2 / 2018-06-06 ================== diff --git a/package-lock.json b/package-lock.json index 5f7be5b4..1e8fa0ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,7 +67,7 @@ }, "agent-base": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "resolved": "http://54.148.160.175:4873/agent-base/-/agent-base-4.3.0.tgz", "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", "requires": { "es6-promisify": "^5.0.0" @@ -135,7 +135,7 @@ }, "async-limiter": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "resolved": "http://54.148.160.175:4873/async-limiter/-/async-limiter-1.0.0.tgz", "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" }, "balanced-match": { @@ -195,7 +195,7 @@ }, "buffer-from": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "resolved": "http://54.148.160.175:4873/buffer-from/-/buffer-from-1.1.1.tgz", "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" }, "builtin-modules": { @@ -310,7 +310,7 @@ }, "concat-stream": { "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "resolved": "http://54.148.160.175:4873/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "requires": { "buffer-from": "^1.0.0", @@ -348,7 +348,7 @@ }, "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "resolved": "http://54.148.160.175:4873/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "cross-spawn": { @@ -486,12 +486,12 @@ }, "es6-promise": { "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "resolved": "http://54.148.160.175:4873/es6-promise/-/es6-promise-4.2.8.tgz", "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" }, "es6-promisify": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "resolved": "http://54.148.160.175:4873/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "requires": { "es6-promise": "^4.0.3" @@ -711,7 +711,7 @@ }, "extract-zip": { "version": "1.6.7", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", + "resolved": "http://54.148.160.175:4873/extract-zip/-/extract-zip-1.6.7.tgz", "integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=", "requires": { "concat-stream": "1.6.2", @@ -722,7 +722,7 @@ "dependencies": { "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "resolved": "http://54.148.160.175:4873/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { "ms": "2.0.0" @@ -730,7 +730,7 @@ }, "ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "resolved": "http://54.148.160.175:4873/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" } } @@ -755,7 +755,7 @@ }, "fd-slicer": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", + "resolved": "http://54.148.160.175:4873/fd-slicer/-/fd-slicer-1.0.1.tgz", "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", "requires": { "pend": "~1.2.0" @@ -969,7 +969,7 @@ }, "https-proxy-agent": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", + "resolved": "http://54.148.160.175:4873/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", "requires": { "agent-base": "^4.1.0", @@ -978,7 +978,7 @@ "dependencies": { "debug": { "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "resolved": "http://54.148.160.175:4873/debug/-/debug-3.2.6.tgz", "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "requires": { "ms": "^2.1.1" @@ -1148,7 +1148,7 @@ }, "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "resolved": "http://54.148.160.175:4873/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "isexe": { @@ -1344,7 +1344,7 @@ }, "mime": { "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", + "resolved": "http://54.148.160.175:4873/mime/-/mime-2.4.4.tgz", "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" }, "mime-db": { @@ -1693,7 +1693,7 @@ }, "pend": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "resolved": "http://54.148.160.175:4873/pend/-/pend-1.2.0.tgz", "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" }, "prelude-ls": { @@ -1703,9 +1703,9 @@ "dev": true }, "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "version": "2.0.1", + "resolved": "http://54.148.160.175:4873/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "progress": { "version": "2.0.3", @@ -1724,7 +1724,7 @@ }, "proxy-from-env": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", + "resolved": "http://54.148.160.175:4873/proxy-from-env/-/proxy-from-env-1.0.0.tgz", "integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=" }, "pump": { @@ -1744,9 +1744,9 @@ "dev": true }, "puppeteer": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.14.0.tgz", - "integrity": "sha512-SayS2wUX/8LF8Yo2Rkpc5nkAu4Jg3qu+OLTDSOZtisVQMB2Z5vjlY2TdPi/5CgZKiZroYIiyUN3sRX63El9iaw==", + "version": "1.18.0", + "resolved": "http://54.148.160.175:4873/puppeteer/-/puppeteer-1.18.0.tgz", + "integrity": "sha512-NCwSN4wEIj43k4jO8Asa5nzibrIDFHWykqkZFjkGr0/f6U73k1ysql0gadQmOGLtZewXvvWqlNo+4ZMgX+5vZA==", "requires": { "debug": "^4.1.0", "extract-zip": "^1.6.6", @@ -1810,7 +1810,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "http://54.148.160.175:4873/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { "core-util-is": "~1.0.0", @@ -2040,7 +2040,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "http://54.148.160.175:4873/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { "safe-buffer": "~5.1.0" @@ -2208,7 +2208,7 @@ }, "typedarray": { "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "resolved": "http://54.148.160.175:4873/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "typescript": { @@ -2240,7 +2240,7 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "resolved": "http://54.148.160.175:4873/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "utils-merge": { @@ -2348,7 +2348,7 @@ }, "ws": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "resolved": "http://54.148.160.175:4873/ws/-/ws-6.2.1.tgz", "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "requires": { "async-limiter": "~1.0.0" @@ -2474,7 +2474,7 @@ }, "yauzl": { "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", + "resolved": "http://54.148.160.175:4873/yauzl/-/yauzl-2.4.1.tgz", "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", "requires": { "fd-slicer": "~1.0.1" diff --git a/package.json b/package.json index 644eae77..ab036939 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "dependencies": { "compositer": "^1.3.4", "is-class": "0.0.7", - "puppeteer": "~1.14.0", + "puppeteer": "~1.18.0", "@types/puppeteer": "^1.12.4" }, "devDependencies": { From 41ab96a36a149ff60303c2ee4a5d7437b0398501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Fri, 21 Jun 2019 12:34:00 +0200 Subject: [PATCH 5/5] release 2.1.3 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cb80c84..46b794e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -2.1.3/ ####-##-## +2.1.3/ 2018-06-21 ================= * Internal Puppeteer wrapper