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] Dialogs cannot be dismissed if tracing is on in Chromium or Webkit #7048

Closed
mattjennings opened this issue Jun 10, 2021 · 2 comments · Fixed by #7059
Closed

[BUG] Dialogs cannot be dismissed if tracing is on in Chromium or Webkit #7048

mattjennings opened this issue Jun 10, 2021 · 2 comments · Fixed by #7059

Comments

@mattjennings
Copy link

Context:

  • Playwright Version: 1.12.1
  • Operating System: macOS 11.2.3
  • Node.js version: 12.16.3
  • Browser: Chromium, Webkit
  • Extra: Using the @playwright/test runner

Code Snippet

Setup a new playwright project with the following test file and config file:

// test.spec.ts
import { test, expect } from "@playwright/test";

test("basic test", async ({ page }) => {
  await page.goto("https://playwright.dev/");

  page.on("dialog", async (dialog) => {
    console.log('dismissing')

    await dialog.accept(); // hangs here

    console.log('dismissed')
  });

  await page.evaluate(() => {
    confirm("are you sure");
  });

  const name = await page.innerText(".navbar__title");
  expect(name).toBe("Playwright");
});
// playwright.config.ts
export default {
  projects: [
    {
      name: "Chrome",
      use: {
        browserName: "chromium",
        channel: "chrome",
        trace: "on", // works when trace is off
      },
    },

    {
      name: "Firefox",
      use: { browserName: "firefox", trace: "on" }, // works regardless
    },

    {
      name: "WebKit",
      use: { browserName: "webkit", trace: "on" }, // works when trace is off
    },
  ],
};

Describe the bug

When tracing is enabled via playwright.config.ts, dialogs cannot be dismissed. Neither the default dialog dismissing or manual page.on('dialog', dialog => { ... }) methods work. When dismissing manually, it seems to hang at the dialog.accept() method.

@pavelfeldman
Copy link
Member

I wonder if our blocking snapshotter is waiting for dialog. Looking into it, will likely get a fix in a patch.

@aslushnikov aslushnikov added this to the v1.12.2 milestone Jun 11, 2021
@aslushnikov aslushnikov reopened this Jun 11, 2021
aslushnikov pushed a commit to aslushnikov/playwright that referenced this issue Jun 11, 2021
aslushnikov added a commit that referenced this issue Jun 11, 2021
Cherry-Pick #7059 SHA cbce7cb

Fixes #7048

Co-authored-by: Pavel Feldman <pavel.feldman@gmail.com>
@mattjennings
Copy link
Author

Thanks for the quick fix! Much appreciated.

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

Successfully merging a pull request may close this issue.

3 participants