mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat: add ElementHandle.scrollIntoView (#10005)
This commit is contained in:
@@ -509,6 +509,12 @@
|
||||
"parameters": ["cdp", "firefox"],
|
||||
"expectations": ["FAIL"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[click.spec] Page.click should scroll and click with disabled javascript",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["cdp", "firefox"],
|
||||
"expectations": ["FAIL"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[click.spec] Page.click should select the text by triple clicking",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
|
||||
@@ -116,6 +116,18 @@ describe('Page.click', function () {
|
||||
await Promise.all([page.click('a'), page.waitForNavigation()]);
|
||||
expect(page.url()).toBe(server.PREFIX + '/wrappedlink.html#clicked');
|
||||
});
|
||||
it('should scroll and click with disabled javascript', async () => {
|
||||
const {page, server} = getTestState();
|
||||
|
||||
await page.setJavaScriptEnabled(false);
|
||||
await page.goto(server.PREFIX + '/wrappedlink.html');
|
||||
const body = await page.waitForSelector('body');
|
||||
await body!.evaluate(el => {
|
||||
el.style.paddingTop = '3000px';
|
||||
});
|
||||
await Promise.all([page.click('a'), page.waitForNavigation()]);
|
||||
expect(page.url()).toBe(server.PREFIX + '/wrappedlink.html#clicked');
|
||||
});
|
||||
it('should click when one of inline box children is outside of viewport', async () => {
|
||||
const {page} = getTestState();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user