mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: cleanup ElementHandle.isIntersectingViewport (#2874)
This patch: - simplifies test reusing the `offscreenbuttons.html` asset - aligns IntersectionObserver usage with the one we have for `ElementHandle._scrollIntoViewIfNeeded`.
This commit is contained in:
@@ -33,7 +33,7 @@ module.exports.addTests = function({testRunner, expect, DeviceDescriptors}) {
|
||||
await page.goto(server.PREFIX + '/offscreenbuttons.html');
|
||||
const messages = [];
|
||||
page.on('console', msg => messages.push(msg.text()));
|
||||
for (let i = 0; i < 10; ++i) {
|
||||
for (let i = 0; i < 11; ++i) {
|
||||
// We might've scrolled to click a button - reset to (0, 0).
|
||||
await page.evaluate(() => window.scrollTo(0, 0));
|
||||
await page.click(`#btn${i}`);
|
||||
@@ -48,7 +48,8 @@ module.exports.addTests = function({testRunner, expect, DeviceDescriptors}) {
|
||||
'button #6 clicked',
|
||||
'button #7 clicked',
|
||||
'button #8 clicked',
|
||||
'button #9 clicked'
|
||||
'button #9 clicked',
|
||||
'button #10 clicked'
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user