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

[Bug]: DragTo Fails in 1.50 #34688

Open
Tallyb opened this issue Feb 9, 2025 · 5 comments · May be fixed by #34882
Open

[Bug]: DragTo Fails in 1.50 #34688

Tallyb opened this issue Feb 9, 2025 · 5 comments · May be fixed by #34882
Assignees
Labels

Comments

@Tallyb
Copy link

Tallyb commented Feb 9, 2025

Version

1.50.1

Steps to reproduce

Sadly, cannot reproduce.
We have a complex dragTo with force:true.
Test passes on 1.49.1 but fails on 1.50
As this is a complex private dom, not sure how to repro. Some guidelines might help.

Expected behavior

Drag would work

Actual behavior

does not drag. no error is produced.

Additional context

No response

Environment

System:
    OS: macOS 15.3
    CPU: (16) arm64 Apple M4 Max
    Memory: 9.79 GB / 128.00 GB
  Binaries:
    Node: 22.13.1 - ~/.nvm/versions/node/v22.13.1/bin/node
    npm: 11.1.0 - ~/.nvm/versions/node/v22.13.1/bin/npm
  IDEs:
    VSCode: 1.97.0 - /usr/local/bin/code
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: 1.49.1 => 1.50.0
@mxschmitt
Copy link
Member

Hi Tally, we unfortunately need a reproduction in order to triage this issue further. Maybe you can create a self-contained reproduction with the dev team of your site?

@Tallyb
Copy link
Author

Tallyb commented Feb 12, 2025

hola @mxschmitt !
not sure this is actually the problem, but if you can try this one:

import {expect, test} from '@playwright/test';
test('draggable', async ({ page }) => {
  await page.goto('https://material.angular.io/cdk/drag-drop/examples');
  await page.locator('button', { hasText: /got it/ }).click();
  await expect (page.locator('.popup')).toBeHidden();
  const example = page.locator('example-viewer', { hasText: 'Drag&Drop connected sorting group'})
  await example.scrollIntoViewIfNeeded();
  const leftColumn = example.locator('.example-container').nth(0);
  const rightColumn = example.locator('.example-container').nth(1);
  await leftColumn.getByText('Get to work').dragTo(rightColumn.getByText('Take a shower'));
  await expect(rightColumn.getByText('Get to work')).toBeVisible();
});

Dragto is not yelling, but at the same time it does not do what is expected. do I miss anything here? is that a problem with the Angular CDK?

@mxschmitt
Copy link
Member

mxschmitt commented Feb 12, 2025

Investigation notes:

e.g. this makes it pass:

diff --git a/packages/playwright-core/src/server/frames.ts b/packages/playwright-core/src/server/frames.ts
index 2183d3f40..5abf9a8d0 100644
--- a/packages/playwright-core/src/server/frames.ts
+++ b/packages/playwright-core/src/server/frames.ts
@@ -1210,6 +1210,7 @@ export class Frame extends SdkObject {
       dom.assertDone(await this._retryWithProgressIfNotConnected(progress, target, options.strict, false /* performActionPreChecks */, async handle => {
         return handle._retryPointerAction(progress, 'move and up', false, async point => {
           await this._page.mouse.move(point.x, point.y);
+          await this._page.mouse.move(point.x + 1, point.y);
           await this._page.mouse.up();
         }, {
           ...options,

@Tallyb from quickly running this script in v1.49.0 it wasn't passing for me in v1.49.0 either, is this the same what you are experiencing?

@mxschmitt mxschmitt self-assigned this Feb 12, 2025
@Tallyb
Copy link
Author

Tallyb commented Feb 12, 2025

No, this was not passing on 1.49, but as we use angular cdk, I was hoping it will shed some light.

@mxschmitt
Copy link
Member

mxschmitt commented Feb 12, 2025

I'll try to get it fixed and then you can try the @beta version and see if it works there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants