Migrate webgl to playwright/test, add unified runner script

This commit is contained in:
Daniel Imms
2023-09-08 10:04:25 -07:00
parent e54755b074
commit 070d194c6c
7 changed files with 1216 additions and 1173 deletions
+8 -3
View File
@@ -12,8 +12,6 @@ import * as playwright from '@playwright/test';
import { PageFunction } from 'playwright-core/types/structs';
import { IBuffer, IBufferCell, IBufferLine, IBufferNamespace, IBufferRange, IDecoration, IDecorationOptions, IModes, ITerminalInitOnlyOptions, ITerminalOptions, Terminal } from 'xterm';
import { EventEmitter } from '../../out/common/EventEmitter';
// TODO: We could avoid needing this
import deepEqual = require('deep-equal');
export interface ITestContext {
browser: Browser;
@@ -387,7 +385,14 @@ export async function pollFor<T>(page: playwright.Page, evalOrFn: string | (() =
console.log('pollFor\n actual: ', JSON.stringify(result), ' expected: ', JSON.stringify(val));
}
if (!deepEqual(result, val)) {
let equalityCheck = true;
try {
deepStrictEqual(result, val);
} catch (e) {
equalityCheck = false;
}
if (!equalityCheck) {
if (maxDuration === undefined) {
maxDuration = 2000;
}