From 7515ed614660d1e836cece74fe6cc0888cc368bf Mon Sep 17 00:00:00 2001 From: Jon Bockhorst Date: Mon, 10 Feb 2020 16:56:37 -0600 Subject: [PATCH] Use playwright instead of puppeteer --- .../xterm-addon-attach/src/AttachAddon.api.ts | 35 +- addons/xterm-addon-fit/src/FitAddon.api.ts | 41 +- .../xterm-addon-search/src/SearchAddon.api.ts | 33 +- .../src/SerializeAddon.api.ts | 29 +- .../src/Unicode11Addon.api.ts | 29 +- .../src/WebLinksAddon.api.ts | 29 +- .../src/WebglRenderer.api.ts | 35 +- package.json | 2 + test/api/CharWidth.api.ts | 28 +- test/api/InputHandler.api.ts | 76 +-- test/api/MouseTracking.api.ts | 490 +++++++++--------- test/api/Parser.api.ts | 16 +- test/api/Terminal.api.ts | 16 +- test/api/TestUtils.ts | 22 +- yarn.lock | 61 ++- 15 files changed, 562 insertions(+), 380 deletions(-) diff --git a/addons/xterm-addon-attach/src/AttachAddon.api.ts b/addons/xterm-addon-attach/src/AttachAddon.api.ts index 264b32ee..50891efd 100644 --- a/addons/xterm-addon-attach/src/AttachAddon.api.ts +++ b/addons/xterm-addon-attach/src/AttachAddon.api.ts @@ -3,26 +3,26 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; +import * as playwright from 'playwright'; import { assert } from 'chai'; import { ITerminalOptions } from 'xterm'; import WebSocket = require('ws'); const APP = 'http://127.0.0.1:3000/test'; -let browser: puppeteer.Browser; -let page: puppeteer.Page; +let browser: playwright.Browser; +let page: playwright.Page; const width = 800; const height = 600; describe('AttachAddon', () => { - before(async function(): Promise { + before(async function (): Promise { this.timeout(20000); - browser = await puppeteer.launch({ + browser = await getBrowserType().launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); - page = (await browser.pages())[0]; + page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); }); @@ -30,12 +30,12 @@ describe('AttachAddon', () => { await browser.close(); }); - beforeEach(async function(): Promise { + beforeEach(async function (): Promise { this.timeout(20000); await page.goto(APP); }); - it('string', async function(): Promise { + it('string', async function (): Promise { this.timeout(20000); await openTerminal({ rendererType: 'dom' }); const port = 8080; @@ -46,7 +46,7 @@ describe('AttachAddon', () => { server.close(); }); - it('utf8', async function(): Promise { + it('utf8', async function (): Promise { this.timeout(20000); await openTerminal({ rendererType: 'dom' }); const port = 8080; @@ -69,7 +69,7 @@ async function openTerminal(options: ITerminalOptions = {}): Promise { } } -async function pollFor(page: puppeteer.Page, fn: string, val: any): Promise { +async function pollFor(page: playwright.Page, fn: string, val: any): Promise { const result = await page.evaluate(fn); if (result !== val) { return new Promise(r => { @@ -77,3 +77,18 @@ async function pollFor(page: puppeteer.Page, fn: string, val: any): Promise index + 2 && typeof process.argv[index + 1] === 'string') { + const string = process.argv[index + 1]; + if (string === 'firefox' || string === 'webkit') { + browserType = playwright[string]; + } + } + + return browserType; +} diff --git a/addons/xterm-addon-fit/src/FitAddon.api.ts b/addons/xterm-addon-fit/src/FitAddon.api.ts index aa73a9b6..c170d75a 100644 --- a/addons/xterm-addon-fit/src/FitAddon.api.ts +++ b/addons/xterm-addon-fit/src/FitAddon.api.ts @@ -3,25 +3,25 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; +import * as playwright from 'playwright'; import { assert } from 'chai'; import { ITerminalOptions } from 'xterm'; const APP = 'http://127.0.0.1:3000/test'; -let browser: puppeteer.Browser; -let page: puppeteer.Page; +let browser: playwright.Browser; +let page: playwright.Page; const width = 1024; const height = 768; describe('FitAddon', () => { - before(async function(): Promise { + before(async function (): Promise { this.timeout(20000); - browser = await puppeteer.launch({ + browser = await getBrowserType().launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); - page = (await browser.pages())[0]; + page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); await page.goto(APP); await openTerminal(); @@ -31,7 +31,7 @@ describe('FitAddon', () => { await browser.close(); }); - it('no terminal', async function(): Promise { + it('no terminal', async function (): Promise { await page.evaluate(`window.fit = new FitAddon();`); assert.equal(await page.evaluate(`window.fit.proposeDimensions()`), undefined); }); @@ -41,7 +41,7 @@ describe('FitAddon', () => { return unloadFit(); }); - it('default', async function(): Promise { + it('default', async function (): Promise { await loadFit(); assert.deepEqual(await page.evaluate(`window.fit.proposeDimensions()`), { cols: 87, @@ -49,7 +49,7 @@ describe('FitAddon', () => { }); }); - it('width', async function(): Promise { + it('width', async function (): Promise { await loadFit(1008); assert.deepEqual(await page.evaluate(`window.fit.proposeDimensions()`), { cols: 110, @@ -57,7 +57,7 @@ describe('FitAddon', () => { }); }); - it('small', async function(): Promise { + it('small', async function (): Promise { await loadFit(1, 1); assert.deepEqual(await page.evaluate(`window.fit.proposeDimensions()`), { cols: 2, @@ -71,21 +71,21 @@ describe('FitAddon', () => { return unloadFit(); }); - it('default', async function(): Promise { + it('default', async function (): Promise { await loadFit(); await page.evaluate(`window.fit.fit()`); assert.equal(await page.evaluate(`window.term.cols`), 87); assert.equal(await page.evaluate(`window.term.rows`), 26); }); - it('width', async function(): Promise { + it('width', async function (): Promise { await loadFit(1008); await page.evaluate(`window.fit.fit()`); assert.equal(await page.evaluate(`window.term.cols`), 110); assert.equal(await page.evaluate(`window.term.rows`), 26); }); - it('small', async function(): Promise { + it('small', async function (): Promise { await loadFit(1, 1); await page.evaluate(`window.fit.fit()`); assert.equal(await page.evaluate(`window.term.cols`), 2); @@ -116,3 +116,18 @@ async function openTerminal(options: ITerminalOptions = {}): Promise { await page.waitForSelector('.xterm-text-layer'); } } + +function getBrowserType(): playwright.BrowserType { + // Default to chromium + let browserType: playwright.BrowserType = playwright['chromium']; + + const index = process.argv.indexOf('--browser'); + if (index !== -1 && process.argv.length > index + 2 && typeof process.argv[index + 1] === 'string') { + const string = process.argv[index + 1]; + if (string === 'firefox' || string === 'webkit') { + browserType = playwright[string]; + } + } + + return browserType; +} diff --git a/addons/xterm-addon-search/src/SearchAddon.api.ts b/addons/xterm-addon-search/src/SearchAddon.api.ts index 72a69b5f..bb983e08 100644 --- a/addons/xterm-addon-search/src/SearchAddon.api.ts +++ b/addons/xterm-addon-search/src/SearchAddon.api.ts @@ -3,7 +3,7 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; +import * as playwright from 'playwright'; import { assert } from 'chai'; import { ITerminalOptions } from 'xterm'; import { readFile } from 'fs'; @@ -11,8 +11,8 @@ import { resolve } from 'path'; const APP = 'http://127.0.0.1:3000/test'; -let browser: puppeteer.Browser; -let page: puppeteer.Page; +let browser: playwright.Browser; +let page: playwright.Page; const width = 800; const height = 600; @@ -20,11 +20,11 @@ describe('Search Tests', function (): void { this.timeout(20000); before(async function (): Promise { - browser = await puppeteer.launch({ + browser = await getBrowserType().launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); - page = (await browser.pages())[0]; + page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); await page.goto(APP); await openTerminal(); @@ -58,12 +58,12 @@ describe('Search Tests', function (): void { assert.deepEqual(await page.evaluate(`window.search.findNext('$^1_3{}test$#')`), true); assert.deepEqual(await page.evaluate(`window.term.getSelection()`), '$^1_3{}test$#'); }); - it ('Incremental Find Previous', async () => { + it('Incremental Find Previous', async () => { await page.evaluate(`window.term.writeln('package.jsonc\\n')`); await writeSync('package.json pack package.lock'); await page.evaluate(`window.search.findPrevious('pack', {incremental: true})`); let line: string = await page.evaluate(`window.term.buffer.getLine(window.term.getSelectionPosition().startRow).translateToString()`); - let selectionPosition: {startColumn: number, startRow: number, endColumn: number, endRow: number} = await page.evaluate(`window.term.getSelectionPosition()`); + let selectionPosition: { startColumn: number, startRow: number, endColumn: number, endRow: number } = await page.evaluate(`window.term.getSelectionPosition()`); // We look further ahead in the line to ensure that pack was selected from package.lock assert.deepEqual(line.substring(selectionPosition.startColumn, selectionPosition.endColumn + 8), 'package.lock'); await page.evaluate(`window.search.findPrevious('package.j', {incremental: true})`); @@ -75,12 +75,12 @@ describe('Search Tests', function (): void { selectionPosition = await page.evaluate(`window.term.getSelectionPosition()`); assert.deepEqual(line.substring(selectionPosition.startColumn, selectionPosition.endColumn), 'package.jsonc'); }); - it ('Incremental Find Next', async () => { + it('Incremental Find Next', async () => { await page.evaluate(`window.term.writeln('package.lock pack package.json package.ups\\n')`); await writeSync('package.jsonc'); await page.evaluate(`window.search.findNext('pack', {incremental: true})`); let line: string = await page.evaluate(`window.term.buffer.getLine(window.term.getSelectionPosition().startRow).translateToString()`); - let selectionPosition: {startColumn: number, startRow: number, endColumn: number, endRow: number} = await page.evaluate(`window.term.getSelectionPosition()`); + let selectionPosition: { startColumn: number, startRow: number, endColumn: number, endRow: number } = await page.evaluate(`window.term.getSelectionPosition()`); // We look further ahead in the line to ensure that pack was selected from package.lock assert.deepEqual(line.substring(selectionPosition.startColumn, selectionPosition.endColumn + 8), 'package.lock'); await page.evaluate(`window.search.findNext('package.j', {incremental: true})`); @@ -211,3 +211,18 @@ function makeData(length: number): string { } return result; } + +function getBrowserType(): playwright.BrowserType { + // Default to chromium + let browserType: playwright.BrowserType = playwright['chromium']; + + const index = process.argv.indexOf('--browser'); + if (index !== -1 && process.argv.length > index + 2 && typeof process.argv[index + 1] === 'string') { + const string = process.argv[index + 1]; + if (string === 'firefox' || string === 'webkit') { + browserType = playwright[string]; + } + } + + return browserType; +} diff --git a/addons/xterm-addon-serialize/src/SerializeAddon.api.ts b/addons/xterm-addon-serialize/src/SerializeAddon.api.ts index a34aa0bd..dfdbcdb7 100644 --- a/addons/xterm-addon-serialize/src/SerializeAddon.api.ts +++ b/addons/xterm-addon-serialize/src/SerializeAddon.api.ts @@ -3,24 +3,24 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; +import * as playwright from 'playwright'; import { assert } from 'chai'; import { ITerminalOptions } from 'xterm'; const APP = 'http://127.0.0.1:3000/test'; -let browser: puppeteer.Browser; -let page: puppeteer.Page; +let browser: playwright.Browser; +let page: playwright.Page; const width = 800; const height = 600; describe('SerializeAddon', () => { before(async function (): Promise { - browser = await puppeteer.launch({ + browser = await getBrowserType().launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`] }); - page = (await browser.pages())[0]; + page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); await page.goto(APP); await openTerminal({ rows: 10, cols: 10, rendererType: 'dom' }); @@ -349,7 +349,7 @@ const DIM = '2'; const NO_ITALIC = '23'; const NO_DIM = '22'; -async function writeSync(page: puppeteer.Page, data: string): Promise { +async function writeSync(page: playwright.Page, data: string): Promise { await page.evaluate(` window.ready = false; window.term.write('${data}', () => window.ready = true); @@ -357,7 +357,7 @@ async function writeSync(page: puppeteer.Page, data: string): Promise { await pollFor(page, 'window.ready', true); } -async function pollFor(page: puppeteer.Page, fn: string, val: any, preFn?: () => Promise): Promise { +async function pollFor(page: playwright.Page, fn: string, val: any, preFn?: () => Promise): Promise { if (preFn) { await preFn(); } @@ -368,3 +368,18 @@ async function pollFor(page: puppeteer.Page, fn: string, val: any, preFn?: () => }); } } + +function getBrowserType(): playwright.BrowserType { + // Default to chromium + let browserType: playwright.BrowserType = playwright['chromium']; + + const index = process.argv.indexOf('--browser'); + if (index !== -1 && process.argv.length > index + 2 && typeof process.argv[index + 1] === 'string') { + const string = process.argv[index + 1]; + if (string === 'firefox' || string === 'webkit') { + browserType = playwright[string]; + } + } + + return browserType; +} diff --git a/addons/xterm-addon-unicode11/src/Unicode11Addon.api.ts b/addons/xterm-addon-unicode11/src/Unicode11Addon.api.ts index fb721b47..68426df7 100644 --- a/addons/xterm-addon-unicode11/src/Unicode11Addon.api.ts +++ b/addons/xterm-addon-unicode11/src/Unicode11Addon.api.ts @@ -3,25 +3,25 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; +import * as playwright from 'playwright'; import { ITerminalOptions } from 'xterm'; import { assert } from 'chai'; const APP = 'http://127.0.0.1:3000/test'; -let browser: puppeteer.Browser; -let page: puppeteer.Page; +let browser: playwright.Browser; +let page: playwright.Page; const width = 800; const height = 600; describe('Unicode11Addon', () => { - before(async function(): Promise { + before(async function (): Promise { this.timeout(20000); - browser = await puppeteer.launch({ + browser = await getBrowserType().launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); - page = (await browser.pages())[0]; + page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); }); @@ -29,7 +29,7 @@ describe('Unicode11Addon', () => { await browser.close(); }); - beforeEach(async function(): Promise { + beforeEach(async function (): Promise { this.timeout(20000); await page.goto(APP); await openTerminal(); @@ -59,3 +59,18 @@ async function openTerminal(options: ITerminalOptions = {}): Promise { await page.waitForSelector('.xterm-text-layer'); } } + +function getBrowserType(): playwright.BrowserType { + // Default to chromium + let browserType: playwright.BrowserType = playwright['chromium']; + + const index = process.argv.indexOf('--browser'); + if (index !== -1 && process.argv.length > index + 2 && typeof process.argv[index + 1] === 'string') { + const string = process.argv[index + 1]; + if (string === 'firefox' || string === 'webkit') { + browserType = playwright[string]; + } + } + + return browserType; +} diff --git a/addons/xterm-addon-web-links/src/WebLinksAddon.api.ts b/addons/xterm-addon-web-links/src/WebLinksAddon.api.ts index d2644e83..a51343c0 100644 --- a/addons/xterm-addon-web-links/src/WebLinksAddon.api.ts +++ b/addons/xterm-addon-web-links/src/WebLinksAddon.api.ts @@ -3,25 +3,25 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; +import * as playwright from 'playwright'; import { assert } from 'chai'; import { ITerminalOptions } from 'xterm'; const APP = 'http://127.0.0.1:3000/test'; -let browser: puppeteer.Browser; -let page: puppeteer.Page; +let browser: playwright.Browser; +let page: playwright.Page; const width = 800; const height = 600; describe('WebLinksAddon', () => { before(async function (): Promise { this.timeout(10000); - browser = await puppeteer.launch({ + browser = await getBrowserType().launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); - page = (await browser.pages())[0]; + page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); }); @@ -88,7 +88,7 @@ async function pollForLinkAtCell(col: number, row: number, value: string): Promi assert.equal(await page.evaluate(`Array.prototype.reduce.call(document.querySelectorAll('${rowSelector} > span[style]'), (a, b) => a + b.textContent, '');`), value); } -async function pollFor(page: puppeteer.Page, fn: string, val: any, preFn?: () => Promise): Promise { +async function pollFor(page: playwright.Page, fn: string, val: any, preFn?: () => Promise): Promise { if (preFn) { await preFn(); } @@ -100,10 +100,25 @@ async function pollFor(page: puppeteer.Page, fn: string, val: any, preFn?: () => } } -async function writeSync(page: puppeteer.Page, data: string): Promise { +async function writeSync(page: playwright.Page, data: string): Promise { await page.evaluate(` window.ready = false; window.term.write('${data}', () => window.ready = true); `); await pollFor(page, 'window.ready', true); } + +function getBrowserType(): playwright.BrowserType { + // Default to chromium + let browserType: playwright.BrowserType = playwright['chromium']; + + const index = process.argv.indexOf('--browser'); + if (index !== -1 && process.argv.length > index + 2 && typeof process.argv[index + 1] === 'string') { + const string = process.argv[index + 1]; + if (string === 'firefox' || string === 'webkit') { + browserType = playwright[string]; + } + } + + return browserType; +} diff --git a/addons/xterm-addon-webgl/src/WebglRenderer.api.ts b/addons/xterm-addon-webgl/src/WebglRenderer.api.ts index 8b9c84bf..c783271b 100644 --- a/addons/xterm-addon-webgl/src/WebglRenderer.api.ts +++ b/addons/xterm-addon-webgl/src/WebglRenderer.api.ts @@ -3,7 +3,7 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; +import * as playwright from 'playwright'; import { ITerminalOptions } from '../../../src/Types'; import { ITheme } from 'xterm'; import { assert } from 'chai'; @@ -11,12 +11,12 @@ import deepEqual = require('deep-equal'); const APP = 'http://127.0.0.1:3000/test'; -let browser: puppeteer.Browser; -let page: puppeteer.Page; +let browser: playwright.Browser; +let page: playwright.Page; const width = 800; const height = 600; -describe('WebGL Renderer Integration Tests', function(): void { +describe('WebGL Renderer Integration Tests', function (): void { it('dispose removes renderer canvases', async () => { await setupBrowser(); assert.equal(await page.evaluate(`document.querySelectorAll('.xterm canvas').length`), 3); @@ -504,7 +504,7 @@ describe('WebGL Renderer Integration Tests', function(): void { } }); - it('foreground true color red inverse', async function(): Promise { + it('foreground true color red inverse', async function (): Promise { let data = ''; for (let y = 0; y < 16; y++) { for (let x = 0; x < 16; x++) { @@ -522,7 +522,7 @@ describe('WebGL Renderer Integration Tests', function(): void { } }); - it('background true color red inverse', async function(): Promise { + it('background true color red inverse', async function (): Promise { let data = ''; for (let y = 0; y < 16; y++) { for (let x = 0; x < 16; x++) { @@ -850,7 +850,7 @@ describe('WebGL Renderer Integration Tests', function(): void { }); describe('allowTransparency', async () => { - before(async () => setupBrowser({ rendererType: 'dom', allowTransparency: true})); + before(async () => setupBrowser({ rendererType: 'dom', allowTransparency: true })); after(async () => browser.close()); beforeEach(async () => page.evaluate(`window.term.reset()`)); it('transparent background inverse', async () => { @@ -895,11 +895,11 @@ async function getCellColor(col: number, row: number): Promise { } async function setupBrowser(options: ITerminalOptions = { rendererType: 'dom' }): Promise { - browser = await puppeteer.launch({ + browser = await getBrowserType().launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); - page = (await browser.pages())[0]; + page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); await page.goto(APP); await openTerminal(options); @@ -909,7 +909,7 @@ async function setupBrowser(options: ITerminalOptions = { rendererType: 'dom' }) `); } -export async function pollFor(page: puppeteer.Page, evalOrFn: string | (() => Promise), val: T, preFn?: () => Promise): Promise { +export async function pollFor(page: playwright.Page, evalOrFn: string | (() => Promise), val: T, preFn?: () => Promise): Promise { if (preFn) { await preFn(); } @@ -938,3 +938,18 @@ const COLORS_16_TO_255 = [ '#ffd7d7', '#ffd7ff', '#ffff00', '#ffff5f', '#ffff87', '#ffffaf', '#ffffd7', '#ffffff', '#080808', '#121212', '#1c1c1c', '#262626', '#303030', '#3a3a3a', '#444444', '#4e4e4e', '#585858', '#626262', '#6c6c6c', '#767676', '#808080', '#8a8a8a', '#949494', '#9e9e9e', '#a8a8a8', '#b2b2b2', '#bcbcbc', '#c6c6c6', '#d0d0d0', '#dadada', '#e4e4e4', '#eeeeee' ]; + +function getBrowserType(): playwright.BrowserType { + // Default to chromium + let browserType: playwright.BrowserType = playwright['chromium']; + + const index = process.argv.indexOf('--browser'); + if (index !== -1 && process.argv.length > index + 2 && typeof process.argv[index + 1] === 'string') { + const string = process.argv[index + 1]; + if (string === 'firefox' || string === 'webkit') { + browserType = playwright[string]; + } + } + + return browserType; +} diff --git a/package.json b/package.json index 956cdbb1..2d61fac8 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ }, "devDependencies": { "@types/chai": "^3.4.34", + "@types/debug": "^4.1.5", "@types/deep-equal": "^1.0.1", "@types/glob": "^5.0.35", "@types/jsdom": "11.0.1", @@ -50,6 +51,7 @@ "mustache": "^3.0.1", "node-pty": "^0.9.0", "nyc": "13", + "playwright": "^0.10.0", "puppeteer": "^1.15.0", "source-map-loader": "^0.2.4", "ts-loader": "^6.0.4", diff --git a/test/api/CharWidth.api.ts b/test/api/CharWidth.api.ts index a2352f40..63b94aa7 100644 --- a/test/api/CharWidth.api.ts +++ b/test/api/CharWidth.api.ts @@ -3,24 +3,24 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; import { ITerminalOptions } from 'xterm'; -import { pollFor } from './TestUtils'; +import { pollFor, getBrowserType } from './TestUtils'; +import { Browser, Page } from 'playwright'; const APP = 'http://127.0.0.1:3000/test'; -let browser: puppeteer.Browser; -let page: puppeteer.Page; +let browser: Browser; +let page: Page; const width = 800; const height = 600; -describe('CharWidth Integration Tests', function(): void { - before(async function(): Promise { - browser = await puppeteer.launch({ +describe('CharWidth Integration Tests', function (): void { + before(async function (): Promise { + browser = await getBrowserType().launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); - page = (await browser.pages())[0]; + page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); await page.goto(APP); await openTerminal({ rows: 5, cols: 30 }); @@ -35,37 +35,37 @@ describe('CharWidth Integration Tests', function(): void { await page.evaluate(`window.term.reset()`); }); - it('ASCII chars', async function(): Promise { + it('ASCII chars', async function (): Promise { const input = 'This is just ASCII text.#'; await page.evaluate(`window.term.write('${input}')`); await pollFor(page, () => sumWidths(0, 1, '#'), 25); }); - it('combining chars', async function(): Promise { + it('combining chars', async function (): Promise { const input = 'e\u0301e\u0301e\u0301e\u0301e\u0301e\u0301e\u0301e\u0301e\u0301#'; await page.evaluate(`window.term.write('${input}')`); await pollFor(page, () => sumWidths(0, 1, '#'), 10); }); - it('surrogate chars', async function(): Promise { + it('surrogate chars', async function (): Promise { const input = '𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞#'; await page.evaluate(`window.term.write('${input}')`); await pollFor(page, () => sumWidths(0, 1, '#'), 28); }); - it('surrogate combining chars', async function(): Promise { + it('surrogate combining chars', async function (): Promise { const input = '𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301#'; await page.evaluate(`window.term.write('${input}')`); await pollFor(page, () => sumWidths(0, 1, '#'), 12); }); - it('fullwidth chars', async function(): Promise { + it('fullwidth chars', async function (): Promise { const input = '1234567890#'; await page.evaluate(`window.term.write('${input}')`); await pollFor(page, () => sumWidths(0, 1, '#'), 21); }); - it('fullwidth chars offset 1', async function(): Promise { + it('fullwidth chars offset 1', async function (): Promise { const input = 'a1234567890#'; await page.evaluate(`window.term.write('${input}')`); await pollFor(page, () => sumWidths(0, 1, '#'), 22); diff --git a/test/api/InputHandler.api.ts b/test/api/InputHandler.api.ts index ad30a51c..c95b83f8 100644 --- a/test/api/InputHandler.api.ts +++ b/test/api/InputHandler.api.ts @@ -3,25 +3,25 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; import { assert } from 'chai'; import { ITerminalOptions } from 'xterm'; -import { pollFor } from './TestUtils'; +import { pollFor, getBrowserType } from './TestUtils'; +import { Page, Browser } from 'playwright'; const APP = 'http://127.0.0.1:3000/test'; -let browser: puppeteer.Browser; -let page: puppeteer.Page; +let browser: Browser; +let page: Page; const width = 800; const height = 600; -describe('InputHandler Integration Tests', function(): void { - before(async function(): Promise { - browser = await puppeteer.launch({ +describe('InputHandler Integration Tests', function (): void { + before(async function (): Promise { + browser = await getBrowserType().launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); - page = (await browser.pages())[0]; + page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); await page.goto(APP); await openTerminal(); @@ -36,7 +36,7 @@ describe('InputHandler Integration Tests', function(): void { await page.evaluate(`window.term.reset()`); }); - it('ICH: Insert Ps (Blank) Character(s) (default = 1) - CSI Ps @', async function(): Promise { + it('ICH: Insert Ps (Blank) Character(s) (default = 1) - CSI Ps @', async function (): Promise { await page.evaluate(` // Default window.term.write('foo\\x1b[3D\\x1b[@\\n\\r') @@ -46,7 +46,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(2), [' foo', ' bar']); }); - it('CUU: Cursor Up Ps Times (default = 1) - CSI Ps A', async function(): Promise { + it('CUU: Cursor Up Ps Times (default = 1) - CSI Ps A', async function (): Promise { await page.evaluate(` // Default window.term.write('\\n\\n\\n\\n\x1b[Aa') @@ -56,7 +56,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(4), ['', ' b', '', 'a']); }); - it('CUD: Cursor Down Ps Times (default = 1) - CSI Ps B', async function(): Promise { + it('CUD: Cursor Down Ps Times (default = 1) - CSI Ps B', async function (): Promise { await page.evaluate(` // Default window.term.write('\x1b[Ba') @@ -66,7 +66,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(4), ['', 'a', '', ' b']); }); - it('CUF: Cursor Forward Ps Times (default = 1) - CSI Ps C', async function(): Promise { + it('CUF: Cursor Forward Ps Times (default = 1) - CSI Ps C', async function (): Promise { await page.evaluate(` // Default window.term.write('\x1b[Ca') @@ -76,7 +76,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(1), [' a b']); }); - it('CUB: Cursor Backward Ps Times (default = 1) - CSI Ps D', async function(): Promise { + it('CUB: Cursor Backward Ps Times (default = 1) - CSI Ps D', async function (): Promise { await page.evaluate(` // Default window.term.write('foo\x1b[Da') @@ -86,7 +86,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(1), ['fba']); }); - it('CNL: Cursor Next Line Ps Times (default = 1) - CSI Ps E', async function(): Promise { + it('CNL: Cursor Next Line Ps Times (default = 1) - CSI Ps E', async function (): Promise { await page.evaluate(` // Default window.term.write('\x1b[Ea') @@ -96,7 +96,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(4), ['', 'a', '', 'b']); }); - it('CPL: Cursor Preceding Line Ps Times (default = 1) - CSI Ps F', async function(): Promise { + it('CPL: Cursor Preceding Line Ps Times (default = 1) - CSI Ps F', async function (): Promise { await page.evaluate(` // Default window.term.write('\\n\\n\\n\\n\x1b[Fa') @@ -106,7 +106,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(5), ['', 'b', '', 'a', '']); }); - it('CHA: Cursor Character Absolute [column] (default = [row,1]) - CSI Ps G', async function(): Promise { + it('CHA: Cursor Character Absolute [column] (default = [row,1]) - CSI Ps G', async function (): Promise { await page.evaluate(` // Default window.term.write('foo\x1b[Ga') @@ -116,7 +116,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(1), ['aoo b']); }); - it('CUP: Cursor Position [row;column] (default = [1,1]) - CSI Ps ; Ps H', async function(): Promise { + it('CUP: Cursor Position [row;column] (default = [1,1]) - CSI Ps ; Ps H', async function (): Promise { await page.evaluate(` // Default window.term.write('foo\x1b[Ha') @@ -126,7 +126,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(3), ['aoo', '', ' b']); }); - it('CHT: Cursor Forward Tabulation Ps tab stops (default = 1) - CSI Ps I', async function(): Promise { + it('CHT: Cursor Forward Tabulation Ps tab stops (default = 1) - CSI Ps I', async function (): Promise { await page.evaluate(` // Default window.term.write('\x1b[Ia') @@ -136,7 +136,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(2), [' a', ' b']); }); - it('ED: Erase in Display, VT100 - CSI Ps J', async function(): Promise { + it('ED: Erase in Display, VT100 - CSI Ps J', async function (): Promise { const fixture = 'abc\\n\\rdef\\n\\rghi\x1b[2;2H'; await page.evaluate(` // Default: Erase Below @@ -165,7 +165,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(5), [' 4', ' 5', 'abc', 'def', 'ghi']); }); - it('DECSED: Erase in Display, VT220 - CSI ? Ps J', async function(): Promise { + it('DECSED: Erase in Display, VT220 - CSI ? Ps J', async function (): Promise { const fixture = 'abc\\n\\rdef\\n\\rghi\x1b[2;2H'; await page.evaluate(` // Default: Erase Below @@ -194,7 +194,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(5), [' 4', ' 5', 'abc', 'def', 'ghi']); }); - it('IL: Insert Ps Line(s) (default = 1) - CSI Ps L', async function(): Promise { + it('IL: Insert Ps Line(s) (default = 1) - CSI Ps L', async function (): Promise { await page.evaluate(` // Default window.term.write('foo\x1b[La') @@ -204,7 +204,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(4), ['b', '', 'a', 'foo']); }); - it('DL: Delete Ps Line(s) (default = 1) - CSI Ps M', async function(): Promise { + it('DL: Delete Ps Line(s) (default = 1) - CSI Ps M', async function (): Promise { await page.evaluate(` // Default window.term.write('a\\nb\x1b[1F\x1b[M') @@ -214,7 +214,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(5), [' b', ' f', '', '', '']); }); - it('DCH: Delete Ps Character(s) (default = 1) - CSI Ps P', async function(): Promise { + it('DCH: Delete Ps Character(s) (default = 1) - CSI Ps P', async function (): Promise { await page.evaluate(` // Default window.term.write('abc\x1b[1;1H\x1b[P') @@ -225,7 +225,7 @@ describe('InputHandler Integration Tests', function(): void { }); describe('DSR: Device Status Report', () => { - it('Status Report - CSI 5 n', async function(): Promise { + it('Status Report - CSI 5 n', async function (): Promise { await page.evaluate(` window.term.onData(e => window.result = e); window.term.write('\\x1b[5n'); @@ -233,7 +233,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => page.evaluate(`window.result`), '\x1b[0n'); }); - it('Report Cursor Position (CPR) - CSI 6 n', async function(): Promise { + it('Report Cursor Position (CPR) - CSI 6 n', async function (): Promise { await page.evaluate(`window.term.write('\\n\\nfoo')`); await pollFor(page, () => page.evaluate(` [window.term.buffer.cursorY, window.term.buffer.cursorX] @@ -245,7 +245,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => page.evaluate(`window.result`), '\x1b[3;4R'); }); - it('Report Cursor Position (DECXCPR) - CSI ? 6 n', async function(): Promise { + it('Report Cursor Position (DECXCPR) - CSI ? 6 n', async function (): Promise { await page.evaluate(`window.term.write('\\n\\nfoo')`); await pollFor(page, () => page.evaluate(` [window.term.buffer.cursorY, window.term.buffer.cursorX] @@ -260,8 +260,8 @@ describe('InputHandler Integration Tests', function(): void { describe('SM: Set Mode', () => { describe('CSI ? Pm h', () => { - it('Pm = 1003, Set Use All Motion (any event) Mouse Tracking', async() => { - const coords = await page.evaluate(` + it('Pm = 1003, Set Use All Motion (any event) Mouse Tracking', async () => { + const coords: any = await page.evaluate(` (function() { const rect = window.term.element.getBoundingClientRect(); return {left: rect.left, top: rect.top, bottom: rect.bottom, right: rect.right}; @@ -271,7 +271,7 @@ describe('InputHandler Integration Tests', function(): void { await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); await page.mouse.down(); await page.mouse.move((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 4); - assert.ok(await page.evaluate(`window.term.getSelection().length`) > 0, 'mouse events are off so there should be a selection'); + assert.ok(await page.evaluate(`window.term.getSelection().length`) as number > 0, 'mouse events are off so there should be a selection'); await page.mouse.up(); // Clear selection await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); @@ -286,7 +286,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => page.evaluate(`window.term.getSelection().length`), 0); await page.mouse.up(); }); - it('Pm = 2004, Set bracketed paste mode', async function(): Promise { + it('Pm = 2004, Set bracketed paste mode', async function (): Promise { await pollFor(page, () => simulatePaste('foo'), 'foo'); await page.evaluate(`window.term.write('\x1b[?2004h')`); await pollFor(page, () => simulatePaste('bar'), '\x1b[200~bar\x1b[201~'); @@ -296,7 +296,7 @@ describe('InputHandler Integration Tests', function(): void { }); }); - it('REP: Repeat preceding character, ECMA48 - CSI Ps b', async function(): Promise { + it('REP: Repeat preceding character, ECMA48 - CSI Ps b', async function (): Promise { // default to 1 await page.evaluate(` window.term.resize(10, 10); @@ -309,7 +309,7 @@ describe('InputHandler Integration Tests', function(): void { window.term.write('#\x1b[5b'); `); await pollFor(page, () => getLinesAsArray(4), ['##', '##', '##', '######']); - await pollFor(page, () => getCursor(), {col: 6, row: 3}); + await pollFor(page, () => getCursor(), { col: 6, row: 3 }); // should not repeat on fullwidth chars await page.evaluate(` window.term.reset(); @@ -347,7 +347,7 @@ describe('InputHandler Integration Tests', function(): void { }); describe('Window Options - CSI Ps ; Ps ; Ps t', () => { - it('should be disabled by default', async function() { + it('should be disabled by default', async function () { await page.evaluate(`(() => { window._stack = []; const _h = window.term.onData(data => window._stack.push(data)); @@ -360,7 +360,7 @@ describe('InputHandler Integration Tests', function(): void { })()`); await pollFor(page, async () => await page.evaluate(`(() => _stack)()`), []); }); - it('14 - GetWinSizePixels', async function() { + it('14 - GetWinSizePixels', async function () { await page.evaluate(`window.term.setOption('windowOptions', {getWinSizePixels: true});`); await page.evaluate(`(() => { window._stack = []; @@ -371,7 +371,7 @@ describe('InputHandler Integration Tests', function(): void { const d = await getDimensions(); await pollFor(page, async () => await page.evaluate(`(() => _stack)()`), [`\x1b[4;${d.height};${d.width}t`]); }); - it('16 - GetCellSizePixels', async function() { + it('16 - GetCellSizePixels', async function () { await page.evaluate(`window.term.setOption('windowOptions', {getCellSizePixels: true});`); await page.evaluate(`(() => { window._stack = []; @@ -397,7 +397,7 @@ describe('InputHandler Integration Tests', function(): void { window.term.resize(10, 4); window.term.write('\\x1b[?47l\\x1b8'); `); - await pollFor(page, () => getCursor(), {col: 1, row: 3}); + await pollFor(page, () => getCursor(), { col: 1, row: 3 }); }); }); }); @@ -434,7 +434,7 @@ async function simulatePaste(text: string): Promise { return await page.evaluate(`window.result_${id}`); } -async function getCursor(): Promise<{col: number, row: number}> { +async function getCursor(): Promise<{ col: number, row: number }> { return page.evaluate(` (function() { return {col: term.buffer.cursorX, row: term.buffer.cursorY}; @@ -443,7 +443,7 @@ async function getCursor(): Promise<{col: number, row: number}> { } async function getDimensions(): Promise { - const dim = await page.evaluate(`term._core._renderService.dimensions`); + const dim: any = await page.evaluate(`term._core._renderService.dimensions`); return { cellWidth: dim.actualCellWidth.toFixed(0), cellHeight: dim.actualCellHeight.toFixed(0), diff --git a/test/api/MouseTracking.api.ts b/test/api/MouseTracking.api.ts index 7cae660f..0fa4dfa1 100644 --- a/test/api/MouseTracking.api.ts +++ b/test/api/MouseTracking.api.ts @@ -3,14 +3,14 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; import { ITerminalOptions } from 'xterm'; -import { pollFor, writeSync } from './TestUtils'; +import { pollFor, writeSync, getBrowserType } from './TestUtils'; +import { Browser, Page } from 'playwright'; const APP = 'http://127.0.0.1:3000/test'; -let browser: puppeteer.Browser; -let page: puppeteer.Page; +let browser: Browser; +let page: Page; // adjusted to work inside devcontainer // see https://github.com/xtermjs/xterm.js/issues/2379 const width = 1280; @@ -46,7 +46,7 @@ async function resetMouseModes(): Promise { } async function getReports(encoding: string): Promise { - const reports = await page.evaluate(`window.calls`); + const reports: number[][] = await page.evaluate(`window.calls`); await page.evaluate(`window.calls = [];`); return reports.map((report: number[]) => parseReport(encoding, report)); } @@ -55,7 +55,7 @@ async function getReports(encoding: string): Promise { // always adds +2 in each direction so we dont end up in the wrong cell // due to rounding issues async function cellPos(col: number, row: number): Promise { - const coords = await page.evaluate(` + const coords: any = await page.evaluate(` (function() { const rect = window.term.element.getBoundingClientRect(); const dim = term._core._renderService.dimensions; @@ -66,7 +66,7 @@ async function cellPos(col: number, row: number): Promise { } /** - * Patched puppeteer functions. + * Patched playwright functions. * This is needed to: * - translate cell positions into pixel positions * - allow modifiers to be set @@ -77,10 +77,10 @@ async function mouseMove(col: number, row: number): Promise { return await page.mouse.move(xPixels, yPixels); } async function mouseDown(button: 'left' | 'right' | 'middle' | undefined): Promise { - return await page.mouse.down({button}); + return await page.mouse.down({ button }); } async function mouseUp(button: 'left' | 'right' | 'middle' | undefined): Promise { - return await page.mouse.up({button}); + return await page.mouse.up({ button }); } async function wheelUp(): Promise { const self = (page.mouse as any); @@ -106,24 +106,24 @@ async function wheelDown(): Promise { } // button definitions -const buttons: {[key: string]: number} = { - '': -1, - left: 0, - middle: 1, - right: 2, - released: 3, - wheelUp: 4, - wheelDown: 5, - wheelLeft: 6, +const buttons: { [key: string]: number } = { + '': -1, + left: 0, + middle: 1, + right: 2, + released: 3, + wheelUp: 4, + wheelDown: 5, + wheelLeft: 6, wheelRight: 7, - aux8: 8, - aux9: 9, - aux10: 10, - aux11: 11, - aux12: 12, - aux13: 13, - aux14: 14, - aux15: 15 + aux8: 8, + aux9: 9, + aux10: 10, + aux11: 11, + aux12: 12, + aux13: 13, + aux14: 14, + aux15: 15 }; const reverseButtons: any = {}; for (const el in buttons) { @@ -133,9 +133,9 @@ for (const el in buttons) { // extract button data from buttonCode function evalButtonCode(code: number): any { if (code > 255) { - return {button: 'invalid', action: 'invalid', modifier: {}}; + return { button: 'invalid', action: 'invalid', modifier: {} }; } - const modifier = {shift: !!(code & 4), meta: !!(code & 8), control: !!(code & 16)}; + const modifier = { shift: !!(code & 4), meta: !!(code & 8), control: !!(code & 16) }; const move = code & 32; let button = code & 3; if (code & 128) { @@ -156,11 +156,11 @@ function evalButtonCode(code: number): any { buttonS = 'wheel'; actionS = button === 4 ? 'up' : button === 5 ? 'down' : button === 6 ? 'left' : 'right'; } - return {button: buttonS, action: actionS, modifier}; + return { button: buttonS, action: actionS, modifier }; } // parse a single mouse report -function parseReport(encoding: string, msg: number[]): {state: any; row: number; col: number; } | string { +function parseReport(encoding: string, msg: number[]): { state: any; row: number; col: number; } | string { let sReport: string; let buttonCode: number; let row: number; @@ -185,7 +185,7 @@ function parseReport(encoding: string, msg: number[]): {state: any; row: number; if (report[report.length - 1] === 'm') { state.action = 'release'; } - return {state, row, col}; + return { state, row, col }; default: return { state: evalButtonCode(report.charCodeAt(3) - 32), @@ -199,12 +199,12 @@ function parseReport(encoding: string, msg: number[]): {state: any; row: number; * Mouse tracking tests. */ describe('Mouse Tracking Tests', () => { - before(async function(): Promise { - browser = await puppeteer.launch({ + before(async function (): Promise { + browser = await getBrowserType().launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); - page = (await browser.pages())[0]; + page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); }); @@ -242,7 +242,7 @@ describe('Mouse Tracking Tests', () => { // test at 0,0 await mouseDown('left'); - await pollFor(page, () => getReports(encoding), [{col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 1, row: 1, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); // mouseup should not report await mouseUp('left'); @@ -253,14 +253,14 @@ describe('Mouse Tracking Tests', () => { await pollFor(page, () => getReports(encoding), []); await mouseDown('left'); await mouseUp('left'); - await pollFor(page, () => getReports(encoding), [{col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 51, row: 11, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); // test at max rows/cols // capped at 223 (1-based) await mouseMove(223 - 1, rows - 1); await mouseDown('left'); await mouseUp('left'); - await pollFor(page, () => getReports(encoding), [{col: 223, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 223, row: rows, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); // higher than 223 should not report at all await mouseMove(257, rows - 1); @@ -275,7 +275,7 @@ describe('Mouse Tracking Tests', () => { await mouseDown('left'); await mouseMove(44, 24); await mouseUp('left'); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) // await mouseMove(43, 24); @@ -291,7 +291,7 @@ describe('Mouse Tracking Tests', () => { await mouseDown('right'); await mouseMove(44, 24); await mouseUp('right'); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'press', button: 'right', modifier: { control: false, shift: false, meta: false } } }]); // wheel await mouseMove(43, 24); @@ -311,7 +311,7 @@ describe('Mouse Tracking Tests', () => { await mouseUp('left'); await wheelDown(); await page.keyboard.up('Control'); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); // ALT @@ -323,7 +323,7 @@ describe('Mouse Tracking Tests', () => { await mouseUp('left'); await wheelDown(); await page.keyboard.up('Alt'); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); // SHIFT // note: caught by selection manager @@ -341,7 +341,7 @@ describe('Mouse Tracking Tests', () => { await pollFor(page, () => getReports(encoding), []); } else { await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); } @@ -359,7 +359,7 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Control'); await page.keyboard.up('Alt'); // await page.keyboard.up('Shift'); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); }); it('SGR encoding', async () => { const encoding = 'SGR'; @@ -369,7 +369,7 @@ describe('Mouse Tracking Tests', () => { // test at 0,0 await mouseDown('left'); - await pollFor(page, () => getReports(encoding), [{col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 1, row: 1, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); // mouseup should not report await mouseUp('left'); @@ -380,13 +380,13 @@ describe('Mouse Tracking Tests', () => { await pollFor(page, () => getReports(encoding), []); await mouseDown('left'); await mouseUp('left'); - await pollFor(page, () => getReports(encoding), [{col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 51, row: 11, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); // test at max rows/cols await mouseMove(cols - 1, rows - 1); await mouseDown('left'); await mouseUp('left'); - await pollFor(page, () => getReports(encoding), [{col: cols, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: cols, row: rows, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); // button press/move/release tests // left button @@ -395,7 +395,7 @@ describe('Mouse Tracking Tests', () => { await mouseDown('left'); await mouseMove(44, 24); await mouseUp('left'); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) // await mouseMove(43, 24); @@ -411,7 +411,7 @@ describe('Mouse Tracking Tests', () => { await mouseDown('right'); await mouseMove(44, 24); await mouseUp('right'); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'press', button: 'right', modifier: { control: false, shift: false, meta: false } } }]); // wheel await mouseMove(43, 24); @@ -431,7 +431,7 @@ describe('Mouse Tracking Tests', () => { await mouseUp('left'); await wheelDown(); await page.keyboard.up('Control'); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); // ALT @@ -443,7 +443,7 @@ describe('Mouse Tracking Tests', () => { await mouseUp('left'); await wheelDown(); await page.keyboard.up('Alt'); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); // SHIFT // note: caught by selection manager @@ -459,7 +459,7 @@ describe('Mouse Tracking Tests', () => { await pollFor(page, () => getReports(encoding), []); } else { await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); } @@ -477,7 +477,7 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Control'); await page.keyboard.up('Alt'); // await page.keyboard.up('Shift'); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }]); }); }); describe('DECSET 1000 (VT200 mouse)', () => { @@ -497,13 +497,13 @@ describe('Mouse Tracking Tests', () => { // test at 0,0 await mouseDown('left'); await pollFor(page, () => getReports(encoding), [ - {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 1, row: 1, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // mouseup should report, encoding cannot report released button await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 1, row: 1, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 1, row: 1, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // mousemove should not report @@ -512,8 +512,8 @@ describe('Mouse Tracking Tests', () => { await mouseDown('left'); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 51, row: 11, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 51, row: 11, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // test at max rows/cols @@ -522,8 +522,8 @@ describe('Mouse Tracking Tests', () => { await mouseDown('left'); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 223, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 223, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 223, row: rows, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 223, row: rows, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // button press/move/release tests @@ -534,8 +534,8 @@ describe('Mouse Tracking Tests', () => { await mouseMove(44, 24); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -553,17 +553,17 @@ describe('Mouse Tracking Tests', () => { await mouseMove(44, 24); await mouseUp('right'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'right', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports await wheelUp(); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'up', button: 'wheel', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'up', button: 'wheel', modifier: { control: false, shift: false, meta: false } } }]); await wheelDown(); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: false, meta: false } } }]); // modifiers // CTRL @@ -576,9 +576,9 @@ describe('Mouse Tracking Tests', () => { await wheelDown(); await page.keyboard.up('Control'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: true, shift: false, meta: false } } } ]); // ALT @@ -591,9 +591,9 @@ describe('Mouse Tracking Tests', () => { await wheelDown(); await page.keyboard.up('Alt'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: false, meta: true } } } ]); // SHIFT @@ -609,13 +609,13 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Shift'); if (noShift) { await pollFor(page, () => getReports(encoding), [ - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: true, meta: false}}} + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: true, meta: false } } } ]); } else { await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: true, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: true, meta: false } } } ]); } @@ -634,9 +634,9 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Alt'); // await page.keyboard.up('Shift'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: true}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: true, shift: false, meta: true } } } ]); }); it('SGR encoding', async () => { @@ -648,13 +648,13 @@ describe('Mouse Tracking Tests', () => { // test at 0,0 await mouseDown('left'); await pollFor(page, () => getReports(encoding), [ - {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 1, row: 1, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // mouseup should report await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 1, row: 1, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 1, row: 1, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // mousemove should not report @@ -663,8 +663,8 @@ describe('Mouse Tracking Tests', () => { await mouseDown('left'); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 51, row: 11, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 51, row: 11, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // test at max rows/cols @@ -672,8 +672,8 @@ describe('Mouse Tracking Tests', () => { await mouseDown('left'); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: cols, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: cols, row: rows, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: cols, row: rows, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: cols, row: rows, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // button press/move/release tests @@ -684,8 +684,8 @@ describe('Mouse Tracking Tests', () => { await mouseMove(44, 24); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -703,17 +703,17 @@ describe('Mouse Tracking Tests', () => { await mouseMove(44, 24); await mouseUp('right'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'right', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'right', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: 'right', modifier: { control: false, shift: false, meta: false } } } ]); // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports await wheelUp(); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'up', button: 'wheel', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'up', button: 'wheel', modifier: { control: false, shift: false, meta: false } } }]); await wheelDown(); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: false, meta: false } } }]); // modifiers // CTRL @@ -726,9 +726,9 @@ describe('Mouse Tracking Tests', () => { await wheelDown(); await page.keyboard.up('Control'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: true, shift: false, meta: false } } } ]); // ALT @@ -741,9 +741,9 @@ describe('Mouse Tracking Tests', () => { await wheelDown(); await page.keyboard.up('Alt'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: false, meta: true } } } ]); // SHIFT @@ -758,13 +758,13 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Shift'); if (noShift) { await pollFor(page, () => getReports(encoding), [ - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: true, meta: false}}} + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: true, meta: false } } } ]); } else { await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: true, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: true, meta: false } } } ]); } @@ -783,9 +783,9 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Alt'); // await page.keyboard.up('Shift'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: true}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: true, shift: false, meta: true } } } ]); }); }); @@ -806,13 +806,13 @@ describe('Mouse Tracking Tests', () => { // test at 0,0 await mouseDown('left'); await pollFor(page, () => getReports(encoding), [ - {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 1, row: 1, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // mouseup should report, encoding cannot report released button await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 1, row: 1, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 1, row: 1, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // mousemove should not report @@ -821,8 +821,8 @@ describe('Mouse Tracking Tests', () => { await mouseDown('left'); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 51, row: 11, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 51, row: 11, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // test at max rows/cols @@ -831,8 +831,8 @@ describe('Mouse Tracking Tests', () => { await mouseDown('left'); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 223, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 223, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 223, row: rows, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 223, row: rows, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // button press/move/release tests @@ -843,9 +843,9 @@ describe('Mouse Tracking Tests', () => { await mouseMove(44, 24); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -863,18 +863,18 @@ describe('Mouse Tracking Tests', () => { await mouseMove(44, 24); await mouseUp('right'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'right', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'right', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports await wheelUp(); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'up', button: 'wheel', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'up', button: 'wheel', modifier: { control: false, shift: false, meta: false } } }]); await wheelDown(); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: false, meta: false } } }]); // modifiers // CTRL @@ -887,10 +887,10 @@ describe('Mouse Tracking Tests', () => { await wheelDown(); await page.keyboard.up('Control'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: true, shift: false, meta: false } } } ]); // ALT @@ -903,10 +903,10 @@ describe('Mouse Tracking Tests', () => { await wheelDown(); await page.keyboard.up('Alt'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: false, meta: true } } } ]); // SHIFT @@ -921,14 +921,14 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Shift'); if (noShift) { await pollFor(page, () => getReports(encoding), [ - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: true, meta: false}}} + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: true, meta: false } } } ]); } else { await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: true, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: true, meta: false } } } ]); } @@ -947,10 +947,10 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Alt'); // await page.keyboard.up('Shift'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: true}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: true, shift: false, meta: true } } } ]); }); it('SGR encoding', async () => { @@ -963,13 +963,13 @@ describe('Mouse Tracking Tests', () => { // bug: release is fired immediately await mouseDown('left'); await pollFor(page, () => getReports(encoding), [ - {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 1, row: 1, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // mouseup should report, encoding cannot report released button await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 1, row: 1, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 1, row: 1, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // mousemove should not report @@ -978,8 +978,8 @@ describe('Mouse Tracking Tests', () => { await mouseDown('left'); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 51, row: 11, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 51, row: 11, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // test at max rows/cols @@ -987,8 +987,8 @@ describe('Mouse Tracking Tests', () => { await mouseDown('left'); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: cols, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: cols, row: rows, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: cols, row: rows, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: cols, row: rows, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // button press/move/release tests @@ -999,9 +999,9 @@ describe('Mouse Tracking Tests', () => { await mouseMove(44, 24); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -1019,18 +1019,18 @@ describe('Mouse Tracking Tests', () => { await mouseMove(44, 24); await mouseUp('right'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'right', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'right', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'right', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: 'right', modifier: { control: false, shift: false, meta: false } } } ]); // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports await wheelUp(); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'up', button: 'wheel', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'up', button: 'wheel', modifier: { control: false, shift: false, meta: false } } }]); await wheelDown(); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: false, meta: false } } }]); // modifiers // CTRL @@ -1043,10 +1043,10 @@ describe('Mouse Tracking Tests', () => { await wheelDown(); await page.keyboard.up('Control'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: true, shift: false, meta: false } } } ]); // ALT @@ -1059,10 +1059,10 @@ describe('Mouse Tracking Tests', () => { await wheelDown(); await page.keyboard.up('Alt'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: false, meta: true } } } ]); // SHIFT @@ -1077,14 +1077,14 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Shift'); if (noShift) { await pollFor(page, () => getReports(encoding), [ - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: true, meta: false}}} + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: true, meta: false } } } ]); } else { await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: true, meta: false}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: true, meta: false } } } ]); } @@ -1103,10 +1103,10 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Alt'); // await page.keyboard.up('Shift'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: true}}} + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: true, shift: false, meta: true } } } ]); }); }); @@ -1124,25 +1124,25 @@ describe('Mouse Tracking Tests', () => { // test at 0,0 await mouseDown('left'); await pollFor(page, () => getReports(encoding), [ - {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 1, row: 1, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // mouseup should report, encoding cannot report released button await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 1, row: 1, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 1, row: 1, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // mousemove should report await mouseMove(50, 10); await pollFor(page, () => getReports(encoding), [ - {col: 51, row: 11, state: {action: 'move', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 51, row: 11, state: { action: 'move', button: '', modifier: { control: false, shift: false, meta: false } } } ]); await mouseDown('left'); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 51, row: 11, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 51, row: 11, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // test at max rows/cols @@ -1151,9 +1151,9 @@ describe('Mouse Tracking Tests', () => { await mouseDown('left'); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 223, row: rows, state: {action: 'move', button: '', modifier: {control: false, shift: false, meta: false}}}, - {col: 223, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 223, row: rows, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 223, row: rows, state: { action: 'move', button: '', modifier: { control: false, shift: false, meta: false } } }, + { col: 223, row: rows, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 223, row: rows, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // button press/move/release tests @@ -1163,10 +1163,10 @@ describe('Mouse Tracking Tests', () => { await mouseMove(44, 24); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: false, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: false, shift: false, meta: false } } }, + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -1183,19 +1183,19 @@ describe('Mouse Tracking Tests', () => { await mouseMove(44, 24); await mouseUp('right'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: false, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: false, shift: false, meta: false } } }, + { col: 44, row: 25, state: { action: 'press', button: 'right', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'right', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: false } } } ]); // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports await wheelUp(); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'up', button: 'wheel', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'up', button: 'wheel', modifier: { control: false, shift: false, meta: false } } }]); await wheelDown(); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: false, meta: false } } }]); // modifiers // CTRL @@ -1207,11 +1207,11 @@ describe('Mouse Tracking Tests', () => { await wheelDown(); await page.keyboard.up('Control'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: true, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: true, shift: false, meta: false } } }, + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: true, shift: false, meta: false } } } ]); // ALT @@ -1223,11 +1223,11 @@ describe('Mouse Tracking Tests', () => { await wheelDown(); await page.keyboard.up('Alt'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: false, shift: false, meta: true}}}, - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: false, shift: false, meta: true } } }, + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: false, meta: true } } } ]); // SHIFT @@ -1241,16 +1241,16 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Shift'); if (noShift) { await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: true, meta: false}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: true, meta: false } } } ]); } else { await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: false, shift: true, meta: false}}}, - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: true, meta: false}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: false, shift: true, meta: false } } }, + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: true, meta: false } } } ]); } @@ -1268,11 +1268,11 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Alt'); // await page.keyboard.up('Shift'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: true, shift: false, meta: true}}}, - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'release', button: '', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: true}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: true, shift: false, meta: true } } }, + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'release', button: '', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: true, shift: false, meta: true } } } ]); }); it('SGR encoding', async () => { @@ -1284,25 +1284,25 @@ describe('Mouse Tracking Tests', () => { // test at 0,0 await mouseDown('left'); await pollFor(page, () => getReports(encoding), [ - {col: 1, row: 1, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 1, row: 1, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // mouseup should report, encoding cannot report released button await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 1, row: 1, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 1, row: 1, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // mousemove should report await mouseMove(50, 10); await pollFor(page, () => getReports(encoding), [ - {col: 51, row: 11, state: {action: 'move', button: '', modifier: {control: false, shift: false, meta: false}}} + { col: 51, row: 11, state: { action: 'move', button: '', modifier: { control: false, shift: false, meta: false } } } ]); await mouseDown('left'); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 51, row: 11, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 51, row: 11, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 51, row: 11, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 51, row: 11, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // test at max rows/cols @@ -1312,9 +1312,9 @@ describe('Mouse Tracking Tests', () => { await mouseDown('left'); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: cols, row: rows, state: {action: 'move', button: '', modifier: {control: false, shift: false, meta: false}}}, - {col: cols, row: rows, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: cols, row: rows, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: cols, row: rows, state: { action: 'move', button: '', modifier: { control: false, shift: false, meta: false } } }, + { col: cols, row: rows, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: cols, row: rows, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // button press/move/release tests @@ -1324,10 +1324,10 @@ describe('Mouse Tracking Tests', () => { await mouseMove(44, 24); await mouseUp('left'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: false, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: false, shift: false, meta: false } } }, + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: false } } } ]); // middle button // bug: default action not cancelled (adds data to getReports from clipboard under X11) @@ -1344,19 +1344,19 @@ describe('Mouse Tracking Tests', () => { await mouseMove(44, 24); await mouseUp('right'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: false, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'press', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'right', modifier: {control: false, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'right', modifier: {control: false, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: false, shift: false, meta: false } } }, + { col: 44, row: 25, state: { action: 'press', button: 'right', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'right', modifier: { control: false, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: 'right', modifier: { control: false, shift: false, meta: false } } } ]); // wheel await mouseMove(43, 24); await getReports(encoding); // clear reports await wheelUp(); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'up', button: 'wheel', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'up', button: 'wheel', modifier: { control: false, shift: false, meta: false } } }]); await wheelDown(); - await pollFor(page, () => getReports(encoding), [{col: 44, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: false}}}]); + await pollFor(page, () => getReports(encoding), [{ col: 44, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: false, meta: false } } }]); // modifiers // CTRL @@ -1368,11 +1368,11 @@ describe('Mouse Tracking Tests', () => { await wheelDown(); await page.keyboard.up('Control'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: true, shift: false, meta: false}}}, - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: true, shift: false, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: false}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: true, shift: false, meta: false } } }, + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: true, shift: false, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: true, shift: false, meta: false } } } ]); // ALT @@ -1384,11 +1384,11 @@ describe('Mouse Tracking Tests', () => { await wheelDown(); await page.keyboard.up('Alt'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: false, shift: false, meta: true}}}, - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: false, meta: true}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: false, shift: false, meta: true } } }, + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: false, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: false, meta: true } } } ]); // SHIFT @@ -1402,16 +1402,16 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Shift'); if (noShift) { await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: true, meta: false}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: true, meta: false } } } ]); } else { await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: false, shift: true, meta: false}}}, - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: false, shift: true, meta: false}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: false, shift: true, meta: false}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: false, shift: true, meta: false } } }, + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: false, shift: true, meta: false } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: false, shift: true, meta: false } } } ]); } @@ -1429,17 +1429,17 @@ describe('Mouse Tracking Tests', () => { await page.keyboard.up('Alt'); // await page.keyboard.up('Shift'); await pollFor(page, () => getReports(encoding), [ - {col: 44, row: 25, state: {action: 'move', button: '', modifier: {control: true, shift: false, meta: true}}}, - {col: 44, row: 25, state: {action: 'press', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'move', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'release', button: 'left', modifier: {control: true, shift: false, meta: true}}}, - {col: 45, row: 25, state: {action: 'down', button: 'wheel', modifier: {control: true, shift: false, meta: true}}} + { col: 44, row: 25, state: { action: 'move', button: '', modifier: { control: true, shift: false, meta: true } } }, + { col: 44, row: 25, state: { action: 'press', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'move', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'release', button: 'left', modifier: { control: true, shift: false, meta: true } } }, + { col: 45, row: 25, state: { action: 'down', button: 'wheel', modifier: { control: true, shift: false, meta: true } } } ]); }); }); /** * move tests with multiple buttons pressed: - * currently not possible due to a limitation of the puppeteer mouse interface + * currently not possible due to a limitation of the playwright mouse interface * (saves only the last one pressed) */ }); diff --git a/test/api/Parser.api.ts b/test/api/Parser.api.ts index 72f56799..656f2ba3 100644 --- a/test/api/Parser.api.ts +++ b/test/api/Parser.api.ts @@ -3,25 +3,25 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; import { assert } from 'chai'; import { ITerminalOptions } from 'xterm'; -import { writeSync } from './TestUtils'; +import { writeSync, getBrowserType } from './TestUtils'; +import { Browser, Page } from 'playwright'; const APP = 'http://127.0.0.1:3000/test'; -let browser: puppeteer.Browser; -let page: puppeteer.Page; +let browser: Browser; +let page: Page; const width = 800; const height = 600; -describe('Parser Integration Tests', function(): void { - before(async function(): Promise { - browser = await puppeteer.launch({ +describe('Parser Integration Tests', function (): void { + before(async function (): Promise { + browser = await getBrowserType().launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); - page = (await browser.pages())[0]; + page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); await page.goto(APP); await openTerminal(); diff --git a/test/api/Terminal.api.ts b/test/api/Terminal.api.ts index 36966bfb..4d2ce7fa 100644 --- a/test/api/Terminal.api.ts +++ b/test/api/Terminal.api.ts @@ -3,25 +3,25 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; import { assert } from 'chai'; import { ITerminalOptions } from 'xterm'; -import { pollFor, timeout, writeSync } from './TestUtils'; +import { pollFor, timeout, writeSync, getBrowserType } from './TestUtils'; +import { Browser, Page } from 'playwright'; const APP = 'http://127.0.0.1:3000/test'; -let browser: puppeteer.Browser; -let page: puppeteer.Page; +let browser: Browser; +let page: Page; const width = 800; const height = 600; -describe('API Integration Tests', function(): void { +describe('API Integration Tests', function (): void { before(async () => { - browser = await puppeteer.launch({ + browser = await getBrowserType().launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); - page = (await browser.pages())[0]; + page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); }); @@ -713,7 +713,7 @@ async function getCellCoordinates(dimensions: IDimensions, col: number, row: num }; } -async function moveMouseCell(page: puppeteer.Page, dimensions: IDimensions, col: number, row: number) { +async function moveMouseCell(page: Page, dimensions: IDimensions, col: number, row: number) { const coords = await getCellCoordinates(dimensions, col, row); await page.mouse.move(coords.x, coords.y); } diff --git a/test/api/TestUtils.ts b/test/api/TestUtils.ts index d3674812..5ee88082 100644 --- a/test/api/TestUtils.ts +++ b/test/api/TestUtils.ts @@ -3,10 +3,11 @@ * @license MIT */ -import * as puppeteer from 'puppeteer'; +// import * as playwright from 'playwright'; +import * as playwright from 'playwright'; import deepEqual = require('deep-equal'); -export async function pollFor(page: puppeteer.Page, evalOrFn: string | (() => Promise), val: T, preFn?: () => Promise): Promise { +export async function pollFor(page: playwright.Page, evalOrFn: string | (() => Promise), val: T, preFn?: () => Promise): Promise { if (preFn) { await preFn(); } @@ -18,7 +19,7 @@ export async function pollFor(page: puppeteer.Page, evalOrFn: string | (() => } } -export async function writeSync(page: puppeteer.Page, data: string): Promise { +export async function writeSync(page: playwright.Page, data: string): Promise { await page.evaluate(` window.ready = false; window.term.write('${data}', () => window.ready = true); @@ -29,3 +30,18 @@ export async function writeSync(page: puppeteer.Page, data: string): Promise { return new Promise(r => setTimeout(r, ms)); } + +export function getBrowserType(): playwright.BrowserType { + // Default to chromium + let browserType: playwright.BrowserType = playwright['chromium']; + + const index = process.argv.indexOf('--browser'); + if (index !== -1 && process.argv.length > index + 2 && typeof process.argv[index + 1] === 'string') { + const string = process.argv[index + 1]; + if (string === 'firefox' || string === 'webkit') { + browserType = playwright[string]; + } + } + + return browserType; +} diff --git a/yarn.lock b/yarn.lock index 22e3acc6..f19014b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -130,6 +130,11 @@ resolved "https://registry.yarnpkg.com/@types/cli-table/-/cli-table-0.3.0.tgz#f1857156bf5fd115c6a2db260ba0be1f8fc5671c" integrity sha512-QnZUISJJXyhyD6L1e5QwXDV/A5i2W1/gl6D6YMc8u0ncPepbv/B4w3S+izVvtAg60m6h+JP09+Y/0zF2mojlFQ== +"@types/debug@^4.1.5": + version "4.1.5" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" + integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ== + "@types/deep-equal@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/deep-equal/-/deep-equal-1.0.1.tgz#71cfabb247c22bcc16d536111f50c0ed12476b03" @@ -447,6 +452,13 @@ agent-base@^4.1.0: dependencies: es6-promisify "^5.0.0" +agent-base@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" + integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== + dependencies: + es6-promisify "^5.0.0" + ajv-errors@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" @@ -2451,6 +2463,14 @@ https-proxy-agent@^2.2.1: agent-base "^4.1.0" debug "^3.1.0" +https-proxy-agent@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz#b8c286433e87602311b01c8ea34413d856a4af81" + integrity sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg== + dependencies: + agent-base "^4.3.0" + debug "^3.1.0" + iconv-lite@0.4.19: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -2843,6 +2863,11 @@ javascript-natural-sort@0.7.1: resolved "https://registry.yarnpkg.com/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz#f9e2303d4507f6d74355a73664d1440fb5a0ef59" integrity sha1-+eIwPUUH9tdDVac2ZNFED7Wg71k= +jpeg-js@^0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.3.6.tgz#c40382aac9506e7d1f2d856eb02f6c7b2a98b37c" + integrity sha512-MUj2XlMB8kpe+8DJUGH/3UJm4XpI8XEgZQ+CiHDeyrGoKPdW/8FJv6ku+3UiYm5Fz3CWaL+iXmD8Q4Ap6aC1Jw== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -4001,11 +4026,40 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" +playwright-core@=0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-0.10.0.tgz#86699c9cc3e613d733e6635a54aceea1993013d5" + integrity sha512-yernA6yrrBhmb8M5eO6GZsJOrBKWOZszlu65Luz8LP7ryaDExN1sE9XjQBNbiwJ5Gfs8cehtAO7GfTDJt+Z2cQ== + dependencies: + debug "^4.1.0" + extract-zip "^1.6.6" + https-proxy-agent "^3.0.0" + jpeg-js "^0.3.6" + mime "^2.0.3" + pngjs "^3.4.0" + progress "^2.0.3" + proxy-from-env "^1.0.0" + rimraf "^2.6.1" + uuid "^3.4.0" + ws "^6.1.0" + +playwright@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/playwright/-/playwright-0.10.0.tgz#d37f7e42e0e868dcc4ec35cb0a8dbc6248457642" + integrity sha512-f3VRME/PIO5NbcWnlCDfXwPC0DAZJ7ETkcAdE+sensLCOkfDtLh97E71ZuxNCaPYsUA6FIPi5syD8pHJW/4hQQ== + dependencies: + playwright-core "=0.10.0" + pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== +pngjs@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f" + integrity sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w== + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -4026,7 +4080,7 @@ process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= -progress@^2.0.1: +progress@^2.0.1, progress@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== @@ -5342,6 +5396,11 @@ uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== +uuid@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + v8-compile-cache@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.2.tgz#a428b28bb26790734c4fc8bc9fa106fccebf6a6c"