Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/webkit/wkPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion test/emulation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
});
});
};