From a4c40fff8206869b227b69131f4c9b907f868c2a Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Wed, 5 Feb 2020 16:07:25 -0800 Subject: [PATCH] test: make sure `page.fill` actually clears an input (#851) --- test/page.spec.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/page.spec.js b/test/page.spec.js index 4c712e76e2..e29cd6f44c 100644 --- a/test/page.spec.js +++ b/test/page.spec.js @@ -1132,6 +1132,13 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF await page.fill('input', '').catch(e => error = e); expect(error.message).toContain('Cannot type text into input[type=number].'); }); + it('should be able to clear', async({page, server}) => { + await page.goto(server.PREFIX + '/input/textarea.html'); + await page.fill('input', 'some value'); + expect(await page.evaluate(() => result)).toBe('some value'); + await page.fill('input', ''); + expect(await page.evaluate(() => result)).toBe(''); + }); }); describe('Page.Events.Close', function() {