feat(active): emulate active state on webkit

This commit is contained in:
Pavel Feldman 2020-02-11 17:39:41 -08:00
parent f25a27a0a4
commit 3360393d21
3 changed files with 8 additions and 2 deletions

View file

@ -10,7 +10,7 @@
"playwright": {
"chromium_revision": "740289",
"firefox_revision": "1025",
"webkit_revision": "1141"
"webkit_revision": "1143"
},
"scripts": {
"ctest": "cross-env BROWSER=chromium node test/test.js",

View file

@ -68,6 +68,7 @@ export class WKPage implements PageDelegate {
private async _initializePageProxySession() {
const promises: Promise<any>[] = [
this._pageProxySession.send('Dialog.enable'),
this._pageProxySession.send('Emulation.setActiveAndFocused', { active: true }),
this.authenticate(this._page._state.credentials)
];
const contextOptions = this._page.context()._options;

View file

@ -18,7 +18,7 @@
/**
* @type {PageTestSuite}
*/
module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMIUM, WEBKIT}) {
module.exports.describe = function({testRunner, expect, playwright, headless, FFOX, CHROMIUM, WEBKIT}) {
const {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit, dit} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
@ -221,4 +221,9 @@ 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);
});
});
};