feat(active): emulate active state on webkit (#941)

This commit is contained in:
Pavel Feldman 2020-02-11 19:10:57 -08:00 committed by GitHub
parent 0d16d144b2
commit d05feec740
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -10,7 +10,7 @@
"playwright": {
"chromium_revision": "740289",
"firefox_revision": "1028",
"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);
});
});
};