Merge branch 'master' of https://github.com/xtermjs/xterm.js into playwright

This commit is contained in:
Jon Bockhorst
2020-02-12 23:53:53 -06:00
22 changed files with 478 additions and 692 deletions
@@ -4,8 +4,8 @@
*/
import * as playwright from 'playwright';
import { ITerminalOptions } from 'xterm';
import { assert } from 'chai';
import { openTerminal } from '../../../out-test/api/TestUtils';
const APP = 'http://127.0.0.1:3000/test';
@@ -32,7 +32,7 @@ describe('Unicode11Addon', () => {
beforeEach(async function(): Promise<any> {
this.timeout(20000);
await page.goto(APP);
await openTerminal();
await openTerminal(page);
});
it('wcwidth V11 emoji test', async () => {
@@ -49,28 +49,3 @@ describe('Unicode11Addon', () => {
assert.deepEqual(await page.evaluate(`window.term._core.unicodeService.getStringCellWidth('🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣')`), 20);
});
});
async function openTerminal(options: ITerminalOptions = {}): Promise<void> {
await page.evaluate(`window.term = new Terminal(${JSON.stringify(options)})`);
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
if (options.rendererType === 'dom') {
await page.waitForSelector('.xterm-rows');
} else {
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;
}
+10 -2
View File
@@ -13,14 +13,22 @@
"strict": true,
"baseUrl": ".",
"paths": {
"common/*": [ "../../../src/common/*" ]
"common/*": [
"../../../src/common/*"
]
},
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
],
"references": [
{ "path": "../../../src/common" }
{
"path": "../../../src/common"
}
]
}