test: add a test that pages think they have focus

This commit is contained in:
Joel Einbinder 2020-02-07 15:58:02 -08:00
parent 36344dee27
commit c3430c3deb

View file

@ -15,7 +15,7 @@
* limitations under the License. * 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 {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit, dit} = testRunner; const {it, fit, xit, dit} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = 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);
});
});
}; };