microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
62.73k stars 3.38k forks source link

[Bug]: slowMo option not slowing down commands #30850

Closed basickarl closed 2 weeks ago

basickarl commented 2 weeks ago

Version

1.43.1

Steps to reproduce

launch options object (file: playwright-component-testing.config.ts):

    launchOptions: {
      // 1
      args: ['--start-maximized'],
      slowMo: 2000,
    },

command run: npx --no playwright test -c playwright-component-testing.config.ts audit --workers 1 --project='chromium' --trace='on' --ui

Result in UI:

image

Expected behavior

Every playwright command slows down by 2000ms (e.g. page.exposeFunction etc.) .

Actual behavior

Only the before hooks seems to slow down by 2000ms.

Additional context

using @playwright/experimental-ct-react

Been reading https://playwright.dev/docs/debug#headed-mode and I'm seeming to follow what it says or?

Environment

npx envinfo --preset playwright

  System:
    OS: macOS 14.1.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 5.98 GB / 64.00 GB
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    Yarn: 4.0.2 - ~/.nvm/versions/node/v20.9.0/bin/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
  Languages:
    Bash: 3.2.57 - /bin/bash
yury-s commented 2 weeks ago

Only "user actions" are slowed down, see this list.

basickarl commented 2 weeks ago

Only "user actions" are slowed down, see this list.

That is interesting! We are using a locator click event:

image

We are triggering this via the following command: await page.getByTestId('ndl-drawer-close-button').click();

Would this not constitute as being a "user action"?