fix: ElementHandle dragAndDrop should fail when interception is disabled (#10209)

This commit is contained in:
Nikolay Vitkov 2023-05-19 15:10:43 +02:00 committed by GitHub
parent 9cba24a961
commit bcf5fd87ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -100,6 +100,8 @@ jobs:
- name: Verify issue - name: Verify issue
timeout-minutes: 10 timeout-minutes: 10
run: ${{ env.PACKAGE_MANAGER }} run verify run: ${{ env.PACKAGE_MANAGER }} run verify
env:
DEBUG: 'puppeteer:*'
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: success() || failure() if: success() || failure()
with: with:

View File

@ -502,6 +502,10 @@ export class CDPElementHandle<
target: CDPElementHandle<Node>, target: CDPElementHandle<Node>,
options?: {delay: number} options?: {delay: number}
): Promise<void> { ): Promise<void> {
assert(
this.#page.isDragInterceptionEnabled(),
'Drag Interception is not enabled!'
);
await this.#scrollIntoViewIfNeeded(); await this.#scrollIntoViewIfNeeded();
const startPoint = await this.clickablePoint(); const startPoint = await this.clickablePoint();
const targetPoint = await target.clickablePoint(); const targetPoint = await target.clickablePoint();