Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: unflake 'should fill japanese text' (#16431)

Max Schmitte911eead9b89
diff --git a/tests/library/inspector/cli-codegen-1.spec.ts b/tests/library/inspector/cli-codegen-1.spec.ts
index fbb8c61103..28662b91fb 100644
--- a/tests/library/inspector/cli-codegen-1.spec.ts
+++ b/tests/library/inspector/cli-codegen-1.spec.ts
@@ -268,18 +268,13 @@ test.describe('cli codegen', () => {
const selector = await recorder.focusElement('input');
expect(selector).toBe('input[name="name"]');
- async function inputText(text: string) {
- await recorder.page.dispatchEvent(selector, 'keydown', { key: 'Process' });
- await recorder.page.keyboard.insertText(text);
- await recorder.page.dispatchEvent(selector, 'keyup', { key: 'Process' });
- }
const [message, sources] = await Promise.all([
page.waitForEvent('console', msg => msg.type() !== 'error'),
recorder.waitForOutput('JavaScript', 'fill'),
(async () => {
- await inputText('て');
- await inputText('す');
- await inputText('と');
+ await recorder.page.dispatchEvent(selector, 'keydown', { key: 'Process' });
+ await recorder.page.keyboard.insertText('てすと');
+ await recorder.page.dispatchEvent(selector, 'keyup', { key: 'Process' });
})()
]);
expect(sources.get('JavaScript').text).toContain(`