Skip to content

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

test: should fill programmatically enabled textarea (#36319)

Simon Knottfa9d67ebf14e
diff --git a/tests/page/locator-misc-2.spec.ts b/tests/page/locator-misc-2.spec.ts
index 45d1c79da5..d3090ad861 100644
--- a/tests/page/locator-misc-2.spec.ts
+++ b/tests/page/locator-misc-2.spec.ts
@@ -184,3 +184,20 @@ it('Locator.locator() and FrameLocator.locator() should accept locator', async (
expect(await divLocator.locator('input').inputValue()).toBe('outer');
expect(await page.frameLocator('iframe').locator(divLocator).locator('input').inputValue()).toBe('inner');
});
+
+it('should fill programmatically enabled textarea', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/36307' } }, async ({ page }) => {
+ await page.setContent(`
+ <button>Enable</button>
+ <form>
+ <textarea id="text" disabled></textarea>
+ </form>
+ <script>
+ document.querySelector('button').addEventListener('click', () => {
+ document.querySelector('#text').disabled = false;
+ });
+ </script>
+ `);
+ await page.locator('button').click();
+ await page.locator('#text').fill('Hello');
+ await expect(page.locator('#text')).toHaveValue('Hello');
+});