From ee2321180f4ae68c6c5752a389dda96bb7df4733 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 2 Jun 2026 13:53:20 +0200 Subject: [PATCH] chore: Revert "chore: remove kmx-specific keyboard tests" This reverts commit 29618fb9437b2fae99e4150e85a6b0059eb8b944. --- web/src/test/auto/e2e/keyboard.tests.ts | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/web/src/test/auto/e2e/keyboard.tests.ts b/web/src/test/auto/e2e/keyboard.tests.ts index a9f2c0b69e..590da8a840 100644 --- a/web/src/test/auto/e2e/keyboard.tests.ts +++ b/web/src/test/auto/e2e/keyboard.tests.ts @@ -3,6 +3,37 @@ */ import { test, expect, type Page, type Locator } from '@playwright/test'; +test.describe('KMX keyboards', function () { + let textarea: Locator; + const beforeEach = async (page: Page) => { + await page.goto('http://localhost:3000/src/test/manual/web/kmxkeyboard.html?type=kmx'); + await page.evaluate(async () => { await window.KmwLoaded; }); + textarea = page.locator('#inputarea'); + await textarea.click(); + // we don't have a OSK yet, so don't wait for it to appear + } + + test('can type on a (simulated) hardware keyboard', async ({ page }) => { + await beforeEach(page); + await page.keyboard.press('x'); + await page.keyboard.press('j'); + await page.keyboard.press('m'); + await page.keyboard.press('Shift+e'); + await page.keyboard.press('r'); + await expect(textarea).toHaveValue('ខ្មែរ', { timeout: 500 }); + }); + + test('can type on a (simulated) hardware keyboard with reordering', async ({ page }) => { + await beforeEach(page); + await page.keyboard.press('x'); + await page.keyboard.press('Shift+e'); + await page.keyboard.press('j'); + await page.keyboard.press('m'); + await page.keyboard.press('r'); + await expect(textarea).toHaveValue('ខ្មែរ', { timeout: 500 }); + }); +}); + test.describe('JS keyboards', function () { let textarea: Locator; const beforeEach = async (page: Page) => {