fix(firefox): enable remaining focus tests (#1803)

This commit is contained in:
Yury Semikhatsky 2020-04-15 18:44:38 -07:00 committed by GitHub
parent 167d265e56
commit 041406a664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -9,7 +9,7 @@
"main": "index.js",
"playwright": {
"chromium_revision": "754895",
"firefox_revision": "1078",
"firefox_revision": "1081",
"webkit_revision": "1193"
},
"scripts": {

View File

@ -450,12 +450,21 @@ describe('focus', function() {
it('should think that it is focused by default', async({page}) => {
expect(await page.evaluate('document.hasFocus()')).toBe(true);
});
it.fail(FFOX)('should think that all pages are focused', async({page}) => {
it('should think that all pages are focused', async({page}) => {
const page2 = await page.context().newPage();
expect(await page.evaluate('document.hasFocus()')).toBe(true);
expect(await page2.evaluate('document.hasFocus()')).toBe(true);
await page2.close();
});
it('should focus popups by default', async({page, server}) => {
await page.goto(server.EMPTY_PAGE);
const [popup] = await Promise.all([
page.waitForEvent('popup'),
page.evaluate(url => { window.open(url); }, server.EMPTY_PAGE),
]);
expect(await popup.evaluate('document.hasFocus()')).toBe(true);
expect(await page.evaluate('document.hasFocus()')).toBe(true);
});
it('should provide target for keyboard events', async({page, server}) => {
const page2 = await page.context().newPage();
await Promise.all([