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

This commit is contained in:
Max Schmitt 2022-08-11 08:48:55 +02:00 committed by GitHub
parent ae7d767e58
commit e911eead9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(`