From c3430c3deb4ee9009abfd434ff143c4f78402e08 Mon Sep 17 00:00:00 2001 From: Joel Einbinder Date: Fri, 7 Feb 2020 15:58:02 -0800 Subject: [PATCH] test: add a test that pages think they have focus --- test/emulation.spec.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/emulation.spec.js b/test/emulation.spec.js index 2e849252d8..680eec1eb0 100644 --- a/test/emulation.spec.js +++ b/test/emulation.spec.js @@ -15,7 +15,7 @@ * limitations under the License. */ -module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMIUM, WEBKIT}) { +module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMIUM, WEBKIT, headless}) { const {describe, xdescribe, fdescribe} = testRunner; const {it, fit, xit, dit} = testRunner; const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; @@ -218,4 +218,10 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI }); }); + describe('focus', function() { + it.skip(!headless)('should think that it is focused by default', async({page}) => { + expect(await page.evaluate('document.hasFocus()')).toBe(true); + }); + }); + };