From bcf5fd87aeeb822203c3388e8aa6dadaa0107690 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com> Date: Fri, 19 May 2023 15:10:43 +0200 Subject: [PATCH] fix: ElementHandle dragAndDrop should fail when interception is disabled (#10209) --- .github/workflows/issue-analyzer.yml | 2 ++ packages/puppeteer-core/src/common/ElementHandle.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/issue-analyzer.yml b/.github/workflows/issue-analyzer.yml index 171c040887c..63aa23c5819 100644 --- a/.github/workflows/issue-analyzer.yml +++ b/.github/workflows/issue-analyzer.yml @@ -100,6 +100,8 @@ jobs: - name: Verify issue timeout-minutes: 10 run: ${{ env.PACKAGE_MANAGER }} run verify + env: + DEBUG: 'puppeteer:*' - uses: actions/upload-artifact@v3 if: success() || failure() with: diff --git a/packages/puppeteer-core/src/common/ElementHandle.ts b/packages/puppeteer-core/src/common/ElementHandle.ts index e8f0f04e4c3..ff0d99d96cc 100644 --- a/packages/puppeteer-core/src/common/ElementHandle.ts +++ b/packages/puppeteer-core/src/common/ElementHandle.ts @@ -502,6 +502,10 @@ export class CDPElementHandle< target: CDPElementHandle, options?: {delay: number} ): Promise { + assert( + this.#page.isDragInterceptionEnabled(), + 'Drag Interception is not enabled!' + ); await this.#scrollIntoViewIfNeeded(); const startPoint = await this.clickablePoint(); const targetPoint = await target.clickablePoint();