Skip to content

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

test(focus): add a failing focus test (#4581)

Pavel Feldman5002b83b4a21
diff --git a/test/focus.spec.ts b/test/focus.spec.ts
index 071d6a8854..992e07036f 100644
--- a/test/focus.spec.ts
+++ b/test/focus.spec.ts
@@ -107,3 +107,13 @@ it('should traverse only form elements', (test, { browserName, platform }) => {
await page.keyboard.press('Alt+Shift+Tab');
expect(await page.evaluate(() => document.activeElement.id)).toBe('input-1');
});
+
+it('clicking checkbox should activate it', (test, { browserName, headful, platform }) => {
+ test.fixme(browserName === 'webkit' && !headful);
+ test.fixme(browserName === 'firefox' && !headful && platform === 'darwin');
+}, async ({ page }) => {
+ await page.setContent(`<input type=checkbox></input>`);
+ await page.click('input');
+ const nodeName = await page.evaluate(() => document.activeElement.nodeName);
+ expect(nodeName).toBe('INPUT');
+});