Files
threshold-ui/e2e-tests/desktop/fixtures/tesseractTest.js
T
Zhihe Li 3b32195271 feat: 🎸 Use OCR for E2E tests when comparing terminal (#2639)
* feat: 🎸 add OCR to interpret terminal
2025-02-19 13:21:33 -05:00

24 lines
536 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { test } from '@playwright/test';
import { createWorker } from 'tesseract.js';
export const textToMatch =
/To run a command as administrator|Welcome to OpenSSH Server/;
export const tesseractTest = test.extend({
tesseract: [
async ({}, use) => {
const worker = await createWorker('eng', 1, {
cachePath: './artifacts',
});
await use(worker);
await worker.terminate();
},
{ scope: 'worker' },
],
});