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

tests: add test for page.focus() in Firefox #3478

Merged
merged 1 commit into from
Aug 17, 2020
Merged
Changes from all commits
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
12 changes: 11 additions & 1 deletion test/page-basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ it('should fail with error upon disconnect', async({page, server}) => {
expect(error.message).toContain('Page closed');
});

it('page.ur should work', async({page, server}) => {
it('page.url should work', async({page, server}) => {
expect(page.url()).toBe('about:blank');
await page.goto(server.EMPTY_PAGE);
expect(page.url()).toBe(server.EMPTY_PAGE);
Expand Down Expand Up @@ -242,3 +242,13 @@ it('frame.press should work', async({page, server}) => {
await frame.press('textarea', 'a');
expect(await frame.evaluate(() => document.querySelector('textarea').value)).toBe('a');
});

it.fail(FFOX)('frame.focus should work multiple times', async ({ context, server }) => {
const page1 = await context.newPage()
const page2 = await context.newPage()
for (const page of [page1, page2]) {
await page.setContent(`<button id="foo" onfocus="window.gotFocus=true"></button>`)
await page.focus("#foo")
expect(await page.evaluate(() => !!window['gotFocus'])).toBe(true)
}
});